diff --git a/matrix/mautrix-discord/default.nix b/matrix/mautrix-discord/default.nix index b34e265..3d4a261 100644 --- a/matrix/mautrix-discord/default.nix +++ b/matrix/mautrix-discord/default.nix @@ -9,6 +9,7 @@ in { pname = "mautrix-discord"; version = inputs.mautrix-discord.lastModifiedDate; src = pkgs.callPackage ./source.nix {}; + patches = [ ./sticker.patch ]; proxyVendor = true; modules = ./gomod2nix.toml; CGO_ENABLED = "1"; diff --git a/matrix/mautrix-discord/sticker.patch b/matrix/mautrix-discord/sticker.patch new file mode 100644 index 0000000..92ab68c --- /dev/null +++ b/matrix/mautrix-discord/sticker.patch @@ -0,0 +1,22 @@ +diff --git a/portal.go b/portal.go +index d93ad17..e5cd370 100644 +--- a/portal.go ++++ b/portal.go +@@ -874,7 +874,7 @@ func (portal *Portal) sendMatrixMessage(intent *appservice.IntentAPI, eventType + + func (portal *Portal) handleMatrixMessages(msg portalMatrixMessage) { + switch msg.evt.Type { +- case event.EventMessage: ++ case event.EventMessage, event.EventSticker: + portal.handleMatrixMessage(msg.user, msg.evt) + case event.EventRedaction: + portal.handleMatrixRedaction(msg.user, msg.evt) +@@ -1138,7 +1138,7 @@ func (portal *Portal) handleMatrixMessage(sender *User, evt *event.Event) { + } + } + sendReq.Content = portal.parseMatrixHTML(sender, content) +- case event.MsgAudio, event.MsgFile, event.MsgImage, event.MsgVideo: ++ case event.MsgAudio, event.MsgFile, event.MsgImage, event.MsgVideo, "": // MsgType is empty when the message is a sticker + data, err := portal.downloadMatrixAttachment(content) + if err != nil { + go portal.sendMessageMetrics(evt, err, "Error downloading media in")