Skip to content
Extraits de code Groupes Projets
Valider 3d3c3786 rédigé par Travis Ralston's avatar Travis Ralston
Parcourir les fichiers

Auto-accept invites for the bridge bot

parent 137a9104
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -86,7 +86,15 @@ export class MatrixRoomHandler { ...@@ -86,7 +86,15 @@ export class MatrixRoomHandler {
} }
public HandleInvite(event: any) { public HandleInvite(event: any) {
// Do nothing yet. log.info("MatrixRoomHandler", "Received invite for " + event.state_key + " in room " + event.room_id);
if (event.state_key === this.botUserId) {
this.bridge.getIntent().getClient().joinRoom(event.room_id).catch(err => {
log.error("MatrixRoomHandler", err);
setTimeout(() => {
this.bridge.getIntent().join(event.room_id).catch(err => log.error("MatrixRoomHandler", err));
}, 5000); // Retry the join in 5 seconds if it failed the first time
});
}
} }
public OnAliasQuery (alias: string, aliasLocalpart: string): Promise<any> { public OnAliasQuery (alias: string, aliasLocalpart: string): Promise<any> {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter