Built motion from commit 64a6f4bc.|2.6.26
[motion2.git] / server / api / chatQueue / chatQueue.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 _0x6d25=['remove','emit','hasOwnProperty','exports','events','ChatQueue','save','update'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x6d25,0x11c));var _0x56d2=function(_0x40c0e5,_0x4d4e56){_0x40c0e5=_0x40c0e5-0x0;var _0xa21ce5=_0x6d25[_0x40c0e5];return _0xa21ce5;};'use strict';var EventEmitter=require(_0x56d2('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x56d2('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x56d2('0x2'),'afterUpdate':_0x56d2('0x3'),'afterDestroy':_0x56d2('0x4')};function emitEvent(_0x3fc17f){return function(_0x4ec6ed,_0x232f4f,_0x276d9c){ChatQueueEvents[_0x56d2('0x5')](_0x3fc17f+':'+_0x4ec6ed['id'],_0x4ec6ed);ChatQueueEvents[_0x56d2('0x5')](_0x3fc17f,_0x4ec6ed);_0x276d9c(null);};}for(var e in events){if(events[_0x56d2('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x56d2('0x7')]=ChatQueueEvents;