forked from Nexus/nexus
fix issue when mentioning room with invalid canonical aliases
This commit is contained in:
parent
720e538dbc
commit
b0d22e5570
3 changed files with 35 additions and 32 deletions
|
|
@ -2,6 +2,7 @@ import "package:hooks_riverpod/hooks_riverpod.dart";
|
|||
import "package:material_ui/material_ui.dart";
|
||||
import "package:nexus/controllers/rooms.dart";
|
||||
import "package:nexus/controllers/via.dart";
|
||||
import "package:nexus/helpers/extensions/get_localpart.dart";
|
||||
import "package:nexus/helpers/extensions/weighted_search.dart";
|
||||
import "package:nexus/widgets/avatars/avatar_or_hash.dart";
|
||||
|
||||
|
|
@ -45,11 +46,9 @@ class const RoomOverlay(
|
|||
addTag(
|
||||
id: "[#$name](matrix:roomid/${room.metadata?.id.substring(1)}$vias)",
|
||||
name:
|
||||
(room.metadata?.canonicalAlias ?? room.metadata?.id)
|
||||
?.substring(1)
|
||||
.split(":")
|
||||
.first ??
|
||||
"",
|
||||
room.metadata?.canonicalAlias?.localpart ??
|
||||
room.metadata?.id ??
|
||||
"Unknown Room",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ class const UserOverlay(
|
|||
ListTile(
|
||||
leading: AvatarOrHash(
|
||||
avatarUrl,
|
||||
displayName ?? member.stateKey!.localpart,
|
||||
displayName ?? member.stateKey!.localpart!,
|
||||
),
|
||||
title: Text(displayName ?? member.stateKey!.localpart),
|
||||
title: Text(displayName ?? member.stateKey!.localpart!),
|
||||
subtitle: Text(member.stateKey!),
|
||||
onTap: () => addTag(
|
||||
id: "[@${displayName ?? member.stateKey!.localpart}](matrix:u/${member.stateKey!.substring(1)})",
|
||||
name: member.stateKey!.localpart,
|
||||
name: member.stateKey!.localpart!,
|
||||
),
|
||||
),
|
||||
_ => SizedBox.shrink(),
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class const TypingIndicator(final String roomId, {super.key})
|
|||
)
|
||||
.value
|
||||
?.displayName ??
|
||||
typingUserId.localpart,
|
||||
typingUserId.localpart!,
|
||||
userId: typingUserId,
|
||||
roomId: roomId,
|
||||
recognizer: recognizers[index],
|
||||
|
|
|
|||
Loading…
Reference in a new issue