change msgtype to m.emote to be more standard compliant

fixes https://github.com/SableClient/Sable/issues/142
This commit is contained in:
Rye committed 2026-03-10 16:36:16 +01:00
1 parent 48824e37fb
commit bf257981b3
2 files changed
+13 -2

No files matched your search

@@ -217,6 +217,15 @@ function RenderMessageContentInternal({
}
if (msgType === MsgType.Emote) {
if (content['fyi.cisnt.headpat']) {
return (
<MCuteEvent
content={content}
type={CuteEventType.Headpat}
mentionedUserIds={content?.['m.mentions']?.user_ids}
/>
);
}
return (
<MEmote
displayName={displayName}
@@ -358,6 +367,7 @@ function RenderMessageContentInternal({
mentionedUserIds={content?.['m.mentions']?.user_ids}
/>
);
// as fallback to render older events where msgtype was set instead of m.emote with a custom property
if (msgType === 'fyi.cisnt.headpat')
return (
<MCuteEvent
+3 -2
View File
@@ -1375,11 +1375,12 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => {
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);
},
},