Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] [Apps-Engine] New Livechat event handlers #17033

Merged
merged 9 commits into from
Apr 30, 2020

Conversation

shiqimei
Copy link
Contributor

@shiqimei shiqimei commented Mar 26, 2020

This is the changes of the PR RocketChat/Rocket.Chat.Apps-engine#248 on the RocketChat side. Check issue RocketChat/Rocket.Chat.Apps-engine#234 for the details.

@shiqimei
Copy link
Contributor Author

The app for testing:

import {
    IAppAccessors,
    IHttp,
    ILogger,
    IPersistence,
    IRead,
} from '@rocket.chat/apps-engine/definition/accessors';
import { App } from '@rocket.chat/apps-engine/definition/App';
import {  ILivechatAssignAgentHandler, ILivechatContext, ILivechatRoomClosedHandler, ILivechatRoomStartedHandler, ILivechatUnassignAgentHandler, ILivechatRoom } from '@rocket.chat/apps-engine/definition/livechat';
import { IAppInfo } from '@rocket.chat/apps-engine/definition/metadata';

export class LivechatTestingApp extends App implements ILivechatRoomStartedHandler, ILivechatRoomClosedHandler, ILivechatAssignAgentHandler, ILivechatUnassignAgentHandler {
    constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) {
        super(info, logger, accessors);
    }

    public async executeLivechatAssignAgentHandler(data: ILivechatContext, read: IRead, http: IHttp, persistence: IPersistence) {
        console.log('executeLivechatAssignAgentHandler', { data });
    }

    public async executeLivechatUnassignAgentHandler(data: ILivechatContext, read: IRead, http: IHttp, persistence: IPersistence) {
        console.log('executeLivechatUnassignAgentHandler', { data });
    }

    public async executeLivechatRoomStartedHandler(data: ILivechatRoom, read: IRead, http: IHttp, persistence: IPersistence) {
        console.log('executeLivechatRoomStartedHandler', { data });
    }

    public async executeLivechatRoomClosedHandler(data: ILivechatRoom, read: IRead, http: IHttp, persistence: IPersistence) {
        console.log('executeLivechatRoomClosedHandler', { data });
    }
}

@shiqimei
Copy link
Contributor Author

Hey @renatobecker . I found that only the agent clicking the button return will call the RoutingManager.unassignAgent method ( thus triggering the LivechatUnassignAgent event). Is it by design? I think it should also trigger LivechatUnassignAgent event when someone forward the vistor to others. What do you think?

image

@renatobecker
Copy link
Contributor

Hey @renatobecker . I found that only the agent clicking the button return will call the RoutingManager.unassignAgent method ( thus triggering the LivechatUnassignAgent event). Is it by design? I think it should also trigger LivechatUnassignAgent event when someone forward the vistor to others. What do you think?

image

Hi @lolimay!

Yeah, I got your point, but we can't rely on the RoutingManager.unassignAgent only.
My suggestion is to use the removeAgentFromSubscription to trigger the LivechatUnassignAgent event because it is called in the RoutingManager.unassignAgent, as well on the forwardRoomToAgent and the forwardRoomToDepartment. What do you think? This is exactly what you're expecting for.

Thanks.

@shiqimei
Copy link
Contributor Author

shiqimei commented Mar 27, 2020

Thanks @renatobecker ! It makes sense to me!

@shiqimei
Copy link
Contributor Author

shiqimei commented Mar 27, 2020

Hello @renatobecker ! It works well now during my local testing. Can you please help test it too? so that we can solve potential issues before merging it.

@shiqimei shiqimei changed the title Add livechat missing event handlers [Apps] Add livechat missing event handlers Mar 27, 2020
@d-gubert d-gubert changed the title [Apps] Add livechat missing event handlers [NEW] [Apps-Engine] Add new Livechat event handlers Apr 21, 2020
Co-Authored-By: Douglas Gubert <d-gubert@users.noreply.github.com>
d-gubert
d-gubert previously approved these changes Apr 23, 2020
@d-gubert d-gubert changed the title [NEW] [Apps-Engine] Add new Livechat event handlers [NEW] [Apps-Engine] New Livechat event handlers Apr 30, 2020
@d-gubert d-gubert merged commit 2e2e186 into develop Apr 30, 2020
@d-gubert d-gubert deleted the omnichannel-agent-related-handlers branch April 30, 2020 17:03
d-gubert added a commit that referenced this pull request May 1, 2020
* Add livechat missing event handlers

* Rely on removeAgentFromSubscription

Co-authored-by: Renato Becker <renato.augusto.becker@gmail.com>
Co-authored-by: Douglas Gubert <douglas.gubert@gmail.com>
dudizilla added a commit that referenced this pull request May 4, 2020
….Chat into custom-emoji

