about summary refs log tree commit diff
path: root/LibMatrix/Helpers
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-18 22:52:21 +0200
committerRory& <root@rory.gay>2025-05-18 22:52:21 +0200
commit28adb35ab9b6905eebcd83b6caa1b12d49b26be7 (patch)
treede068a338b2e51dcb47e678e3b4e0bb877e70474 /LibMatrix/Helpers
parentRedo bot configuration (diff)
downloadLibMatrix-28adb35ab9b6905eebcd83b6caa1b12d49b26be7.tar.xz
Various bug fixes HEAD master
Diffstat (limited to 'LibMatrix/Helpers')
-rw-r--r--LibMatrix/Helpers/MessageBuilder.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/LibMatrix/Helpers/MessageBuilder.cs b/LibMatrix/Helpers/MessageBuilder.cs

index 5e2b1b7..87a9992 100644 --- a/LibMatrix/Helpers/MessageBuilder.cs +++ b/LibMatrix/Helpers/MessageBuilder.cs
@@ -94,6 +94,16 @@ public class MessageBuilder(string msgType = "m.text", string format = "org.matr public MessageBuilder WithMention(string id, string? displayName = null) { Content.Body += $"@{displayName ?? id}"; Content.FormattedBody += $"<a href=\"https://matrix.to/#/{id}\">{displayName ?? id}</a>"; + if(id == "@room") { + Content.Mentions ??= new(); + Content.Mentions.Room = true; + } + else if (id.StartsWith('@')) { + Content.Mentions ??= new(); + Content.Mentions.Users ??= new(); + Content.Mentions.Users.Add(id); + } + return this; }