chore: Update Matrix SDK and refactor
This commit is contained in:
parent
ea874b3e43
commit
d343c71703
17 changed files with 91 additions and 50 deletions
|
|
@ -134,15 +134,6 @@ class ChatController extends State<Chat> {
|
|||
|
||||
bool showEmojiPicker = false;
|
||||
|
||||
bool get isLeftDMRoom {
|
||||
final room = this.room;
|
||||
final userId = room?.directChatMatrixID;
|
||||
if (room == null || userId == null) return false;
|
||||
return room.isDirectChat &&
|
||||
room.unsafeGetUserFromMemoryOrFallback(userId).membership ==
|
||||
Membership.leave;
|
||||
}
|
||||
|
||||
void recreateChat() async {
|
||||
final room = this.room;
|
||||
final userId = room?.directChatMatrixID;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ class ChatAppBarTitle extends StatelessWidget {
|
|||
tag: 'content_banner',
|
||||
child: Avatar(
|
||||
mxContent: room.avatar,
|
||||
name: room.displayname,
|
||||
name: room.getLocalizedDisplayname(
|
||||
MatrixLocals(L10n.of(context)!),
|
||||
),
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -291,7 +291,8 @@ class ChatView extends StatelessWidget {
|
|||
Brightness.light
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
child: controller.isLeftDMRoom
|
||||
child: controller.room?.isAbandonedDMRoom ==
|
||||
true
|
||||
? Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class InputBar extends StatelessWidget {
|
|||
ret.add({
|
||||
'type': 'room',
|
||||
'mxid': (r.canonicalAlias.isNotEmpty) ? r.canonicalAlias : r.id,
|
||||
'displayname': r.displayname,
|
||||
'displayname': r.getLocalizedDisplayname(),
|
||||
'avatar_url': r.avatar?.toString(),
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue