Built motion from commit 936e8062.|2.5.33
[motion2.git] / server / api / smsInteraction / smsInteraction.events.js
index d69d2ea..7dd389a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','getUsers','Users','map','then','setDataValue'];(function(_0x149147,_0x4de3c7){var _0x3220c7=function(_0x4e1955){while(--_0x4e1955){_0x149147['push'](_0x149147['shift']());}};_0x3220c7(++_0x4de3c7);}(_0x31c2,0x1e1));var _0x231c=function(_0x4a4b4d,_0xef164b){_0x4a4b4d=_0x4a4b4d-0x0;var _0x19a1ce=_0x31c2[_0x4a4b4d];return _0x19a1ce;};'use strict';var EventEmitter=require(_0x231c('0x0'));var SmsInteraction=require(_0x231c('0x1'))['db'][_0x231c('0x2')];var SmsMessage=require(_0x231c('0x1'))['db'][_0x231c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x231c('0x4')](0x0);var events={'afterCreate':_0x231c('0x5'),'afterUpdate':_0x231c('0x6'),'afterDestroy':'remove'};function emitEvent(_0x59f232){return function(_0x2b7d5f,_0x1b9d64,_0x1f3f7d){_0x2b7d5f[_0x231c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x111bf9){_0x2b7d5f['setDataValue'](_0x231c('0x8'),_0x111bf9[_0x231c('0x9')](function(_0x1000c9){return{'id':_0x1000c9['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2b7d5f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x231c('0xa')](function(_0x3cffb0){_0x2b7d5f[_0x231c('0xb')](_0x231c('0xc'),_0x3cffb0[_0x231c('0xd')]);SmsInteractionEvents[_0x231c('0xe')](_0x59f232+':'+_0x2b7d5f['id'],_0x2b7d5f);SmsInteractionEvents[_0x231c('0xe')](_0x59f232,_0x2b7d5f);_0x1f3f7d(null);})['catch'](_0x1f3f7d(null));};}for(var e in events){if(events[_0x231c('0xf')](e)){var event=events[e];SmsInteraction[_0x231c('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0xe820=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','setMaxListeners','save','update','getUsers','then','Users','map','findAll','setDataValue'];(function(_0x46cf88,_0x2b2f7b){var _0xb615c8=function(_0x21ad87){while(--_0x21ad87){_0x46cf88['push'](_0x46cf88['shift']());}};_0xb615c8(++_0x2b2f7b);}(_0xe820,0xd2));var _0x0e82=function(_0x172647,_0x17ee79){_0x172647=_0x172647-0x0;var _0xef4a18=_0xe820[_0x172647];return _0xef4a18;};'use strict';var EventEmitter=require(_0x0e82('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x0e82('0x1')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0e82('0x2')](0x0);var events={'afterCreate':_0x0e82('0x3'),'afterUpdate':_0x0e82('0x4'),'afterDestroy':'remove'};function emitEvent(_0xc6d61e){return function(_0x5de50f,_0x2cb88f,_0x105e3c){_0x5de50f[_0x0e82('0x5')]({'attributes':['id'],'raw':!![]})[_0x0e82('0x6')](function(_0x2a0f9b){_0x5de50f['setDataValue'](_0x0e82('0x7'),_0x2a0f9b[_0x0e82('0x8')](function(_0x2c0d6d){return{'id':_0x2c0d6d['id']};}));return SmsMessage[_0x0e82('0x9')]({'where':{'SmsInteractionId':_0x5de50f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0e82('0x6')](function(_0x4b3302){_0x5de50f[_0x0e82('0xa')](_0x0e82('0xb'),_0x4b3302[_0x0e82('0xc')]);SmsInteractionEvents[_0x0e82('0xd')](_0xc6d61e+':'+_0x5de50f['id'],_0x5de50f);SmsInteractionEvents[_0x0e82('0xd')](_0xc6d61e,_0x5de50f);_0x105e3c(null);})[_0x0e82('0xe')](_0x105e3c(null));};}for(var e in events){if(events[_0x0e82('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x0e82('0x10')]=SmsInteractionEvents;
\ No newline at end of file