Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 613c17a..de6ae3a 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 _0x3f5a=['util','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','models','direction','toLowerCase','isNil','findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x3f5a,0xce));var _0xa3f5=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x3f5a[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0xa3f5('0x0'));var util=require(_0xa3f5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa3f5('0x2'));var BPromise=require('bluebird');var rp=require(_0xa3f5('0x3'));var fs=require('fs');var path=require(_0xa3f5('0x4'));var rimraf=require(_0xa3f5('0x5'));var config=require(_0xa3f5('0x6'));var attributes=require(_0xa3f5('0x7'));module[_0xa3f5('0x8')]=function(_0x5521fa,_0x1b16c2){return _0x5521fa[_0xa3f5('0x9')]('ChatMessage',attributes,{'tableName':_0xa3f5('0xa'),'paranoid':![],'indexes':[{'name':_0xa3f5('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20ffbc,_0x58d2c8,_0x514669){var _0x542edd=_0x5521fa[_0xa3f5('0xc')];var _0x3cc094=_0x20ffbc['get']({'plain':!![]});if(_0x3cc094[_0xa3f5('0xd')][_0xa3f5('0xe')]()==='in'||_0x3cc094[_0xa3f5('0xd')]['toLowerCase']()==='out'&&!_0x3cc094['secret']&&!_[_0xa3f5('0xf')](_0x3cc094['UserId'])){_0x542edd['ChatInteraction'][_0xa3f5('0x10')]({'where':{'id':_0x3cc094['ChatInteractionId']}})[_0xa3f5('0x11')](function(_0x51ae74){if(_0x51ae74){_0x51ae74[_0xa3f5('0x12')]({'lastMsgAt':_0x3cc094[_0xa3f5('0x13')],'lastMsgDirection':_0x3cc094[_0xa3f5('0xd')][_0xa3f5('0xe')]()});}})['catch'](function(_0x560b24){console[_0xa3f5('0x14')](_0x560b24);});}_0x514669();}},'charset':_0xa3f5('0x15'),'collate':_0xa3f5('0x16')});};
\ No newline at end of file