1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xcbc8=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x41d19a,_0x168aec){var _0x5d61c7=function(_0x7eb22f){while(--_0x7eb22f){_0x41d19a['push'](_0x41d19a['shift']());}};_0x5d61c7(++_0x168aec);}(_0xcbc8,0x122));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8cbc('0x0'));var SmsMessage=require(_0x8cbc('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8cbc('0x2')](0x0);var events={'afterCreate':_0x8cbc('0x3'),'afterUpdate':_0x8cbc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10d32d){return function(_0x23885a,_0xa8f154,_0x4d7db1){SmsMessageEvents[_0x8cbc('0x5')](_0x10d32d+':'+_0x23885a['id'],_0x23885a);SmsMessageEvents[_0x8cbc('0x5')](_0x10d32d,_0x23885a);_0x4d7db1(null);};}for(var e in events){if(events[_0x8cbc('0x6')](e)){var event=events[e];SmsMessage[_0x8cbc('0x7')](e,emitEvent(event));}}module[_0x8cbc('0x8')]=SmsMessageEvents;