Compare commits
3 commits
4cb99feeb2
...
2522a74d7c
Author | SHA1 | Date | |
---|---|---|---|
2522a74d7c | |||
d326894b8a | |||
b0ffb45e55 |
6 changed files with 11 additions and 6 deletions
|
@ -147,7 +147,8 @@ async function channelToKState(channel, guild, di) {
|
|||
"m.room.power_levels/": {
|
||||
events_default: everyoneCanSend ? 0 : 50,
|
||||
events: {
|
||||
"m.reaction": 0
|
||||
"m.reaction": 0,
|
||||
"m.room.redaction": 0 // only affects redactions of own events, required to be able to un-react
|
||||
},
|
||||
notifications: {
|
||||
room: everyoneCanMentionEveryone ? 0 : 20
|
||||
|
|
|
@ -154,7 +154,8 @@ test("channel2room: read-only discord channel", async t => {
|
|||
"m.room.power_levels/": {
|
||||
events_default: 50, // <-- it should be read-only!
|
||||
events: {
|
||||
"m.reaction": 0
|
||||
"m.reaction": 0,
|
||||
"m.room.redaction": 0
|
||||
},
|
||||
notifications: {
|
||||
room: 20,
|
||||
|
|
|
@ -148,10 +148,10 @@ async function fetchMessage(messageID) {
|
|||
try {
|
||||
var res = await fetch(`https://api.pluralkit.me/v2/messages/${messageID}`)
|
||||
if (res.ok) return res.json()
|
||||
var errorGetter = res.json
|
||||
var errorGetter = () => res.json()
|
||||
} catch (e) {
|
||||
// Catch any network issues too.
|
||||
errorGetter = e.toString
|
||||
errorGetter = () => e.toString()
|
||||
}
|
||||
|
||||
// I think the backend needs some time to update.
|
||||
|
|
|
@ -62,7 +62,7 @@ async function resolvePendingFiles(message) {
|
|||
/** @param {Ty.Event.Outer_M_Room_Message | Ty.Event.Outer_M_Room_Message_File | Ty.Event.Outer_M_Sticker} event */
|
||||
async function sendEvent(event) {
|
||||
const row = select("channel_room", ["channel_id", "thread_parent"], {room_id: event.room_id}).get()
|
||||
if (!row) return // allow the bot to exist in unbridged rooms, just don't do anything with it
|
||||
if (!row) return [] // allow the bot to exist in unbridged rooms, just don't do anything with it
|
||||
let channelID = row.channel_id
|
||||
let threadID = undefined
|
||||
if (row.thread_parent) {
|
||||
|
|
|
@ -187,6 +187,7 @@ sync.addTemporaryListener(as, "type:m.room.message", guard("m.room.message",
|
|||
async event => {
|
||||
if (utils.eventSenderIsFromDiscord(event.sender)) return
|
||||
const messageResponses = await sendEvent.sendEvent(event)
|
||||
if (!messageResponses.length) return
|
||||
if (event.type === "m.room.message" && event.content.msgtype === "m.text") {
|
||||
// @ts-ignore
|
||||
await matrixCommandHandler.execute(event)
|
||||
|
|
|
@ -75,7 +75,8 @@ module.exports = {
|
|||
"m.room.power_levels/": {
|
||||
events_default: 0,
|
||||
events: {
|
||||
"m.reaction": 0
|
||||
"m.reaction": 0,
|
||||
"m.room.redaction": 0
|
||||
},
|
||||
users: {
|
||||
"@test_auto_invite:example.org": 100
|
||||
|
@ -3025,6 +3026,7 @@ module.exports = {
|
|||
},
|
||||
webhook_id: "1109360903096369153"
|
||||
},
|
||||
|
||||
reply_with_only_embed: {
|
||||
type: 19,
|
||||
tts: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue