// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x49ac=['catch','exports','events','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit'];(function(_0x528657,_0x1784ec){var _0x2da56f=function(_0xb1098c){while(--_0xb1098c){_0x528657['push'](_0x528657['shift']());}};_0x2da56f(++_0x1784ec);}(_0x49ac,0x11f));var _0xc49a=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x49ac[_0x2cef86];return _0x46dfd6;};'use strict';var EventEmitter=require(_0xc49a('0x0'));var MailInteraction=require(_0xc49a('0x1'))['db'][_0xc49a('0x2')];var MailMessage=require(_0xc49a('0x1'))['db'][_0xc49a('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc49a('0x4'),'afterUpdate':_0xc49a('0x5'),'afterDestroy':_0xc49a('0x6')};function emitEvent(_0x22b532){return function(_0x37ef03,_0x165aeb,_0x104492){_0x37ef03[_0xc49a('0x7')]({'attributes':['id'],'raw':!![]})[_0xc49a('0x8')](function(_0x55b96b){_0x37ef03[_0xc49a('0x9')]('Users',_0x55b96b['map'](function(_0x19ff00){return{'id':_0x19ff00['id']};}));return MailMessage[_0xc49a('0xa')]({'where':{'MailInteractionId':_0x37ef03['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc49a('0x8')](function(_0x1ac192){_0x37ef03[_0xc49a('0x9')](_0xc49a('0xb'),_0x1ac192['length']);MailInteractionEvents[_0xc49a('0xc')](_0x22b532+':'+_0x37ef03['id'],_0x37ef03);MailInteractionEvents[_0xc49a('0xc')](_0x22b532,_0x37ef03);_0x104492(null);})[_0xc49a('0xd')](_0x104492(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xc49a('0xe')]=MailInteractionEvents;
\ No newline at end of file
+var _0x92e0=['save','update','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x306e12,_0x4fbaf3){var _0x54138f=function(_0x3f3080){while(--_0x3f3080){_0x306e12['push'](_0x306e12['shift']());}};_0x54138f(++_0x4fbaf3);}(_0x92e0,0x166));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x092e('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x092e('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x092e('0x1')](0x0);var events={'afterCreate':_0x092e('0x2'),'afterUpdate':_0x092e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4424fc){return function(_0x5485d2,_0x3b36b3,_0x1d1611){_0x5485d2['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa52f9c){_0x5485d2[_0x092e('0x4')](_0x092e('0x5'),_0xa52f9c[_0x092e('0x6')](function(_0xbc603f){return{'id':_0xbc603f['id']};}));return MailMessage[_0x092e('0x7')]({'where':{'MailInteractionId':_0x5485d2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x092e('0x8')](function(_0x216ff1){_0x5485d2[_0x092e('0x4')](_0x092e('0x9'),_0x216ff1[_0x092e('0xa')]);MailInteractionEvents[_0x092e('0xb')](_0x4424fc+':'+_0x5485d2['id'],_0x5485d2);MailInteractionEvents['emit'](_0x4424fc,_0x5485d2);_0x1d1611(null);})[_0x092e('0xc')](_0x1d1611(null));};}for(var e in events){if(events[_0x092e('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x092e('0xe')]=MailInteractionEvents;
\ No newline at end of file