Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ee/server/broker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ const {
MS_METRICS = 'false',
MS_METRICS_PORT = '9458',
TRACING_ENABLED = 'false',
SKIP_PROCESS_EVENT_REGISTRATION = 'true',
} = process.env;

const network = new ServiceBroker({
// TODO: Reevaluate, without this setting it was preventing the process to stop
skipProcessEventRegistration: true,
skipProcessEventRegistration: SKIP_PROCESS_EVENT_REGISTRATION === 'true',
transporter: TRANSPORTER,
metrics: {
enabled: MS_METRICS === 'true',
Expand Down
30 changes: 15 additions & 15 deletions server/modules/listeners/listeners.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export class ListenersModule {
notifications: NotificationsModule,
) {
service.onEvent('emoji.deleteCustom', (emoji) => {
notifications.notifyLogged('deleteEmojiCustom', {
notifications.notifyLoggedInThisInstance('deleteEmojiCustom', {
emojiData: emoji,
});
});

service.onEvent('emoji.updateCustom', (emoji) => {
notifications.notifyLogged('updateEmojiCustom', {
notifications.notifyLoggedInThisInstance('updateEmojiCustom', {
emojiData: emoji,
});
});

service.onEvent('notify.ephemeralMessage', (uid, rid, message) => {
notifications.notifyLogged(`${ uid }/message`, {
notifications.notifyLoggedInThisInstance(`${ uid }/message`, {
groupable: false,
...message,
_id: String(Date.now()),
Expand All @@ -40,41 +40,41 @@ export class ListenersModule {
});

service.onEvent('permission.changed', ({ clientAction, data }) => {
notifications.notifyLogged('permissions-changed', clientAction, data);
notifications.notifyLoggedInThisInstance('permissions-changed', clientAction, data);
});

service.onEvent('room.avatarUpdate', ({ _id: rid, avatarETag: etag }) => {
notifications.notifyLogged('updateAvatar', {
notifications.notifyLoggedInThisInstance('updateAvatar', {
rid,
etag,
});
});

service.onEvent('user.avatarUpdate', ({ username, avatarETag: etag }) => {
notifications.notifyLogged('updateAvatar', {
notifications.notifyLoggedInThisInstance('updateAvatar', {
username,
etag,
});
});

service.onEvent('user.deleted', ({ _id: userId }) => {
notifications.notifyLogged('Users:Deleted', {
notifications.notifyLoggedInThisInstance('Users:Deleted', {
userId,
});
});

service.onEvent('user.deleteCustomStatus', (userStatus) => {
notifications.notifyLogged('deleteCustomUserStatus', {
notifications.notifyLoggedInThisInstance('deleteCustomUserStatus', {
userStatusData: userStatus,
});
});

service.onEvent('user.nameChanged', (user) => {
notifications.notifyLogged('Users:NameChanged', user);
notifications.notifyLoggedInThisInstance('Users:NameChanged', user);
});

service.onEvent('user.roleUpdate', (update) => {
notifications.notifyLogged('roles-change', update);
notifications.notifyLoggedInThisInstance('roles-change', update);
});

service.onEvent('userpresence', ({ user }) => {
Expand All @@ -89,7 +89,7 @@ export class ListenersModule {
});

service.onEvent('user.updateCustomStatus', (userStatus) => {
notifications.notifyLogged('updateCustomUserStatus', {
notifications.notifyLoggedInThisInstance('updateCustomUserStatus', {
userStatusData: userStatus,
});
});
Expand Down Expand Up @@ -132,7 +132,7 @@ export class ListenersModule {
type: clientAction,
...role,
};
notifications.streamRoles.emit('roles', payload);
notifications.streamRoles.emitWithoutBroadcast('roles', payload);
});

let autoAssignAgent: IRoutingManagerConfig | undefined;
Expand Down Expand Up @@ -204,7 +204,7 @@ export class ListenersModule {
notifications.notifyAllInThisInstance('public-settings-changed', clientAction, value);
}

notifications.notifyLogged('private-settings-changed', clientAction, value);
notifications.notifyLoggedInThisInstance('private-settings-changed', clientAction, value);
});

service.onEvent('watch.rooms', ({ clientAction, room }): void => {
Expand Down Expand Up @@ -234,11 +234,11 @@ export class ListenersModule {
}
switch (clientAction) {
case 'updated': {
notifications.streamIntegrationHistory.emit(data.integration._id, { id, diff, type: clientAction });
notifications.streamIntegrationHistory.emitWithoutBroadcast(data.integration._id, { id, diff, type: clientAction });
break;
}
case 'inserted': {
notifications.streamIntegrationHistory.emit(data.integration._id, { data, type: clientAction });
notifications.streamIntegrationHistory.emitWithoutBroadcast(data.integration._id, { data, type: clientAction });
break;
}
}
Expand Down