Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / chatInternalMessage / chatInternalMessage.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xdcc4=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0xc66af2,_0x14f6d8){var _0x38d439=function(_0x544ab8){while(--_0x544ab8){_0xc66af2['push'](_0xc66af2['shift']());}};_0x38d439(++_0x14f6d8);}(_0xdcc4,0xea));var _0x4dcc=function(_0x4f896a,_0x51f7d7){_0x4f896a=_0x4f896a-0x0;var _0x88adef=_0xdcc4[_0x4f896a];return _0x88adef;};'use strict';var EventEmitter=require(_0x4dcc('0x0'));var ChatInternalMessage=require(_0x4dcc('0x1'))['db'][_0x4dcc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4dcc('0x3')](0x0);var events={'afterCreate':_0x4dcc('0x4'),'afterUpdate':'update','afterDestroy':_0x4dcc('0x5')};function emitEvent(_0x5c1ea7){return function(_0x416d97,_0x30c165,_0x34bc8d){ChatInternalMessageEvents[_0x4dcc('0x6')](_0x5c1ea7+':'+_0x416d97['id'],_0x416d97);ChatInternalMessageEvents['emit'](_0x5c1ea7,_0x416d97);_0x34bc8d(null);};}for(var e in events){if(events[_0x4dcc('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4dcc('0x8')]=ChatInternalMessageEvents;