Gomuks SDK Rewrite #2

Closed
Henry-Hiles wants to merge 34 commits from go into main
2 changed files with 11 additions and 6 deletions
Showing only changes of commit 8946353228 - Show all commits

Working mentions

Henry Hiles 2026-01-30 11:25:02 +01:00
No known key found for this signature in database

View file

@ -86,7 +86,8 @@ class RoomChatController extends AsyncNotifier<ChatController> {
await client.getRoomState(
GetRoomStateRequest(
roomId: roomId,
fetchMembers: room.metadata?.hasMemberList == false,
fetchMembers: true,
includeMembers: false,
),
);
@ -182,9 +183,7 @@ class RoomChatController extends AsyncNotifier<ChatController> {
taggedMessage = taggedMessage.replaceAllMapped(
pattern,
(match) => match.group(
1,
)!, // TODO: Return an HTML or Markdown link from here, not plaintext
(match) => match.group(1)!,
);
}
@ -192,7 +191,13 @@ class RoomChatController extends AsyncNotifier<ChatController> {
client.sendMessage(
SendMessageRequest(
roomId: roomId,
mentions: Mentions(), // TODO: Add parsed mentions
mentions: Mentions(
userIds: [
if (relation != null && relationType == RelationType.reply)
relation.authorId,
].toIList(),
room: taggedMessage.contains("@room"),
),
text: taggedMessage,
relation: relation == null
? null

View file

@ -71,7 +71,7 @@ class MentionOverlay extends ConsumerWidget {
member.authorId,
),
onTap: () => addTag(
id: member.authorId,
id: "[@${member.content["displayname"]}](https://matrix.to/#/${member.authorId})",
name: member.authorId
.substring(1)
.split(":")