From e1bdb07128929f6f0762a3a32f040b8183225cb6 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 31 Jan 2022 12:53:38 +0530 Subject: [PATCH] feat(llc): deprecate `channel.banUser` in favor of `channel.banMember`. Signed-off-by: xsahil03x --- packages/stream_chat/lib/src/client/channel.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index 28266b14..7d026020 100644 --- a/packages/stream_chat/lib/src/client/channel.dart +++ b/packages/stream_chat/lib/src/client/channel.dart @@ -1318,9 +1318,17 @@ class Channel { } /// Bans the user with given [userID] from the channel. + @Deprecated("Use 'banMember' instead") Future banUser( String userID, Map options, + ) => + banMember(userID, options); + + /// Bans the member with given [userID] from the channel. + Future banMember( + String userID, + Map options, ) async { _checkInitialized(); final opts = Map.from(options) @@ -1332,7 +1340,11 @@ class Channel { } /// Remove the ban for the user with given [userID] in the channel. - Future unbanUser(String userID) async { + @Deprecated("Use 'unbanMember' instead") + Future unbanUser(String userID) => unbanMember(userID); + + /// Remove the ban for the member with given [userID] in the channel. + Future unbanMember(String userID) async { _checkInitialized(); return _client.unbanUser(userID, { 'type': type,