6bbe6649aac39e72133ced58c1316914275f59c2
[motion2.git] / server / api / chatOfflineMessage / chatOfflineMessage.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 _0x0e8a=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x185bba,_0x3103f3){var _0x29cf4d=function(_0x204a5a){while(--_0x204a5a){_0x185bba['push'](_0x185bba['shift']());}};_0x29cf4d(++_0x3103f3);}(_0x0e8a,0x1c3));var _0xa0e8=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x0e8a[_0xbc2974];return _0x3a5b4f;};'use strict';var EventEmitter=require(_0xa0e8('0x0'));var ChatOfflineMessage=require(_0xa0e8('0x1'))['db'][_0xa0e8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa0e8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa0e8('0x4'),'afterDestroy':_0xa0e8('0x5')};function emitEvent(_0x1a7c64){return function(_0x162f30,_0x4375b,_0x41e90c){ChatOfflineMessageEvents['emit'](_0x1a7c64+':'+_0x162f30['id'],_0x162f30);ChatOfflineMessageEvents[_0xa0e8('0x6')](_0x1a7c64,_0x162f30);_0x41e90c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa0e8('0x7')](e,emitEvent(event));}}module[_0xa0e8('0x8')]=ChatOfflineMessageEvents;