Skip to content

Commit e164caa

Browse files
authored
fix: add editedAt and pinned #797 (#798)
* Add pinned bool to Message model * Add edited information on TextMessage * Make pin optional * Remove editedByUserId
1 parent 80d5337 commit e164caa

File tree

3 files changed

+160
-70
lines changed

3 files changed

+160
-70
lines changed

packages/flutter_chat_core/lib/src/models/message.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ sealed class Message with _$Message {
4646
/// Timestamp when the message was last updated.
4747
@EpochDateTimeConverter() DateTime? updatedAt,
4848

49+
/// Timestamp when the message was last edited.
50+
@EpochDateTimeConverter() DateTime? editedAt,
51+
4952
/// Map of reaction keys to lists of user IDs who reacted.
5053
Map<String, List<UserID>>? reactions,
5154

55+
/// Indicates if the message is pinned.
56+
bool? pinned,
57+
5258
/// Additional custom metadata associated with the message.
5359
Map<String, dynamic>? metadata,
5460

@@ -95,6 +101,9 @@ sealed class Message with _$Message {
95101
/// Map of reaction keys to lists of user IDs who reacted.
96102
Map<String, List<String>>? reactions,
97103

104+
/// Indicates if the message is pinned.
105+
bool? pinned,
106+
98107
/// Additional custom metadata associated with the message.
99108
Map<String, dynamic>? metadata,
100109

@@ -137,6 +146,9 @@ sealed class Message with _$Message {
137146
/// Map of reaction keys to lists of user IDs who reacted.
138147
Map<String, List<UserID>>? reactions,
139148

149+
/// Indicates if the message is pinned.
150+
bool? pinned,
151+
140152
/// Additional custom metadata associated with the message.
141153
Map<String, dynamic>? metadata,
142154

@@ -197,6 +209,9 @@ sealed class Message with _$Message {
197209
/// Map of reaction keys to lists of user IDs who reacted.
198210
Map<String, List<UserID>>? reactions,
199211

212+
/// Indicates if the message is pinned.
213+
bool? pinned,
214+
200215
/// Additional custom metadata associated with the message.
201216
Map<String, dynamic>? metadata,
202217

@@ -248,6 +263,9 @@ sealed class Message with _$Message {
248263
/// Map of reaction keys to lists of user IDs who reacted.
249264
Map<String, List<UserID>>? reactions,
250265

266+
/// Indicates if the message is pinned.
267+
bool? pinned,
268+
251269
/// Additional custom metadata associated with the message.
252270
Map<String, dynamic>? metadata,
253271

@@ -305,6 +323,9 @@ sealed class Message with _$Message {
305323
/// Map of reaction keys to lists of user IDs who reacted.
306324
Map<String, List<UserID>>? reactions,
307325

326+
/// Indicates if the message is pinned.
327+
bool? pinned,
328+
308329
/// Additional custom metadata associated with the message.
309330
Map<String, dynamic>? metadata,
310331

@@ -359,6 +380,9 @@ sealed class Message with _$Message {
359380
/// Map of reaction keys to lists of user IDs who reacted.
360381
Map<String, List<UserID>>? reactions,
361382

383+
/// Indicates if the message is pinned.
384+
bool? pinned,
385+
362386
/// Additional custom metadata associated with the message.
363387
Map<String, dynamic>? metadata,
364388

@@ -401,6 +425,9 @@ sealed class Message with _$Message {
401425
/// Map of reaction keys to lists of user IDs who reacted.
402426
Map<String, List<UserID>>? reactions,
403427

428+
/// Indicates if the message is pinned.
429+
bool? pinned,
430+
404431
/// Application-specific custom metadata.
405432
Map<String, dynamic>? metadata,
406433
}) = CustomMessage;
@@ -441,6 +468,9 @@ sealed class Message with _$Message {
441468
/// Map of reaction keys to lists of user IDs who reacted.
442469
Map<String, List<UserID>>? reactions,
443470

471+
/// Indicates if the message is pinned.
472+
bool? pinned,
473+
444474
/// Additional custom metadata associated with the message.
445475
Map<String, dynamic>? metadata,
446476
}) = UnsupportedMessage;

0 commit comments

Comments
 (0)