Exposed score for send reaction in the client side as well
This commit is contained in:
@@ -811,7 +811,7 @@ class Channel {
|
||||
Future<SendReactionResponse> sendReaction(
|
||||
Message message,
|
||||
String type, {
|
||||
int? score,
|
||||
int score = 1,
|
||||
Map<String, Object?> extraData = const {},
|
||||
bool enforceUnique = false,
|
||||
}) async {
|
||||
@@ -830,7 +830,7 @@ class Channel {
|
||||
createdAt: now,
|
||||
type: type,
|
||||
user: user,
|
||||
score: 1,
|
||||
score: score,
|
||||
extraData: extraData,
|
||||
);
|
||||
|
||||
@@ -863,17 +863,11 @@ class Channel {
|
||||
|
||||
state?.addMessage(newMessage);
|
||||
|
||||
if (score != null) {
|
||||
extraData.putIfAbsent(
|
||||
'score',
|
||||
() => score,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
final reactionResp = await _client.sendReaction(
|
||||
messageId,
|
||||
type,
|
||||
score: score,
|
||||
extraData: extraData,
|
||||
enforceUnique: enforceUnique,
|
||||
);
|
||||
|
||||
@@ -1157,15 +1157,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,
|
||||
);
|
||||
}) {
|
||||
extraData.putIfAbsent(
|
||||
'score',
|
||||
() => score,
|
||||
);
|
||||
|
||||
return _chatApi.message.sendReaction(
|
||||
messageId,
|
||||
reactionType,
|
||||
extraData: extraData,
|
||||
enforceUnique: enforceUnique,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete a [reactionType] from this [messageId]
|
||||
Future<EmptyResponse> deleteReaction(
|
||||
|
||||
Reference in New Issue
Block a user