Built motion from commit da617fac.|2.6.6
[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 _0xd51b=['emit','hook','exports','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x425dd8,_0x8d4aef){var _0x2671aa=function(_0x509147){while(--_0x509147){_0x425dd8['push'](_0x425dd8['shift']());}};_0x2671aa(++_0x8d4aef);}(_0xd51b,0xe3));var _0xbd51=function(_0x35452d,_0x4587e0){_0x35452d=_0x35452d-0x0;var _0x3cacc7=_0xd51b[_0x35452d];return _0x3cacc7;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0xbd51('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xbd51('0x1')](0x0);var events={'afterCreate':_0xbd51('0x2'),'afterUpdate':_0xbd51('0x3'),'afterDestroy':_0xbd51('0x4')};function emitEvent(_0xd09c43){return function(_0x5a5512,_0x208d78,_0x2c70db){ChatOfflineMessageEvents[_0xbd51('0x5')](_0xd09c43+':'+_0x5a5512['id'],_0x5a5512);ChatOfflineMessageEvents[_0xbd51('0x5')](_0xd09c43,_0x5a5512);_0x2c70db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xbd51('0x6')](e,emitEvent(event));}}module[_0xbd51('0x7')]=ChatOfflineMessageEvents;