From 5affd9f061e75f6575a2fe6715f9e8757cfe87e8 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Thu, 14 Dec 2023 07:20:46 +0100 Subject: Cleanup --- LibMatrix/Helpers/MessageFormatter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'LibMatrix/Helpers/MessageFormatter.cs') diff --git a/LibMatrix/Helpers/MessageFormatter.cs b/LibMatrix/Helpers/MessageFormatter.cs index 03efeec..f275b57 100644 --- a/LibMatrix/Helpers/MessageFormatter.cs +++ b/LibMatrix/Helpers/MessageFormatter.cs @@ -6,7 +6,7 @@ namespace LibMatrix.Helpers; public static class MessageFormatter { public static RoomMessageEventContent FormatError(string error) { return new RoomMessageEventContent(body: error, messageType: "m.text") { - FormattedBody = $"{error}: {error}", + FormattedBody = $"{error}", Format = "org.matrix.custom.html" }; } @@ -46,4 +46,11 @@ public static class MessageFormatter { public static RoomMessageEventContent ToMatrixMessage(this Exception e, string error) => FormatException(error, e); #endregion + + public static RoomMessageEventContent FormatWarning(string warning) { + return new RoomMessageEventContent(body: warning, messageType: "m.text") { + FormattedBody = $"{warning}", + Format = "org.matrix.custom.html" + }; + } } -- cgit 1.4.1