From 85813b22e5bded743f09ba9948fea18ff3c45654 Mon Sep 17 00:00:00 2001
From: celogeek <65178+celogeek@users.noreply.github.com>
Date: Sun, 7 Feb 2021 17:50:40 +0100
Subject: [PATCH] add missing msgtype = m.sticker

On iOS the message is sent twice, with a duplicate event_id.
It cause error on logs, in different places (synapse, mautrix, ...)

It required to fix the already existing json or reimport the stickers.

The "packs/scalar*" example already include this field, and it works.
---
 sticker/lib/matrix.py | 1 +
 sticker/lib/util.py   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sticker/lib/matrix.py b/sticker/lib/matrix.py
index 6d075bf..02fa925 100644
--- a/sticker/lib/matrix.py
+++ b/sticker/lib/matrix.py
@@ -42,6 +42,7 @@ if TYPE_CHECKING:
         url: str
         info: MediaInfo
         id: str
+        msgtype: str
 else:
     MediaInfo = None
     StickerInfo = None
diff --git a/sticker/lib/util.py b/sticker/lib/util.py
index 240e8ea..20c8763 100644
--- a/sticker/lib/util.py
+++ b/sticker/lib/util.py
@@ -74,4 +74,5 @@ def make_sticker(mxc: str, width: int, height: int, size: int,
                 "mimetype": "image/png",
             },
         },
+        "msgtype": "m.sticker",
     }
-- 
GitLab