Skip to content
Extraits de code Groupes Projets
Valider 17163dde rédigé par Jonas Herzig's avatar Jonas Herzig
Parcourir les fichiers

Send read receipt for successfully bridged Matrix event (closes #326)

parent ed12b5cb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -24,6 +24,9 @@ bridge:
# Enable users to bridge rooms using !discord commands. See
# https://t2bot.io/discord for instructions.
enableSelfServiceBridging: false
# Disable sending of read receipts for Matrix events which have been
# successfully bridged to Discord.
disableReadReceipts: false
# Authentication configuration for the discord bot.
auth:
clientID: "12345"
......
......@@ -20,6 +20,8 @@ properties:
type: "boolean"
enableSelfServiceBridging:
type: "boolean"
disableReadReceipts:
type: "boolean"
auth:
type: "object"
required: ["botToken", "clientID"]
......
......@@ -321,6 +321,9 @@ export class DiscordBot {
evt.ChannelId = channel.id;
await this.store.Insert(evt);
});
if (!this.config.bridge.disableReadReceipts) {
await this.bridge.getIntent().sendReadReceipt(event.room_id, event.event_id)
}
}
public async ProcessMatrixMsgEvent(event: IMatrixEvent, guildId: string, channelId: string): Promise<void> {
......@@ -393,6 +396,9 @@ export class DiscordBot {
evt.ChannelId = channelId;
await this.store.Insert(evt);
});
if (!this.config.bridge.disableReadReceipts) {
await this.bridge.getIntent().sendReadReceipt(event.room_id, event.event_id)
}
return;
}
......
......@@ -35,6 +35,7 @@ class DiscordBridgeConfigBridge {
public disableDiscordMentions: boolean;
public disableDeletionForwarding: boolean;
public enableSelfServiceBridging: boolean;
public disableReadReceipts: boolean;
public disableEveryoneMention: boolean = false;
public disableHereMention: boolean = false;
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter