Merge pull request #1056 from GetStream/hotfix/hardDeletedMessages

fix(llc): Hard delete from dashboard does not delete message from client
This commit is contained in:
Salvatore Giordano
2022-04-04 11:31:37 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -8,6 +8,7 @@
- [[#1047]](https://github.com/GetStream/stream-chat-flutter/issues/1047) `own_capabilities` extraData missing after - [[#1047]](https://github.com/GetStream/stream-chat-flutter/issues/1047) `own_capabilities` extraData missing after
channel update. channel update.
- [[#1054]](https://github.com/GetStream/stream-chat-flutter/issues/1054) Fix `Unsupported operation: Cannot remove from an unmodifiable list`. - [[#1054]](https://github.com/GetStream/stream-chat-flutter/issues/1054) Fix `Unsupported operation: Cannot remove from an unmodifiable list`.
- [[#1033]](https://github.com/GetStream/stream-chat-flutter/issues/1033) Hard delete from dashboard does not delete message from client.
✅ Added ✅ Added
@@ -1094,7 +1094,6 @@ class Channel {
// remove the passed message if response does // remove the passed message if response does
// not contain message // not contain message
state!.removeMessage(message); state!.removeMessage(message);
await _client.chatPersistenceClient?.deleteMessageById(messageId);
} }
return res; return res;
} }
@@ -1851,7 +1850,9 @@ class ChannelClientState {
} }
/// Remove a [message] from this [channelState]. /// Remove a [message] from this [channelState].
void removeMessage(Message message) { void removeMessage(Message message) async {
await _channel._client.chatPersistenceClient?.deleteMessageById(message.id);
final parentId = message.parentId; final parentId = message.parentId;
// i.e. it's a thread message, Remove it // i.e. it's a thread message, Remove it
if (parentId != null) { if (parentId != null) {