Skip to content

Commit

Permalink
Merge pull request #1718 from GetStream/fix/reply-update
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x authored Aug 24, 2023
2 parents 329be24 + 78c64a0 commit ddbee93
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
7 changes: 7 additions & 0 deletions packages/stream_chat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Upcoming

🐞 Fixed

- [[#1716]](https://github.com/GetStream/stream-chat-flutter/issues/1716) Fixed client not able to
update message with `type: reply`.

## 6.8.0

🐞 Fixed
Expand Down
8 changes: 8 additions & 0 deletions packages/stream_chat/lib/src/core/models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,16 @@ class Message extends Equatable {
late final MessageState state;

/// The message type.
@JsonKey(includeIfNull: false, toJson: _typeToJson)
final String type;

// We need to skip passing type if it's not regular or system as the API
// does not expect it.
static String? _typeToJson(String type) {
if (['regular', 'system'].contains(type)) return type;
return null;
}

/// The list of attachments, either provided by the user or generated from a
/// command or as a result of URL scraping.
@JsonKey(includeIfNull: false)
Expand Down
38 changes: 24 additions & 14 deletions packages/stream_chat/lib/src/core/models/message.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ddbee93

Please sign in to comment.