From 4781fe9988839b25a6dd0f4ba3947e35d8bc567e Mon Sep 17 00:00:00 2001 From: Tyler Jeong Date: Tue, 12 Sep 2023 14:42:08 +0900 Subject: [PATCH] Add 4.0.11. --- CHANGELOG.md | 5 +++++ README.md | 2 +- lib/src/internal/main/chat/chat.dart | 2 +- .../main/chat_manager/session_manager.dart | 17 +++++++++++------ lib/src/internal/main/utils/string_utils.dart | 6 ++++++ .../feed_channel_change_logs_request.dart | 3 ++- .../feed_channel/feed_channel_list_request.dart | 3 ++- .../group_channel_change_logs_request.dart | 3 ++- .../group_channel_list_request.dart | 3 ++- .../group_channel_read_request.dart | 3 ++- .../channel_my_mute_info_get_request.dart | 3 ++- .../group_channel_count_preference_request.dart | 3 ++- ...oup_channel_push_trigger_option_request.dart | 5 +++-- .../channel_invitation_preference_request.dart | 5 +++-- .../main/app_session_key_update_request.dart | 3 ++- .../user/auth/authenticate_feed_request.dart | 3 ++- .../request/user/block/user_block_request.dart | 3 ++- .../user/block/user_unblock_request.dart | 3 ++- .../count/user_group_channel_count_request.dart | 4 ++-- .../user_unread_channel_count_request.dart | 4 ++-- .../count/user_unread_item_count_request.dart | 3 ++- .../user_unread_message_count_request.dart | 4 ++-- .../user/info/user_info_update_request.dart | 6 ++++-- .../user/list/blocked_user_list_request.dart | 3 ++- .../preference/user_do_not_disturb_request.dart | 5 +++-- .../preference/user_push_sound_request.dart | 5 +++-- .../preference/user_push_template_request.dart | 7 ++++--- .../user_push_trigger_option_request.dart | 5 +++-- .../user/preference/user_snooze_request.dart | 5 +++-- .../user/push/user_push_register_request.dart | 3 ++- .../user/push/user_push_unregister_request.dart | 6 +++--- .../user_meta_data_create_request.dart | 3 ++- .../user_meta_data_delete_request.dart | 5 +++-- .../user_meta_data_update_request.dart | 3 ++- pubspec.yaml | 2 +- 35 files changed, 95 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 937a133f..85f42b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v4.0.11 (Sep 12, 2023) + +### Improvements +- Fixed the bug regarding the url encoding of `userId`. + ## v4.0.10 (Aug 31, 2023) ### Improvements diff --git a/README.md b/README.md index 654d1e4e..e097b671 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o ```yaml dependencies: - sendbird_chat_sdk: ^4.0.10 + sendbird_chat_sdk: ^4.0.11 ``` - Run `flutter pub get` command in your project directory. diff --git a/lib/src/internal/main/chat/chat.dart b/lib/src/internal/main/chat/chat.dart index 163fabb7..f6fe7386 100644 --- a/lib/src/internal/main/chat/chat.dart +++ b/lib/src/internal/main/chat/chat.dart @@ -58,7 +58,7 @@ part 'chat_notifications.dart'; part 'chat_push.dart'; part 'chat_user.dart'; -const sdkVersion = '4.0.10'; +const sdkVersion = '4.0.11'; // Internal implementation for main class. Do not directly access this class. class Chat with WidgetsBindingObserver { diff --git a/lib/src/internal/main/chat_manager/session_manager.dart b/lib/src/internal/main/chat_manager/session_manager.dart index 7176c91a..bb44131d 100644 --- a/lib/src/internal/main/chat_manager/session_manager.dart +++ b/lib/src/internal/main/chat_manager/session_manager.dart @@ -156,15 +156,20 @@ class SessionManager { throw ConnectionRequiredException(); } - var id = ''; - if (userId.length >= 24) { - id = userId.substring(0, 24); + List userId24Data = []; + final userIdData = utf8.encode(userId); + const dataLength = 24; + if (userIdData.length >= dataLength) { + userId24Data.addAll(userIdData.sublist(0, dataLength)); } else { - id = userId + getRandomString(24 - userId.length); + final randomStringData = + utf8.encode(getRandomString(dataLength - userIdData.length)); + userId24Data + ..addAll(userIdData) + ..addAll(randomStringData); } - final userIdData = utf8.encode(id); - final base64UserId = base64.encode(userIdData); + final base64UserId = base64.encode(userId24Data); prefs.setString(_userIdKeyPath, base64UserId); final key = Key.fromUtf8(base64UserId); diff --git a/lib/src/internal/main/utils/string_utils.dart b/lib/src/internal/main/utils/string_utils.dart index 04d62246..f28fe723 100644 --- a/lib/src/internal/main/utils/string_utils.dart +++ b/lib/src/internal/main/utils/string_utils.dart @@ -2,6 +2,8 @@ import 'dart:math'; +import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; + const _chars = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890'; final _random = Random(); @@ -13,3 +15,7 @@ String getRandomString(int length) { String getFileExtension(String fileName) { return ".${fileName.split('.').last}"; } + +String getUrlEncodedUserId(Chat chat, String? userId) { + return Uri.encodeComponent(userId ?? chat.chatContext.currentUserId ?? ''); +} diff --git a/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_change_logs_request.dart b/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_change_logs_request.dart index 443c2996..013b6f8f 100644 --- a/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_change_logs_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_change_logs_request.dart @@ -3,6 +3,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/cache_service.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/channel/channel_cache_extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/model/channel/feed_channel_change_logs.dart'; @@ -20,7 +21,7 @@ class FeedChannelChangeLogsGetRequest extends ApiRequest { String? userId, }) : super(chat: chat) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/my_group_channels/changelogs'; + 'users/${getUrlEncodedUserId(chat, userId)}/my_group_channels/changelogs'; queryParams = params.toJson(); queryParams['show_member'] = true; queryParams['show_read_receipt'] = true; diff --git a/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_list_request.dart b/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_list_request.dart index 8b27ee08..66566337 100644 --- a/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_list_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/feed_channel/feed_channel_list_request.dart @@ -4,6 +4,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/cache_service.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/channel/channel_cache_extensions.dart'; import 'package:sendbird_chat_sdk/src/internal/main/extensions/extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/response/responses.dart'; @@ -18,7 +19,7 @@ class FeedChannelListRequest extends ApiRequest { List options = const [], String? token, }) : super(chat: chat) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/my_group_channels'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/my_group_channels'; queryParams = { 'limit': limit, diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_change_logs_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_change_logs_request.dart index 6ace61c1..5046e7a3 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_change_logs_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_change_logs_request.dart @@ -3,6 +3,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/cache_service.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/channel/channel_cache_extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/model/channel/group_channel_change_logs.dart'; @@ -20,7 +21,7 @@ class GroupChannelChangeLogsGetRequest extends ApiRequest { String? userId, }) : super(chat: chat) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/my_group_channels/changelogs'; + 'users/${getUrlEncodedUserId(chat, userId)}/my_group_channels/changelogs'; queryParams = params.toJson(); queryParams['show_member'] = true; queryParams['show_read_receipt'] = true; diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_list_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_list_request.dart index 2d341d05..6bff8c20 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_list_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_list_request.dart @@ -4,6 +4,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/cache_service.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat_cache/channel/channel_cache_extensions.dart'; import 'package:sendbird_chat_sdk/src/internal/main/extensions/extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/response/responses.dart'; @@ -37,7 +38,7 @@ class GroupChannelListRequest extends ApiRequest { required GroupChannelFilter filter, String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/my_group_channels'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/my_group_channels'; final searchFieldStrings = stringFromSearchFields(searchFields); queryParams = { diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_read_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_read_request.dart index 00dc408f..e2dc3f04 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_read_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/group_channel_read_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -13,7 +14,7 @@ class GroupChannelMarkAsReadRequest extends ApiRequest { List? channelUrls, String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/mark_as_read_all'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/mark_as_read_all'; body = { if (channelUrls != null && channelUrls.isNotEmpty) 'channel_urls': channelUrls, diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/moderation/channel_my_mute_info_get_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/moderation/channel_my_mute_info_get_request.dart index 8f7f97b2..3a420111 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/moderation/channel_my_mute_info_get_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/moderation/channel_my_mute_info_get_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/extensions/extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -18,7 +19,7 @@ class ChannelMyMuteInfoGetRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - '${channelType.urlString}/$channelUrl/mute/${userId ?? chat.chatContext.currentUserId}'; + '${channelType.urlString}/$channelUrl/mute/${getUrlEncodedUserId(chat, userId)}'; } @override diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_count_preference_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_count_preference_request.dart index a0a3c6db..97df5e92 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_count_preference_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_count_preference_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/utils/enum_utils.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -24,7 +25,7 @@ class GroupChannelCountReferenceRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/count_preference/$channelUrl'; + 'users/${getUrlEncodedUserId(chat, userId)}/count_preference/$channelUrl'; body = {'count_preference': countPreferenceEnumMap[prefs]}; } diff --git a/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_push_trigger_option_request.dart b/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_push_trigger_option_request.dart index d7110ab8..d6696fa1 100644 --- a/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_push_trigger_option_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/group_channel/preference/group_channel_push_trigger_option_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/utils/enum_utils.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -24,7 +25,7 @@ class GroupChannelPushTriggerOptionGetRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/push_preference/$channelUrl'; + 'users/${getUrlEncodedUserId(chat, userId)}/push_preference/$channelUrl'; } @override @@ -49,7 +50,7 @@ class GroupChannelPushTriggerOptionSetRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/push_preference/$channelUrl'; + 'users/${getUrlEncodedUserId(chat, userId)}/push_preference/$channelUrl'; body = { 'push_trigger_option': _groupChannelPushTriggerOptionEnumMap[option] }; diff --git a/lib/src/internal/network/http/http_client/request/channel/invitation/channel_invitation_preference_request.dart b/lib/src/internal/network/http/http_client/request/channel/invitation/channel_invitation_preference_request.dart index 1375d2c1..e0e144d4 100644 --- a/lib/src/internal/network/http/http_client/request/channel/invitation/channel_invitation_preference_request.dart +++ b/lib/src/internal/network/http/http_client/request/channel/invitation/channel_invitation_preference_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -14,7 +15,7 @@ class ChannelInvitationPreferenceSetRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/channel_invitation_preference'; + 'users/${getUrlEncodedUserId(chat, userId)}/channel_invitation_preference'; body = {'auto_accept': autoAccept}; } } @@ -28,7 +29,7 @@ class ChannelInvitationPreferenceGetRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { url = - 'users/${userId ?? chat.chatContext.currentUserId}/channel_invitation_preference'; + 'users/${getUrlEncodedUserId(chat, userId)}/channel_invitation_preference'; } @override diff --git a/lib/src/internal/network/http/http_client/request/main/app_session_key_update_request.dart b/lib/src/internal/network/http/http_client/request/main/app_session_key_update_request.dart index 10a01ac8..4da2546f 100644 --- a/lib/src/internal/network/http/http_client/request/main/app_session_key_update_request.dart +++ b/lib/src/internal/network/http/http_client/request/main/app_session_key_update_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -14,7 +15,7 @@ class AppSessionKeyUpdateRequest extends ApiRequest { String? accessToken, String? userId, }) : super(chat: chat) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/session_key'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/session_key'; headers = {'App-Id': appId}; diff --git a/lib/src/internal/network/http/http_client/request/user/auth/authenticate_feed_request.dart b/lib/src/internal/network/http/http_client/request/user/auth/authenticate_feed_request.dart index a9c28472..9828ed13 100644 --- a/lib/src/internal/network/http/http_client/request/user/auth/authenticate_feed_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/auth/authenticate_feed_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/sendbird_chat_sdk.dart'; import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -15,7 +16,7 @@ class AuthenticateFeedRequest extends ApiRequest { String? accessToken, String? apiHost, }) : super(chat: chat, userId: userId) { - url = 'users/$userId/login'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/login'; isAuthenticateFeed = true; // Check diff --git a/lib/src/internal/network/http/http_client/request/user/block/user_block_request.dart b/lib/src/internal/network/http/http_client/request/user/block/user_block_request.dart index 6c72d7b5..a8212a75 100644 --- a/lib/src/internal/network/http/http_client/request/user/block/user_block_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/block/user_block_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/core/user/user.dart'; @@ -14,7 +15,7 @@ class UserBlockRequest extends ApiRequest { String? userId, required String targetId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/block'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/block'; body = {'target_id': targetId}; } diff --git a/lib/src/internal/network/http/http_client/request/user/block/user_unblock_request.dart b/lib/src/internal/network/http/http_client/request/user/block/user_unblock_request.dart index 69ec7126..26bc9ede 100644 --- a/lib/src/internal/network/http/http_client/request/user/block/user_unblock_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/block/user_unblock_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -13,7 +14,7 @@ class UserUnblockRequest extends ApiRequest { String? userId, required String targetId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/block/$targetId'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/block/$targetId'; body = {'target_id': targetId}; } } diff --git a/lib/src/internal/network/http/http_client/request/user/count/user_group_channel_count_request.dart b/lib/src/internal/network/http/http_client/request/user/count/user_group_channel_count_request.dart index ada429f7..616eece1 100644 --- a/lib/src/internal/network/http/http_client/request/user/count/user_group_channel_count_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/count/user_group_channel_count_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -14,8 +15,7 @@ class UserGroupChannelCountGetRequest extends ApiRequest { MyMemberStateFilter filter, { String? userId, }) : super(chat: chat, userId: userId) { - url = - 'users/${userId ?? chat.chatContext.currentUserId}/group_channel_count'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/group_channel_count'; queryParams = {'state': memberStateFilterEnumForGroupCount(filter)}; } diff --git a/lib/src/internal/network/http/http_client/request/user/count/user_unread_channel_count_request.dart b/lib/src/internal/network/http/http_client/request/user/count/user_unread_channel_count_request.dart index 76dfcfab..c2d1bee7 100644 --- a/lib/src/internal/network/http/http_client/request/user/count/user_unread_channel_count_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/count/user_unread_channel_count_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/utils/enum_utils.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -16,8 +17,7 @@ class UserTotalUnreadChannelCountGetRequest extends ApiRequest { GroupChannelTotalUnreadChannelCountParams? params, String? userId, }) : super(chat: chat, userId: userId) { - url = - 'users/${userId ?? chat.chatContext.currentUserId}/unread_channel_count'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/unread_channel_count'; final customTypes = params?.channelCustomTypes ?? []; final superFilter = params?.superChannelFilter ?? SuperChannelFilter.all; queryParams = { diff --git a/lib/src/internal/network/http/http_client/request/user/count/user_unread_item_count_request.dart b/lib/src/internal/network/http/http_client/request/user/count/user_unread_item_count_request.dart index e2918c4e..74bd8462 100644 --- a/lib/src/internal/network/http/http_client/request/user/count/user_unread_item_count_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/count/user_unread_item_count_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -35,7 +36,7 @@ class UserUnreadItemCountGetRequest extends ApiRequest { List keys, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/unread_item_count'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/unread_item_count'; queryParams = { 'item_keys': keys.map((e) => unreadItemKeyEnumMap[e]).toList() }; diff --git a/lib/src/internal/network/http/http_client/request/user/count/user_unread_message_count_request.dart b/lib/src/internal/network/http/http_client/request/user/count/user_unread_message_count_request.dart index 3d35aa6e..91f3c724 100644 --- a/lib/src/internal/network/http/http_client/request/user/count/user_unread_message_count_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/count/user_unread_message_count_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/utils/enum_utils.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -17,8 +18,7 @@ class UserTotalUnreadMessageCountGetRequest extends ApiRequest { GroupChannelTotalUnreadMessageCountParams? params, String? userId, }) : super(chat: chat, userId: userId) { - url = - 'users/${userId ?? chat.chatContext.currentUserId}/unread_message_count'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/unread_message_count'; final customTypes = params?.channelCustomTypes ?? []; final superFilter = params?.superChannelFilter ?? SuperChannelFilter.all; queryParams = { diff --git a/lib/src/internal/network/http/http_client/request/user/info/user_info_update_request.dart b/lib/src/internal/network/http/http_client/request/user/info/user_info_update_request.dart index 21ee255f..3a5bf61a 100644 --- a/lib/src/internal/network/http/http_client/request/user/info/user_info_update_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/info/user_info_update_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/core/channel/base_channel/base_channel.dart'; @@ -20,11 +21,12 @@ class UserInfoUpdateRequest extends ApiRequest { List? preferredLanguages, ProgressHandler? progressHandler, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}'; + url = 'users/${getUrlEncodedUserId(chat, userId)}'; body = { 'nickname': nickname, if (profileFileInfo != null) 'profile_file': profileFileInfo, - if (profileFileInfo?.fileUrl != null) 'profile_url': profileFileInfo?.fileUrl, + if (profileFileInfo?.fileUrl != null) + 'profile_url': profileFileInfo?.fileUrl, 'discovery_keys': discoveryKeys, 'preferred_languages': preferredLanguages, }; diff --git a/lib/src/internal/network/http/http_client/request/user/list/blocked_user_list_request.dart b/lib/src/internal/network/http/http_client/request/user/list/blocked_user_list_request.dart index d544269c..527630ab 100644 --- a/lib/src/internal/network/http/http_client/request/user/list/blocked_user_list_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/list/blocked_user_list_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/response/responses.dart'; @@ -16,7 +17,7 @@ class BlockedUserListRequest extends ApiRequest { String? token, String? userId, }) : super(chat: chat) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/block'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/block'; queryParams = { 'limit': limit, if (token != null) 'token': token, diff --git a/lib/src/internal/network/http/http_client/request/user/preference/user_do_not_disturb_request.dart b/lib/src/internal/network/http/http_client/request/user/preference/user_do_not_disturb_request.dart index a84f5947..17149220 100644 --- a/lib/src/internal/network/http/http_client/request/user/preference/user_do_not_disturb_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/preference/user_do_not_disturb_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/model/chat/do_not_disturb.dart'; @@ -19,7 +20,7 @@ class UserDoNotDisturbSetRequest extends ApiRequest { String timezone = 'UTC', String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; body = { 'do_not_disturb': enable, 'start_hour': startHour, @@ -39,7 +40,7 @@ class UserDoNotDisturbGetRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; } @override diff --git a/lib/src/internal/network/http/http_client/request/user/preference/user_push_sound_request.dart b/lib/src/internal/network/http/http_client/request/user/preference/user_push_sound_request.dart index ab0657be..5819e800 100644 --- a/lib/src/internal/network/http/http_client/request/user/preference/user_push_sound_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/preference/user_push_sound_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -13,7 +14,7 @@ class UserPushSoundSetRequest extends ApiRequest { String sound, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; body = {'push_sound': sound}; } } @@ -26,7 +27,7 @@ class UserPushSoundGetRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; } @override diff --git a/lib/src/internal/network/http/http_client/request/user/preference/user_push_template_request.dart b/lib/src/internal/network/http/http_client/request/user/preference/user_push_template_request.dart index e9d4ffc8..c8c820f4 100644 --- a/lib/src/internal/network/http/http_client/request/user/preference/user_push_template_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/preference/user_push_template_request.dart @@ -1,8 +1,9 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; -import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; +import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; class UserPushTemplateSetRequest extends ApiRequest { @override @@ -13,7 +14,7 @@ class UserPushTemplateSetRequest extends ApiRequest { String name, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push/template'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push/template'; body = {'name': name}; } } @@ -26,7 +27,7 @@ class UserPushTemplateGetRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push/template'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push/template'; } @override diff --git a/lib/src/internal/network/http/http_client/request/user/preference/user_push_trigger_option_request.dart b/lib/src/internal/network/http/http_client/request/user/preference/user_push_trigger_option_request.dart index 9bba6626..ca84ac65 100644 --- a/lib/src/internal/network/http/http_client/request/user/preference/user_push_trigger_option_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/preference/user_push_trigger_option_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/utils/enum_utils.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -21,7 +22,7 @@ class UserPushTriggerOptionSetRequest extends ApiRequest { PushTriggerOption option, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; body = {'push_trigger_option': _pushTriggerOptionEnumMap[option]}; } } @@ -34,7 +35,7 @@ class UserPushTriggerOptionGetRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; } @override diff --git a/lib/src/internal/network/http/http_client/request/user/preference/user_snooze_request.dart b/lib/src/internal/network/http/http_client/request/user/preference/user_snooze_request.dart index 2432337a..45084587 100644 --- a/lib/src/internal/network/http/http_client/request/user/preference/user_snooze_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/preference/user_snooze_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/model/chat/snooze_period.dart'; @@ -16,7 +17,7 @@ class UserSnoozePeriodSetRequest extends ApiRequest { DateTime? endDate, String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; body = { 'snooze_enabled': enable, if (startDate != null) @@ -34,7 +35,7 @@ class UserSnoozePeriodGetRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push_preference'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push_preference'; } @override diff --git a/lib/src/internal/network/http/http_client/request/user/push/user_push_register_request.dart b/lib/src/internal/network/http/http_client/request/user/push/user_push_register_request.dart index 020ace62..983e1654 100644 --- a/lib/src/internal/network/http/http_client/request/user/push/user_push_register_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/push/user_push_register_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -22,7 +23,7 @@ class UserPushTokenRegisterRequest extends ApiRequest { return; } - url = 'users/${userId ?? chat.chatContext.currentUserId}/push/$typeUrl'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push/$typeUrl'; body = { if (type == PushTokenType.fcm) 'gcm_reg_token': token, diff --git a/lib/src/internal/network/http/http_client/request/user/push/user_push_unregister_request.dart b/lib/src/internal/network/http/http_client/request/user/push/user_push_unregister_request.dart index 0d7fefb1..da9eb063 100644 --- a/lib/src/internal/network/http/http_client/request/user/push/user_push_unregister_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/push/user_push_unregister_request.dart @@ -2,6 +2,7 @@ import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; import 'package:sendbird_chat_sdk/src/internal/main/extensions/extensions.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; import 'package:sendbird_chat_sdk/src/public/main/define/enums.dart'; @@ -17,8 +18,7 @@ class UserPushTokenUnregisterRequest extends ApiRequest { String? userId, }) : super(chat: chat, userId: userId) { final typeString = type == PushTokenType.fcm ? 'gcm' : type.asString(); - url = - 'users/${userId ?? chat.chatContext.currentUserId}/push/$typeString/$token'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push/$typeString/$token'; } } @@ -30,6 +30,6 @@ class UserPushTokenUnregisterAllRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/push'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/push'; } } diff --git a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_create_request.dart b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_create_request.dart index 0ee08b81..2cbd5153 100644 --- a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_create_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_create_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -13,7 +14,7 @@ class UserMetaDataCreateRequest extends ApiRequest { Map metaData, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/metadata'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/metadata'; body = {'metadata': metaData, 'upsert': true}; } diff --git a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_delete_request.dart b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_delete_request.dart index 655c8cad..2b329958 100644 --- a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_delete_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_delete_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -13,7 +14,7 @@ class UserMetaDataDeleteRequest extends ApiRequest { String key, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/metadata/$key'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/metadata/$key'; } } @@ -25,6 +26,6 @@ class UserMetaDataDeleteAllRequest extends ApiRequest { Chat chat, { String? userId, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/metadata'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/metadata'; } } diff --git a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_update_request.dart b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_update_request.dart index a4cf482c..ec1d94a1 100644 --- a/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_update_request.dart +++ b/lib/src/internal/network/http/http_client/request/user/user_meta_data/user_meta_data_update_request.dart @@ -1,6 +1,7 @@ // Copyright (c) 2023 Sendbird, Inc. All rights reserved. import 'package:sendbird_chat_sdk/src/internal/main/chat/chat.dart'; +import 'package:sendbird_chat_sdk/src/internal/main/utils/string_utils.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/http_client.dart'; import 'package:sendbird_chat_sdk/src/internal/network/http/http_client/request/api_request.dart'; @@ -14,7 +15,7 @@ class UserMetaDataUpdateRequest extends ApiRequest { String? userId, bool upsert = true, }) : super(chat: chat, userId: userId) { - url = 'users/${userId ?? chat.chatContext.currentUserId}/metadata'; + url = 'users/${getUrlEncodedUserId(chat, userId)}/metadata'; body = {'metadata': metaData, 'upsert': upsert}; } diff --git a/pubspec.yaml b/pubspec.yaml index cdea374f..7b3eefce 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sendbird_chat_sdk description: With Sendbird Chat for Flutter, you can easily build an in-app chat with all the essential messaging features. -version: 4.0.10 +version: 4.0.11 homepage: https://sendbird.com repository: https://github.com/sendbird/sendbird-chat-sdk-flutter documentation: https://sendbird.com/docs/chat/sdk/v4/flutter/getting-started/send-first-message