[LLC] Add pin message feature

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-19 17:06:45 +05:30
parent 24ce5333ce
commit e9ecd1cc35
8 changed files with 302 additions and 31 deletions
@@ -27,6 +27,13 @@ ChannelState _$ChannelStateFromJson(Map json) {
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
pinnedMessages: (json['pinned_messages'] as List)
?.map((e) => e == null
? null
: Message.fromJson((e as Map)?.map(
(k, e) => MapEntry(k as String, e),
)))
?.toList(),
watcherCount: json['watcher_count'] as int,
watchers: (json['watchers'] as List)
?.map((e) => e == null
@@ -50,6 +57,8 @@ Map<String, dynamic> _$ChannelStateToJson(ChannelState instance) =>
'channel': instance.channel?.toJson(),
'messages': instance.messages?.map((e) => e?.toJson())?.toList(),
'members': instance.members?.map((e) => e?.toJson())?.toList(),
'pinned_messages':
instance.pinnedMessages?.map((e) => e?.toJson())?.toList(),
'watcher_count': instance.watcherCount,
'watchers': instance.watchers?.map((e) => e?.toJson())?.toList(),
'read': instance.read?.map((e) => e?.toJson())?.toList(),