|
|
|
|
@ -2,7 +2,7 @@ import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; |
|
|
|
|
import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings'; |
|
|
|
|
import type { IServiceClass } from '@rocket.chat/core-services'; |
|
|
|
|
import { EnterpriseSettings } from '@rocket.chat/core-services'; |
|
|
|
|
import { isSettingColor, isSettingEnterprise } from '@rocket.chat/core-typings'; |
|
|
|
|
import { isSettingColor, isSettingEnterprise, UserStatus } from '@rocket.chat/core-typings'; |
|
|
|
|
import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; |
|
|
|
|
import { Logger } from '@rocket.chat/logger'; |
|
|
|
|
import { parse } from '@rocket.chat/message-parser'; |
|
|
|
|
@ -12,6 +12,14 @@ import type { NotificationsModule } from '../notifications/notifications.module' |
|
|
|
|
|
|
|
|
|
const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true'; |
|
|
|
|
|
|
|
|
|
const STATUS_MAP: Record<UserStatus, 0 | 1 | 2 | 3> = { |
|
|
|
|
[UserStatus.OFFLINE]: 0, |
|
|
|
|
[UserStatus.ONLINE]: 1, |
|
|
|
|
[UserStatus.AWAY]: 2, |
|
|
|
|
[UserStatus.BUSY]: 3, |
|
|
|
|
[UserStatus.DISABLED]: 0, |
|
|
|
|
} as const; |
|
|
|
|
|
|
|
|
|
const minimongoChangeMap: Record<string, string> = { |
|
|
|
|
inserted: 'added', |
|
|
|
|
updated: 'changed', |
|
|
|
|
@ -145,10 +153,10 @@ export class ListenersModule { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
notifications.notifyLoggedInThisInstance('user-status', [_id, username, status, statusText, name, roles]); |
|
|
|
|
notifications.notifyLoggedInThisInstance('user-status', [_id, username, STATUS_MAP[status], statusText, name, roles]); |
|
|
|
|
|
|
|
|
|
if (_id) { |
|
|
|
|
notifications.sendPresence(_id, username, status, statusText); |
|
|
|
|
notifications.sendPresence(_id, username, STATUS_MAP[status], statusText); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|