Avoid bots to be marked as unavailable when log off/login (#23262)

Co-authored-by: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com>
pull/23056/head^2
Kevin Aleman 4 years ago committed by GitHub
parent 88b2698d1b
commit cd2ce2a862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/livechat/server/business-hour/index.ts
  2. 2
      app/livechat/server/startup.js

@ -14,5 +14,5 @@ Meteor.startup(() => {
businessHourManager.registerBusinessHourBehavior(new BusinessHourBehaviorClass());
businessHourManager.registerBusinessHourType(new DefaultBusinessHour());
Accounts.onLogin(async ({ user }: { user: any }) => user?.roles?.includes('livechat-agent') && businessHourManager.onLogin(user._id));
Accounts.onLogin(async ({ user }: { user: any }) => user?.roles?.includes('livechat-agent') && !user?.roles?.includes('bot') && businessHourManager.onLogin(user._id));
});

@ -57,5 +57,5 @@ Meteor.startup(async () => {
return businessHourManager.stopManager();
});
Accounts.onLogout(({ user }) => user?.roles?.includes('livechat-agent') && Livechat.setUserStatusLivechat(user._id, 'not-available'));
Accounts.onLogout(({ user }) => user?.roles?.includes('livechat-agent') && !user?.roles?.includes('bot') && Livechat.setUserStatusLivechat(user._id, 'not-available'));
});

Loading…
Cancel
Save