04010e2b3a4f0a15cc73106a011f3709fb0a68ee
[motion2.git] / server / api / chatOfflineMessage / chatOfflineMessage.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 _0xcf81=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x225134,_0x2ef082){var _0x470b2b=function(_0xd56bf8){while(--_0xd56bf8){_0x225134['push'](_0x225134['shift']());}};_0x470b2b(++_0x2ef082);}(_0xcf81,0x199));var _0x1cf8=function(_0x191b8b,_0x1c3fdd){_0x191b8b=_0x191b8b-0x0;var _0x128968=_0xcf81[_0x191b8b];return _0x128968;};'use strict';var EventEmitter=require(_0x1cf8('0x0'));var ChatOfflineMessage=require(_0x1cf8('0x1'))['db'][_0x1cf8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1cf8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1cf8('0x4')};function emitEvent(_0x56e81d){return function(_0x6d1583,_0x288172,_0x578612){ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d+':'+_0x6d1583['id'],_0x6d1583);ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d,_0x6d1583);_0x578612(null);};}for(var e in events){if(events[_0x1cf8('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1cf8('0x7')]=ChatOfflineMessageEvents;