diff --git a/.changeset/fix_msgtype_of_headpat_event.md b/.changeset/fix_msgtype_of_headpat_event.md new file mode 100644 index 00000000..d5c5c7dd --- /dev/null +++ b/.changeset/fix_msgtype_of_headpat_event.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +chang to more standard compliant msgtype `m.emote` for `/headpat` event diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx index 93a697c6..541adc2e 100644 --- a/src/app/components/RenderMessageContent.tsx +++ b/src/app/components/RenderMessageContent.tsx @@ -217,6 +217,15 @@ function RenderMessageContentInternal({ } if (msgType === MsgType.Emote) { + if (content['fyi.cisnt.headpat']) { + return ( + + ); + } return ( ); + // as fallback to render older events where msgtype was set instead of m.emote with a custom property if (msgType === 'fyi.cisnt.headpat') return ( { exe: async (payload) => { const target = payload.trim(); await mx.sendMessage(room.roomId, { - msgtype: 'fyi.cisnt.headpat', + msgtype: 'm.emote', 'm.mentions': { user_ids: target ? [target] : [], }, - body: `*pat pat*`, + body: `pats ${target || 'you'}`, + 'fyi.cisnt.headpat': true, } as any); }, },