fix: correct event type in ForwardMessageDialog and poll response format

- ForwardMessageDialog: use sendEvent instead of sendMessage to preserve
  the original event type (stickers, polls, etc.)
- PollContent: use m.selections for stable m.poll.response (per spec),
  was incorrectly using m.responses
This commit is contained in:
root
2026-05-15 14:43:31 -04:00
parent 977b45f6da
commit 0a29e42b49
2 changed files with 2 additions and 2 deletions
@@ -60,7 +60,7 @@ export function PollContent({
if (isStable) {
mx.sendEvent(roomId, 'm.poll.response' as any, {
'm.relates_to': { rel_type: 'm.reference', event_id: eventId },
'm.responses': [{ 'm.id': answerId }],
'm.selections': [answerId],
});
} else {
mx.sendEvent(roomId, 'org.matrix.msc3381.poll.response' as any, {
@@ -39,7 +39,7 @@ export function ForwardMessageDialog({ mEvent, onClose }: Props) {
const forward = (roomId: string, roomName: string) => {
const fwdContent: Record<string, unknown> = { ...mEvent.getContent() };
delete fwdContent['m.relates_to'];
mx.sendMessage(roomId, fwdContent as any);
mx.sendEvent(roomId, mEvent.getType(), fwdContent as any);
setSentTo(roomName);
setTimeout(onClose, 1200);
};