mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-08-05 16:59:10 +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 kicks | ✅ | ❌ ||
|
||||||
| Channel bans | 🟨 | ❌ | Bans show up on IRC as kicks |
|
| Channel bans | 🟨 | ❌ | Bans show up on IRC as kicks |
|
||||||
| Channel invites | ✅ | ❌ ||
|
| Channel invites | ✅ | ❌ ||
|
||||||
| Channel topics | ❌ | ❌ ||
|
| Channel topics | ✅ | ❌ ||
|
||||||
| Channel powers | ❌ | ❌ ||
|
| Channel powers | ❌ | ❌ ||
|
||||||
| Encrypted rooms | ❌ | ❌ ||
|
| Encrypted rooms | ❌ | ❌ ||
|
||||||
| Message replies <small>(IRCv3)</small> | ❌ | ❌ ||
|
| Message replies <small>(IRCv3)</small> | ❌ | ❌ ||
|
||||||
|
|
|
@ -266,8 +266,22 @@ export class Channel {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMatrixTopic(event: any) {
|
handleMatrixTopic(event: any) {
|
||||||
this.topic.set("text", event["content"]["topic"]);
|
const topicText = event["content"]?.["topic"];
|
||||||
this.topic.set("timestamp", event["origin_server_ts"].toString())
|
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) {
|
handleMatrixJoinRule(event: any) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue