96db58a51dc9ea151f16d3b0ec7efede57c6167a
[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 _0x210c=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x24a31c,_0x1f329b){var _0x30050a=function(_0x8a640){while(--_0x8a640){_0x24a31c['push'](_0x24a31c['shift']());}};_0x30050a(++_0x1f329b);}(_0x210c,0x190));var _0xc210=function(_0x304bd5,_0xea943d){_0x304bd5=_0x304bd5-0x0;var _0x2bcd87=_0x210c[_0x304bd5];return _0x2bcd87;};'use strict';var EventEmitter=require(_0xc210('0x0'));var ChatOfflineMessage=require(_0xc210('0x1'))['db'][_0xc210('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xc210('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc210('0x4'),'afterDestroy':_0xc210('0x5')};function emitEvent(_0x4c4508){return function(_0xdb3596,_0x357d60,_0x3e7662){ChatOfflineMessageEvents[_0xc210('0x6')](_0x4c4508+':'+_0xdb3596['id'],_0xdb3596);ChatOfflineMessageEvents[_0xc210('0x6')](_0x4c4508,_0xdb3596);_0x3e7662(null);};}for(var e in events){if(events[_0xc210('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xc210('0x8')]=ChatOfflineMessageEvents;