mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-10 20:32:50 +02:00
Don't overwrite room custom topics
This commit is contained in:
parent
eec8b0f15b
commit
ad51079448
9 changed files with 57 additions and 19 deletions
|
@ -164,6 +164,17 @@ async event => {
|
|||
db.prepare("UPDATE channel_room SET nick = ? WHERE room_id = ?").run(name, event.room_id)
|
||||
}))
|
||||
|
||||
sync.addTemporaryListener(as, "type:m.room.topic", guard("m.room.topic",
|
||||
/**
|
||||
* @param {Ty.Event.StateOuter<Ty.Event.M_Room_Topic>} event
|
||||
*/
|
||||
async event => {
|
||||
if (event.state_key !== "") return
|
||||
if (utils.eventSenderIsFromDiscord(event.sender)) return
|
||||
const customTopic = +!!event.content.topic
|
||||
db.prepare("UPDATE channel_room SET custom_topic = ? WHERE room_id = ?").run(customTopic, event.room_id)
|
||||
}))
|
||||
|
||||
sync.addTemporaryListener(as, "type:m.room.pinned_events", guard("m.room.pinned_events",
|
||||
/**
|
||||
* @param {Ty.Event.StateOuter<Ty.Event.M_Room_PinnedEvents>} event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue