handlematrix: handle basic matrix rich text messages

Added the necessary room capabilities, too. Support for replies,
editing, deletion, and attachments are forthcoming.
This commit is contained in:
Skip R
2025-12-16 18:35:29 -08:00
parent 60171b4fca
commit d82b74fb29
5 changed files with 241 additions and 6 deletions

View File

@@ -56,6 +56,32 @@ func capID() string {
var discordCaps = &event.RoomFeatures{
ID: capID(),
Formatting: event.FormattingFeatureMap{
event.FmtBold: event.CapLevelFullySupported,
event.FmtItalic: event.CapLevelFullySupported,
event.FmtStrikethrough: event.CapLevelFullySupported,
event.FmtInlineCode: event.CapLevelFullySupported,
event.FmtCodeBlock: event.CapLevelFullySupported,
event.FmtSyntaxHighlighting: event.CapLevelFullySupported,
event.FmtBlockquote: event.CapLevelFullySupported,
event.FmtInlineLink: event.CapLevelFullySupported,
event.FmtUserLink: event.CapLevelUnsupported, // TODO: Support.
event.FmtRoomLink: event.CapLevelUnsupported, // TODO: Support.
event.FmtEventLink: event.CapLevelUnsupported, // TODO: Support.
event.FmtAtRoomMention: event.CapLevelUnsupported, // TODO: Support.
event.FmtUnorderedList: event.CapLevelFullySupported,
event.FmtOrderedList: event.CapLevelFullySupported,
event.FmtListStart: event.CapLevelFullySupported,
event.FmtListJumpValue: event.CapLevelUnsupported,
event.FmtCustomEmoji: event.CapLevelUnsupported, // TODO: Support.
},
LocationMessage: event.CapLevelUnsupported,
// TODO: This limit is increased depending on Discord subscription (Nitro).
MaxTextLength: 2000,
// TODO: Support reactions.
// TODO: Support threads.
// TODO: Support editing.
// TODO: Support message deletion.
}
func (dc *DiscordClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *event.RoomFeatures {