Built motion from commit ab870f9e.|2.5.44
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 613c17a..79064e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb874=['FULLTEXT','models','direction','toLowerCase','out','UserId','ChatInteraction','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body'];(function(_0x1b60db,_0x393e9c){var _0x261f63=function(_0x5215bf){while(--_0x5215bf){_0x1b60db['push'](_0x1b60db['shift']());}};_0x261f63(++_0x393e9c);}(_0xb874,0x16d));var _0x4b87=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb874[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4b87('0x0'));var util=require(_0x4b87('0x1'));var logger=require(_0x4b87('0x2'))('api');var moment=require(_0x4b87('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b87('0x4'));var fs=require('fs');var path=require(_0x4b87('0x5'));var rimraf=require(_0x4b87('0x6'));var config=require(_0x4b87('0x7'));var attributes=require(_0x4b87('0x8'));module['exports']=function(_0x4a9461,_0x8890bb){return _0x4a9461[_0x4b87('0x9')](_0x4b87('0xa'),attributes,{'tableName':_0x4b87('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x4b87('0xc')],'type':_0x4b87('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31775c,_0x37191a,_0x50d17e){var _0x32c701=_0x4a9461[_0x4b87('0xe')];var _0x28ca14=_0x31775c['get']({'plain':!![]});if(_0x28ca14[_0x4b87('0xf')][_0x4b87('0x10')]()==='in'||_0x28ca14[_0x4b87('0xf')][_0x4b87('0x10')]()===_0x4b87('0x11')&&!_0x28ca14['secret']&&!_['isNil'](_0x28ca14[_0x4b87('0x12')])){_0x32c701[_0x4b87('0x13')]['findOne']({'where':{'id':_0x28ca14[_0x4b87('0x14')]}})[_0x4b87('0x15')](function(_0x49cd37){if(_0x49cd37){_0x49cd37[_0x4b87('0x16')]({'lastMsgAt':_0x28ca14['createdAt'],'lastMsgDirection':_0x28ca14['direction'][_0x4b87('0x10')]()});}})[_0x4b87('0x17')](function(_0x570b84){console[_0x4b87('0x18')](_0x570b84);});}_0x50d17e();}},'charset':_0x4b87('0x19'),'collate':_0x4b87('0x1a')});};
\ No newline at end of file
+var _0x0a96=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x4bd453,_0x41c73b){var _0x192d1d=function(_0x20a423){while(--_0x20a423){_0x4bd453['push'](_0x4bd453['shift']());}};_0x192d1d(++_0x41c73b);}(_0x0a96,0xe4));var _0x60a9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0a96[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x60a9('0x0'));var util=require(_0x60a9('0x1'));var logger=require(_0x60a9('0x2'))('api');var moment=require(_0x60a9('0x3'));var BPromise=require(_0x60a9('0x4'));var rp=require(_0x60a9('0x5'));var fs=require('fs');var path=require(_0x60a9('0x6'));var rimraf=require(_0x60a9('0x7'));var config=require(_0x60a9('0x8'));var attributes=require(_0x60a9('0x9'));module[_0x60a9('0xa')]=function(_0xe1d2ea,_0x488c93){return _0xe1d2ea['define'](_0x60a9('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x60a9('0xc')],'type':_0x60a9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ee42c,_0x1b4bce,_0x5ea310){var _0x16327b=_0xe1d2ea[_0x60a9('0xe')];var _0x4e9b4b=_0x3ee42c[_0x60a9('0xf')]({'plain':!![]});if(_0x4e9b4b[_0x60a9('0x10')][_0x60a9('0x11')]()==='in'||_0x4e9b4b['direction'][_0x60a9('0x11')]()===_0x60a9('0x12')&&!_0x4e9b4b[_0x60a9('0x13')]&&!_[_0x60a9('0x14')](_0x4e9b4b[_0x60a9('0x15')])){_0x16327b[_0x60a9('0x16')]['findOne']({'where':{'id':_0x4e9b4b[_0x60a9('0x17')]}})['then'](function(_0x3b8be5){if(_0x3b8be5){_0x3b8be5[_0x60a9('0x18')]({'lastMsgAt':_0x4e9b4b[_0x60a9('0x19')],'lastMsgDirection':_0x4e9b4b['direction'][_0x60a9('0x11')]()});}})['catch'](function(_0x5689e9){console[_0x60a9('0x1a')](_0x5689e9);});}_0x5ea310();}},'charset':_0x60a9('0x1b'),'collate':_0x60a9('0x1c')});};
\ No newline at end of file