mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-04-13 09:59:52 +00:00
send topic changes to IRC, fixes #4
This commit is contained in:
parent
7fe43f2df5
commit
fde0118d38
2 changed files with 17 additions and 3 deletions
|
@ -29,7 +29,7 @@ That said, it is usable for basic chatting.
|
|||
| Channel kicks | ✅ | ❌ ||
|
||||
| Channel bans | 🟨 | ❌ | Bans show up on IRC as kicks |
|
||||
| Channel invites | ✅ | ❌ ||
|
||||
| Channel topics | ❌ | ❌ ||
|
||||
| Channel topics | ✅ | ❌ ||
|
||||
| Channel powers | ❌ | ❌ ||
|
||||
| Encrypted rooms | ❌ | ❌ ||
|
||||
| Message replies <small>(IRCv3)</small> | ❌ | ❌ ||
|
||||
|
|
|
@ -266,8 +266,22 @@ export class Channel {
|
|||
}
|
||||
|
||||
handleMatrixTopic(event: any) {
|
||||
this.topic.set("text", event["content"]["topic"]);
|
||||
this.topic.set("timestamp", event["origin_server_ts"].toString())
|
||||
const topicText = event["content"]?.["topic"];
|
||||
if (!topicText)
|
||||
return;
|
||||
const topicSetter = this.server.getOrCreateMatrixUser(event["sender"]);
|
||||
const topicTS: string = event["origin_server_ts"].toString();
|
||||
this.topic.set("text", topicText);
|
||||
this.topic.set("timestamp", topicTS.substring(0,10))
|
||||
this.topic.set('setter', topicSetter.nick);
|
||||
|
||||
const messageTags = new Map();
|
||||
messageTags.set('msgid', event["event_id"]);
|
||||
messageTags.set('account', topicSetter.accountName);
|
||||
messageTags.set('time', new Date(event["origin_server_ts"]).toISOString())
|
||||
this.ircUsers.forEach((user) => {
|
||||
user.sendToAll(topicSetter.getMask(), 'TOPIC', [this.name, topicText], messageTags);
|
||||
});
|
||||
}
|
||||
|
||||
handleMatrixJoinRule(event: any) {
|
||||
|
|
Loading…
Add table
Reference in a new issue