From 3e934eee892f69a8f78b94950993000522702769 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Thu, 23 Nov 2023 05:42:33 +0100 Subject: Moderation bot work --- LibMatrix/Helpers/MessageFormatter.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'LibMatrix/Helpers') diff --git a/LibMatrix/Helpers/MessageFormatter.cs b/LibMatrix/Helpers/MessageFormatter.cs index d252e85..3ebc9a2 100644 --- a/LibMatrix/Helpers/MessageFormatter.cs +++ b/LibMatrix/Helpers/MessageFormatter.cs @@ -35,6 +35,11 @@ public static class MessageFormatter { public static string HtmlFormatMention(string id, string? displayName = null) { return $"{displayName ?? id}"; } + + public static string HtmlFormatMessageLink(string roomId, string eventId, string[]? servers = null, string? displayName = null) { + if (servers is not { Length: > 0 }) servers = new[] { roomId.Split(':', 2)[1] }; + return $"{displayName ?? eventId}"; + } #region Extension functions -- cgit 1.4.1