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 _0xa554=['events','ChatQueue','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x57ce09,_0x56ec9f){var _0x411aed=function(_0x30df82){while(--_0x30df82){_0x57ce09['push'](_0x57ce09['shift']());}};_0x411aed(++_0x56ec9f);}(_0xa554,0x12d));var _0x4a55=function(_0xdd5ce0,_0x28993d){_0xdd5ce0=_0xdd5ce0-0x0;var _0x367d9b=_0xa554[_0xdd5ce0];return _0x367d9b;};'use strict';var EventEmitter=require(_0x4a55('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4a55('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4a55('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a55('0x3'),'afterDestroy':_0x4a55('0x4')};function emitEvent(_0x47d29b){return function(_0x2b1999,_0x5a5c57,_0x25ce69){ChatQueueEvents['emit'](_0x47d29b+':'+_0x2b1999['id'],_0x2b1999);ChatQueueEvents['emit'](_0x47d29b,_0x2b1999);_0x25ce69(null);};}for(var e in events){if(events[_0x4a55('0x5')](e)){var event=events[e];ChatQueue[_0x4a55('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;