Skip to content

Commit

Permalink
do not consider visitor messages as responses in livechat metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusbsilva137 committed Aug 8, 2024
1 parent 554eb10 commit de1ff87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/app/livechat/server/hooks/saveAnalyticsData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isEditedMessage, isSystemMessage } from '@rocket.chat/core-typings';
import { isEditedMessage, isSystemMessage, isMessageFromVisitor } from '@rocket.chat/core-typings';
import type { IOmnichannelRoom } from '@rocket.chat/core-typings';
import { LivechatRooms } from '@rocket.chat/models';

Expand Down Expand Up @@ -70,7 +70,7 @@ callbacks.add(
message = { ...(await normalizeMessageFileUpload(message)), ...{ _updatedAt: message._updatedAt } };
}

const analyticsData = getAnalyticsData(room, new Date());
const analyticsData = isMessageFromVisitor(message) ? undefined : getAnalyticsData(room, new Date());
await LivechatRooms.getAnalyticsUpdateQueryByRoomId(room, message, analyticsData, roomUpdater);

return message;
Expand Down

0 comments on commit de1ff87

Please sign in to comment.