820f8ffc0151e80045a7ceed7af019ef18222c1e
[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 _0x4e8e=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x5714f3,_0xedaee9){var _0x2b6e47=function(_0x49f86a){while(--_0x49f86a){_0x5714f3['push'](_0x5714f3['shift']());}};_0x2b6e47(++_0xedaee9);}(_0x4e8e,0xf3));var _0xe4e8=function(_0x4a4a96,_0x3955b6){_0x4a4a96=_0x4a4a96-0x0;var _0x4e6839=_0x4e8e[_0x4a4a96];return _0x4e6839;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xe4e8('0x0'))['db'][_0xe4e8('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4e8('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2ffd5c){return function(_0x237677,_0xedef74,_0x139f14){ChatQueueEvents[_0xe4e8('0x3')](_0x2ffd5c+':'+_0x237677['id'],_0x237677);ChatQueueEvents[_0xe4e8('0x3')](_0x2ffd5c,_0x237677);_0x139f14(null);};}for(var e in events){if(events[_0xe4e8('0x4')](e)){var event=events[e];ChatQueue[_0xe4e8('0x5')](e,emitEvent(event));}}module[_0xe4e8('0x6')]=ChatQueueEvents;