Built motion from commit (unavailable).|2.3.1
[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 _0x2697=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3ad905,_0x3c3ce0){var _0x2aa3f3=function(_0x20727f){while(--_0x20727f){_0x3ad905['push'](_0x3ad905['shift']());}};_0x2aa3f3(++_0x3c3ce0);}(_0x2697,0x120));var _0x7269=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x2697[_0x5d6e35];return _0x5d7ada;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x7269('0x0'))['db'][_0x7269('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7269('0x2')](0x0);var events={'afterCreate':_0x7269('0x3'),'afterUpdate':_0x7269('0x4'),'afterDestroy':'remove'};function emitEvent(_0x160a89){return function(_0x4a084b,_0x5bc3e4,_0x2b2be8){ChatQueueEvents[_0x7269('0x5')](_0x160a89+':'+_0x4a084b['id'],_0x4a084b);ChatQueueEvents[_0x7269('0x5')](_0x160a89,_0x4a084b);_0x2b2be8(null);};}for(var e in events){if(events[_0x7269('0x6')](e)){var event=events[e];ChatQueue[_0x7269('0x7')](e,emitEvent(event));}}module[_0x7269('0x8')]=ChatQueueEvents;