Merge branch 'GetStream:develop' into develop

This commit is contained in:
bstolinski
2022-02-22 08:58:11 +01:00
committed by GitHub
19 changed files with 463 additions and 51 deletions
@@ -811,6 +811,7 @@ class Channel {
Future<SendReactionResponse> sendReaction(
Message message,
String type, {
int score = 1,
Map<String, Object?> extraData = const {},
bool enforceUnique = false,
}) async {
@@ -829,7 +830,7 @@ class Channel {
createdAt: now,
type: type,
user: user,
score: 1,
score: score,
extraData: extraData,
);
@@ -866,6 +867,7 @@ class Channel {
final reactionResp = await _client.sendReaction(
messageId,
type,
score: score,
extraData: extraData,
enforceUnique: enforceUnique,
);
@@ -1322,7 +1324,8 @@ class Channel {
/// Remove the ban for the user with given [userID] in the channel.
@Deprecated(
"Use 'unbanMember' instead. This method will be removed in v4.0.0")
"Use 'unbanMember' instead. This method will be removed in v4.0.0",
)
Future<EmptyResponse> unbanUser(String userID) => unbanMember(userID);
/// Remove the ban for the member with given [userID] in the channel.
@@ -1073,6 +1073,28 @@ class StreamChatClient {
Future<UpdateUsersResponse> updateUsers(List<User> users) =>
_chatApi.user.updateUsers(users);
/// Partially update the given user with [id].
/// Use [set] to define values to be set.
/// Use [unset] to define values to be unset.
Future<UpdateUsersResponse> partialUpdateUser(
String id, {
Map<String, Object?>? set,
List<String>? unset,
}) {
final user = PartialUpdateUserRequest(
id: id,
set: set,
unset: unset,
);
return partialUpdateUsers([user]);
}
/// Batch partial updates the [users].
Future<UpdateUsersResponse> partialUpdateUsers(
List<PartialUpdateUserRequest> users,
) =>
_chatApi.user.partialUpdateUsers(users);
/// Bans a user from all channels
Future<EmptyResponse> banUser(
String targetUserId, [
@@ -1157,15 +1179,22 @@ class StreamChatClient {
Future<SendReactionResponse> sendReaction(
String messageId,
String reactionType, {
int score = 1,
Map<String, Object?> extraData = const {},
bool enforceUnique = false,
}) =>
_chatApi.message.sendReaction(
messageId,
reactionType,
extraData: extraData,
enforceUnique: enforceUnique,
);
}) {
final _extraData = {
'score': score,
...extraData,
};
return _chatApi.message.sendReaction(
messageId,
reactionType,
extraData: _extraData,
enforceUnique: enforceUnique,
);
}
/// Delete a [reactionType] from this [messageId]
Future<EmptyResponse> deleteReaction(