Skip to content

Commit

Permalink
added transalation key for room not served error and fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bhardwajdisha committed Sep 14, 2023
1 parent 6d787f4 commit 3c6a843
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/meteor/app/livechat/server/hooks/verificationCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ callbacks.add(
settings.get('Livechat_automate_verification_process') &&
room.servedBy?.username === settings.get('Livechat_verificaion_bot_assign')
) {
await OmnichannelVerification.trasferChatAfterVerificationProcess(room._id);
await OmnichannelVerification.transferChatAfterVerificationProcess(room._id);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ callbacks.add(
if (settings.get('Livechat_automate_verification_process')) {
const bot = await Users.findOneByUsername(settings.get('Livechat_verificaion_bot_assign'));
const agentId = bot?._id;
const username = bot?.username || 'ROCKETCAT';
const username = bot?.username || 'rocket.cat';
const agent = { agentId, username };
return agent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class AutoTransferChatSchedulerClass {
departmentId: 1,
});
if (!room?.open || !room?.servedBy?._id) {
throw new Error('Room is not open or is not being served by an agent');
throw new Error('error-room-not-opened-or-serviced');
}

const {
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,7 @@
"error-room-onHold": "Error! Room is On Hold",
"error-room-is-already-on-hold": "Error! Room is already On Hold",
"error-room-not-on-hold": "Error! Room is not On Hold",
"error-room-not-opened-or-serviced": "Error! Room is not open or is not being served by an agent",
"error-selected-agent-room-agent-are-same": "The selected agent and the room agent are the same",
"error-starring-message": "Message could not be stared",
"error-tags-must-be-assigned-before-closing-chat": "Tag(s) must be assigned before closing the chat",
Expand Down
16 changes: 9 additions & 7 deletions apps/meteor/server/services/omnichannel-verification/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,19 @@ export class OmnichannelVerification extends ServiceClassInternal implements IOm
}
}

async trasferChatAfterVerificationProcess(roomId: IRoom['_id']): Promise<void> {
async transferChatAfterVerificationProcess(roomId: IRoom['_id']): Promise<void> {
try {
const room = await LivechatRooms.findOneById(roomId, {
_id: 1,
v: 1,
servedBy: 1,
open: 1,
departmentId: 1,
projection: {
_id: 1,
v: 1,
servedBy: 1,
open: 1,
departmentId: 1,
},
});
if (!room?.open || !room?.servedBy?._id) {
throw new Error('Room is not open or is not being served by an agent');
throw new Error('error-room-not-opened-or-serviced');
}
const {
departmentId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export interface IOmnichannelVerification extends IServiceClass {
setVisitorEmail(room: IOmnichannelRoom, email: string): Promise<ISetVisitorEmailResult>;
sendVerificationCodeToVisitor(visitorId: string, room: IOmnichannelGenericRoom): Promise<void>;
createLivechatMessage(room: IOmnichannelRoom, text: string): Promise<IMessage['_id']>;
trasferChatAfterVerificationProcess(roomId: IRoom['_id']): Promise<void>;
transferChatAfterVerificationProcess(roomId: IRoom['_id']): Promise<void>;
}

0 comments on commit 3c6a843

Please sign in to comment.