1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x85d6=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d6,0x135));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x685d('0x0'));var ChatOfflineMessage=require(_0x685d('0x1'))['db'][_0x685d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x685d('0x3')](0x0);var events={'afterCreate':_0x685d('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x447935){return function(_0x5074f9,_0xa4c797,_0x362db4){ChatOfflineMessageEvents[_0x685d('0x5')](_0x447935+':'+_0x5074f9['id'],_0x5074f9);ChatOfflineMessageEvents[_0x685d('0x5')](_0x447935,_0x5074f9);_0x362db4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x685d('0x6')](e,emitEvent(event));}}module[_0x685d('0x7')]=ChatOfflineMessageEvents;