Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1242,23 +1242,32 @@ export class Bridge {
roomId: string,
event: MatrixEvent<MatrixMemberContent>,
) {
log.debug(
`Got invite roomId=${roomId} from=${event.sender} to=${event.state_key}`,
);
if (this.as.isNamespacedUser(event.sender)) {
log.debug(
`Rejecting invite as sender is in our namespace`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Rejecting invite as sender is in our namespace`,
`Rejecting invite to ${roomId} as sender ${event.sender} is in our namespace`,

More context in the log line itself, to help with searching individual lines

);
/* Do not handle invites from our users */
return;
}
const invitedUserId = event.state_key;
if (!invitedUserId) {
log.debug(
`Rejecting invite state key was empty!`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Rejecting invite state key was empty!`,
`Rejecting invite from ${event.sender} to ${roomId} as state key (invited user) is empty!`,

More context in the log line itself, to help with searching individual lines

);
return;
}
log.info(
`Got invite roomId=${roomId} from=${event.sender} to=${invitedUserId}`,
`Processing invite from ${event.sender} to ${roomId} for ${invitedUserId}`,
);

const botUser = this.botUsersManager.getBotUser(invitedUserId);
if (!botUser) {
// We got an invite but it's not a configured bot user, must be for a ghost user
log.debug(
`Rejecting invite to room ${roomId} for ghost user ${invitedUserId}`,
`Rejecting invite to room ${roomId} for non-bot user ${invitedUserId}`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`Rejecting invite to room ${roomId} for non-bot user ${invitedUserId}`,
`Rejecting invite from ${event.sender} to room ${roomId} for non-bot user ${invitedUserId}`,

More context in the log line itself, to help with searching individual lines

);
const client = this.as.getIntentForUserId(invitedUserId).underlyingClient;
return client.leaveRoom(roomId, "Bridge does not support DMing ghosts.");
Expand Down
Loading