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 _0xf609=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x4309ac,_0x5b0acd){var _0x506be9=function(_0x1e2d42){while(--_0x1e2d42){_0x4309ac['push'](_0x4309ac['shift']());}};_0x506be9(++_0x5b0acd);}(_0xf609,0x114));var _0x9f60=function(_0x27e7e6,_0x184d66){_0x27e7e6=_0x27e7e6-0x0;var _0x1fc0da=_0xf609[_0x27e7e6];return _0x1fc0da;};'use strict';var EventEmitter=require(_0x9f60('0x0'));var ChatOfflineMessage=require(_0x9f60('0x1'))['db'][_0x9f60('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9f60('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13449d){return function(_0x490c2f,_0x45db08,_0x6f4e4){ChatOfflineMessageEvents[_0x9f60('0x4')](_0x13449d+':'+_0x490c2f['id'],_0x490c2f);ChatOfflineMessageEvents[_0x9f60('0x4')](_0x13449d,_0x490c2f);_0x6f4e4(null);};}for(var e in events){if(events[_0x9f60('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x9f60('0x6')](e,emitEvent(event));}}module[_0x9f60('0x7')]=ChatOfflineMessageEvents;