support tombstones

This commit is contained in:
emerson 2023-07-03 13:55:09 +00:00
parent 5b32104a1a
commit 550f8a4dd5

View file

@ -267,6 +267,9 @@ export class IRCServer {
case 'm.room.redaction':
this.handleMatrixRedaction(nextEvent, targetChannel);
break;
case 'm.room.tombstone':
this.handleMatrixTombstone(nextEvent,targetChannel);
break;
case 'm.room.topic':
this.handleMatrixTopic(nextEvent, targetChannel);
break;
@ -600,6 +603,14 @@ export class IRCServer {
}
}
handleMatrixTombstone(event: any, targetChannel: Channel) {
const newRoom = event["content"]?.["replacement_room"];
if (!newRoom)
return
const message = `This room has been replaced by ${newRoom}, please join that room using another client`
this.client.sendMessage(this.name, 'NOTICE', [targetChannel.name, message], new Map());
}
handleMatrixTopic(event: any, targetChannel: Channel) {
const topicText = event["content"]?.["topic"];
if (!topicText)