Skip to content

Commit 7386e6a

Browse files
Wahid NasriWahid Nasri
Wahid Nasri
authored and
Wahid Nasri
committed
fix group icon in chats screen
1 parent 6c1b1ed commit 7386e6a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/db/dao/message_dao.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class MessageDao extends DatabaseAccessor<MyDatabase> with _$MessageDaoMixin {
8181
// then, in the database class:
8282
Stream<List<ExtendedDbContact>> getConversations() {
8383
return customSelect(
84-
'SELECT c.id, c.first_name, c.last_name, c.avatar, c.room_id, m.mtype as message_type, m.mid as message_id, m.text as message_text, m.moriginality as message_originality, m.send_time '
84+
'SELECT c.id, c.first_name, c.last_name, c.avatar, c.room_id, c.is_group, m.mtype as message_type, m.mid as message_id, m.text as message_text, m.moriginality as message_originality, m.send_time '
8585
'FROM (select id as mid, type as mtype, from_id as mfrom_id, originality as moriginality, room_id as mroom_id, text, send_time from messages order by send_time desc) m JOIN contacts c on c.room_id = m.mroom_id '
8686
'GROUP BY room_id ORDER BY send_time DESC',
8787
readsFrom: {

lib/db/tables/ExtendedDbContact.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ExtendedDbContact {
3636
message_text: json["message_text"],
3737
message_originality: json["message_originality"],
3838
send_time: int.parse(json["send_time"].toString()),
39-
is_group: json["is_group"] == true,
39+
is_group: json["is_group"] == 1,
4040
);
4141
}
4242

lib/ui/extensions/UiMessages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ extension ExtendedExtensions on ExtendedDbContact {
182182
id: id,
183183
avatar: avatar,
184184
roomId: room_id,
185-
isGroup: false);
185+
isGroup: is_group);
186186
}
187187
}
188188

0 commit comments

Comments
 (0)