about summary refs log tree commit diff
path: root/LibMatrix/Helpers/MessageBuilder.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-04-24 01:36:14 +0200
committerRory& <root@rory.gay>2025-04-24 01:36:14 +0200
commit6db2a6bf7a203c05d478d3b6b5a7636fe622ffb3 (patch)
tree5420a0757778e0e5f79dda9721fbfeb9c5b210a4 /LibMatrix/Helpers/MessageBuilder.cs
parentAllow early return in SyncHelper, trim access token if path used, fix shutdow... (diff)
downloadLibMatrix-6db2a6bf7a203c05d478d3b6b5a7636fe622ffb3.tar.xz
Fix command names with spaces, allow specifying formatted body in MessageBuilder#WithBody
Diffstat (limited to 'LibMatrix/Helpers/MessageBuilder.cs')
-rw-r--r--LibMatrix/Helpers/MessageBuilder.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/LibMatrix/Helpers/MessageBuilder.cs b/LibMatrix/Helpers/MessageBuilder.cs

index d3bd6a5..5e2b1b7 100644 --- a/LibMatrix/Helpers/MessageBuilder.cs +++ b/LibMatrix/Helpers/MessageBuilder.cs
@@ -10,9 +10,9 @@ public class MessageBuilder(string msgType = "m.text", string format = "org.matr public RoomMessageEventContent Build() => Content; - public MessageBuilder WithBody(string body) { + public MessageBuilder WithBody(string body, string? formattedBody = null) { Content.Body += body; - Content.FormattedBody += body; + Content.FormattedBody += formattedBody ?? body; return this; } @@ -112,7 +112,7 @@ public class MessageBuilder(string msgType = "m.text", string format = "org.matr public class TableBuilder(MessageBuilder msb) { public TableBuilder WithTitle(string title, int colspan) { msb.Content.Body += title + "\n"; - msb.Content.FormattedBody += $"<thead><tr><th colspan=\"{colspan}\">{title}</th></tr></thead>"; + msb.Content.FormattedBody += $"<thead><tr><th colspan=\"{colspan}\">{title}</th></tr></thead><br/>"; return this; }