Skip to content

Commit

Permalink
Fix mention plugin crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
7PH committed Aug 10, 2024
1 parent 91f2339 commit 66343a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/server/plugins/core/room/MentionPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export class MentionPlugin extends RoomPlugin {
async run(): Promise<void> {}

// Intercept quotes in messages
public async onBeforeMessageBroadcastHook(message: Message, connection: Connection) {
public async onBeforeMessageBroadcastHook(message: Message, connection?: Connection) {
// It is currently not possible to mention an user if there's not connection the mention originates from
if (!connection) {
return message;
}

if (connection.session.user.right < Config.PREFERENCES.minRightForUserMention) {
return message;
}
Expand Down

0 comments on commit 66343a3

Please sign in to comment.