Built motion from commit 25580385.|2.6.2
[motion2.git] / server / api / mailInteraction / mailInteraction.events.js
index 4247726..1228dbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0b8=['then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers'];(function(_0x5119e3,_0x57f091){var _0x5d666c=function(_0xa3a5b2){while(--_0xa3a5b2){_0x5119e3['push'](_0x5119e3['shift']());}};_0x5d666c(++_0x57f091);}(_0xe0b8,0x69));var _0x8e0b=function(_0x3bf440,_0x3a9f01){_0x3bf440=_0x3bf440-0x0;var _0x2f468b=_0xe0b8[_0x3bf440];return _0x2f468b;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x8e0b('0x0'))['db'][_0x8e0b('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x8e0b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e0b('0x3'),'afterUpdate':_0x8e0b('0x4'),'afterDestroy':_0x8e0b('0x5')};function emitEvent(_0x3496db){return function(_0x5dff12,_0x14919c,_0x15e3fb){_0x5dff12[_0x8e0b('0x6')]({'attributes':['id'],'raw':!![]})[_0x8e0b('0x7')](function(_0x3daf2d){_0x5dff12[_0x8e0b('0x8')](_0x8e0b('0x9'),_0x3daf2d[_0x8e0b('0xa')](function(_0x9e34c1){return{'id':_0x9e34c1['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5dff12['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x32223d){_0x5dff12[_0x8e0b('0x8')](_0x8e0b('0xb'),_0x32223d[_0x8e0b('0xc')]);MailInteractionEvents['emit'](_0x3496db+':'+_0x5dff12['id'],_0x5dff12);MailInteractionEvents[_0x8e0b('0xd')](_0x3496db,_0x5dff12);_0x15e3fb(null);})['catch'](_0x15e3fb(null));};}for(var e in events){if(events[_0x8e0b('0xe')](e)){var event=events[e];MailInteraction[_0x8e0b('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
+var _0x334f=['length','emit','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','remove','getUsers','setDataValue','Users','map','findAll','then'];(function(_0x277b55,_0x8ba28){var _0xff0d15=function(_0x1beefc){while(--_0x1beefc){_0x277b55['push'](_0x277b55['shift']());}};_0xff0d15(++_0x8ba28);}(_0x334f,0x18a));var _0xf334=function(_0x241204,_0x28b505){_0x241204=_0x241204-0x0;var _0x30475b=_0x334f[_0x241204];return _0x30475b;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xf334('0x0'))['db'][_0xf334('0x1')];var MailMessage=require(_0xf334('0x0'))['db'][_0xf334('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf334('0x3'),'afterUpdate':'update','afterDestroy':_0xf334('0x4')};function emitEvent(_0x5b0a15){return function(_0x103dd2,_0x381a92,_0x505680){_0x103dd2[_0xf334('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e3cf5){_0x103dd2[_0xf334('0x6')](_0xf334('0x7'),_0x2e3cf5[_0xf334('0x8')](function(_0x57b6d2){return{'id':_0x57b6d2['id']};}));return MailMessage[_0xf334('0x9')]({'where':{'MailInteractionId':_0x103dd2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf334('0xa')](function(_0x44e065){_0x103dd2[_0xf334('0x6')]('unreadMessages',_0x44e065[_0xf334('0xb')]);MailInteractionEvents[_0xf334('0xc')](_0x5b0a15+':'+_0x103dd2['id'],_0x103dd2);MailInteractionEvents[_0xf334('0xc')](_0x5b0a15,_0x103dd2);_0x505680(null);})['catch'](_0x505680(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf334('0xd')](e,emitEvent(event));}}module[_0xf334('0xe')]=MailInteractionEvents;
\ No newline at end of file