* 'admin-refactor' of https://github.com/RocketChat/Rocket.Chat:
  LingoHub based on develop (#17520)
  RegExp improvements suggested by LGTM (#17500)
  [FIX] Replace obsolete X-FRAME-OPTIONS header on Livechat route (#17419)
  [FIX] LDAP login error on Enterprise version (#17497)
  [IMPROVE] [Apps-Engine] App user as the default notifier (#17050)
  [NEW] [Apps-Engine] New Livechat event handlers (#17033)
  [FIX] Change email verification label (#17450)
  fix: Admin Users Actions (#17469)
  Fix bad component reference
  [IMPROVE] Depart from /app/ui-admin (#17464)
  Priority system messages were always created (#17479)
  Bump version to 3.3.0-develop
  Bump version to 3.2.0
  Bump version to 3.2.0-rc.2
  Bump version to 3.2.0-rc.1
  Bump version to 3.2.0-rc.0
ggazzo added a commit that referenced this pull request May 6, 2020
…/new-threads

* 'develop' of github.com:RocketChat/Rocket.Chat: (42 commits)
  [FIX] Invalid CSS syntax (#17541)
  [NEW] Rewrite admin pages (#17388)
  [FIX] Replace postcss Meteor package (#15929)
  [FIX] Increasing highlight time in 3 seconds (#17540)
  [IMPROVE] Add new webhooks to the Omnichannel integration feature (#17503)
  [BREAK] Remove deprecated Omnichannel Knowledge Base feature (#17387)
  [FIX] Reactions may present empty names of who reacted when using Real Names (#17536)
  Allow to filter omnichannel analytics dashboards per departments. (#17463)
  [FIX] Uncessary updates on Settings, Roles and Permissions on startup (#17160)
  [NEW] Add the ability to send Livechat offline messages to a channel (#17442)
  [FIX] Federation attachment URL for audio and video files (#16430)
  [NEW] Add Livechat website URL to the offline message e-mail (#17429)
  LingoHub based on develop (#17520)
  RegExp improvements suggested by LGTM (#17500)
  [FIX] Replace obsolete X-FRAME-OPTIONS header on Livechat route (#17419)
  [FIX] LDAP login error on Enterprise version (#17497)
  [IMPROVE] [Apps-Engine] App user as the default notifier (#17050)
  [NEW] [Apps-Engine] New Livechat event handlers (#17033)
  [FIX] Change email verification label (#17450)
  Priority system messages were always created (#17479)
  ...
ggazzo added a commit that referenced this pull request May 6, 2020
* 'develop' of github.com:RocketChat/Rocket.Chat: (30 commits)
  [IMPROVE] [Apps-Engine] App user as the default notifier (#17050)
  [NEW] [Apps-Engine] New Livechat event handlers (#17033)
  [FIX] Change email verification label (#17450)
  Priority system messages were always created (#17479)
  Bump version to 3.3.0-develop
  Bump version to 3.2.0
  Bump version to 3.1.2
  [FIX] LDAP error when trying to add room with spaces in the name (#17453)
  Regression: Add missing cacheKey to mem (#17430)
  [FIX] Empty Incoming webhook script field (#17422)
  [FIX] LDAP Sync error (#17417)
  [FIX] Bot Agents not being able to get Omnichannel Inquiries (#17404)
  [FIX] Allowing blocking a user on channels (#17406)
  Regression: Fix mem usage with more than one argument (#17391)
  [FIX] Web Client memory leak caused by the Emoji library (#17320)
  [FIX] Omnichannel room info panel opening whenever a message is sent (#17348)
  [FIX] New user added by admin doesn't receive random password email (#17249)
  Bump version to 3.2.0-rc.2
  [FIX] LDAP error when trying to add room with spaces in the name (#17453)
  Complement Guest role restrictions for Enterprise (#17393)
  ...
gabriellsh added a commit that referenced this pull request May 6, 2020
…to integrations

* 'admin-refactor' of github.com:RocketChat/Rocket.Chat:
  LingoHub based on develop (#17520)
  RegExp improvements suggested by LGTM (#17500)
  [FIX] Replace obsolete X-FRAME-OPTIONS header on Livechat route (#17419)
  [FIX] LDAP login error on Enterprise version (#17497)
  [IMPROVE] [Apps-Engine] App user as the default notifier (#17050)
  [NEW] [Apps-Engine] New Livechat event handlers (#17033)
  [FIX] Change email verification label (#17450)
  Priority system messages were always created (#17479)
  Bump version to 3.3.0-develop
  Bump version to 3.2.0
  Bump version to 3.2.0-rc.2
  Bump version to 3.2.0-rc.1
  Bump version to 3.2.0-rc.0
This was referenced May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants