Built motion from commit d1eab355.|2.6.28
[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 _0x5b25=['hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x27def7,_0x3f0835){var _0x581cbc=function(_0x5b8ae4){while(--_0x5b8ae4){_0x27def7['push'](_0x27def7['shift']());}};_0x581cbc(++_0x3f0835);}(_0x5b25,0xc9));var _0x55b2=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x5b25[_0x38854e];return _0x3f8415;};'use strict';var EventEmitter=require(_0x55b2('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x55b2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x55b2('0x2')](0x0);var events={'afterCreate':_0x55b2('0x3'),'afterUpdate':_0x55b2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x13c283){return function(_0x291c4c,_0x2215ad,_0x358e07){ChatInternalMessageEvents[_0x55b2('0x5')](_0x13c283+':'+_0x291c4c['id'],_0x291c4c);ChatInternalMessageEvents['emit'](_0x13c283,_0x291c4c);_0x358e07(null);};}for(var e in events){if(events[_0x55b2('0x6')](e)){var event=events[e];ChatInternalMessage[_0x55b2('0x7')](e,emitEvent(event));}}module[_0x55b2('0x8')]=ChatInternalMessageEvents;