Skip to content

Commit

Permalink
Regression: Parser message when notify ephemeral message
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Marins committed Apr 28, 2022
1 parent c345f77 commit 0f35cad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/meteor/server/modules/listeners/listeners.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { UserStatus, isSettingColor } from '@rocket.chat/core-typings';
import { parser } from '@rocket.chat/message-parser';

import { IServiceClass } from '../../sdk/types/ServiceClass';
import { NotificationsModule } from '../notifications/notifications.module';
import { EnterpriseSettings } from '../../sdk/index';

const { DISABLE_MESSAGE_PARSER = 'false' } = process.env;

const STATUS_MAP: { [k: string]: number } = {
[UserStatus.OFFLINE]: 0,
[UserStatus.ONLINE]: 1,
Expand Down Expand Up @@ -32,6 +35,10 @@ export class ListenersModule {
});

service.onEvent('notify.ephemeralMessage', (uid, rid, message) => {
if (message.msg && DISABLE_MESSAGE_PARSER !== 'true') {
message.md = parser(message.msg);
}

notifications.notifyUserInThisInstance(uid, 'message', {
groupable: false,
...message,
Expand Down

0 comments on commit 0f35cad

Please sign in to comment.