Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / chatMessage / chatMessage.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 _0x04d3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x26bc64,_0x10685d){var _0x381c58=function(_0x53a657){while(--_0x53a657){_0x26bc64['push'](_0x26bc64['shift']());}};_0x381c58(++_0x10685d);}(_0x04d3,0x6b));var _0x304d=function(_0x51c959,_0x170aa9){_0x51c959=_0x51c959-0x0;var _0x2b0b32=_0x04d3[_0x51c959];return _0x2b0b32;};'use strict';var EventEmitter=require(_0x304d('0x0'));var ChatMessage=require(_0x304d('0x1'))['db'][_0x304d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x304d('0x3')](0x0);var events={'afterCreate':_0x304d('0x4'),'afterUpdate':_0x304d('0x5'),'afterDestroy':_0x304d('0x6')};function emitEvent(_0x40458b){return function(_0x4f3f67,_0x413387,_0x1e58c5){ChatMessageEvents[_0x304d('0x7')](_0x40458b+':'+_0x4f3f67['id'],_0x4f3f67);ChatMessageEvents['emit'](_0x40458b,_0x4f3f67);_0x1e58c5(null);};}for(var e in events){if(events[_0x304d('0x8')](e)){var event=events[e];ChatMessage[_0x304d('0x9')](e,emitEvent(event));}}module[_0x304d('0xa')]=ChatMessageEvents;