Fix creating webhooks for matrix users
This commit is contained in:
@@ -129,6 +129,8 @@ function onMessageDelete(messageID) {
|
|||||||
* @param {string} roomID
|
* @param {string} roomID
|
||||||
*/
|
*/
|
||||||
async function getWebhookSenderId(message, guildID, roomID) {
|
async function getWebhookSenderId(message, guildID, roomID) {
|
||||||
|
const isMatrixWebhook = select("webhook", "webhook_id", {webhook_id: message.webhook_id}).pluck().get()
|
||||||
|
if (isMatrixWebhook) return null
|
||||||
const speedbumpUserID = select("channel_speedbump", "speedbump_user_id", {channel_id: message.channel_id, speedbump_webhook_id: message.webhook_id}).pluck().get()
|
const speedbumpUserID = select("channel_speedbump", "speedbump_user_id", {channel_id: message.channel_id, speedbump_webhook_id: message.webhook_id}).pluck().get()
|
||||||
const useWebhookProfile = select("guild_space", "webhook_profile", {guild_id: guildID}).pluck().get() ?? 0
|
const useWebhookProfile = select("guild_space", "webhook_profile", {guild_id: guildID}).pluck().get() ?? 0
|
||||||
if (speedbumpUserID === "466378653216014359") { // PluralKit public instance
|
if (speedbumpUserID === "466378653216014359") { // PluralKit public instance
|
||||||
|
|||||||
@@ -1612,7 +1612,7 @@ test("message2event: expired/invalid invites are sent as-is", async t => {
|
|||||||
snow: {
|
snow: {
|
||||||
invite: {
|
invite: {
|
||||||
async getInvite() {
|
async getInvite() {
|
||||||
throw new Error(`{"message": "Unknown Invite", "code": 10006}`)
|
throw new Error(`Unknown Invite`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user