Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 29a6f32..b7f515d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82f5=['ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x82f5,0x15d));var _0x582f=function(_0x702f19,_0xf5ffb5){_0x702f19=_0x702f19-0x0;var _0x3d6bc3=_0x82f5[_0x702f19];return _0x3d6bc3;};'use strict';var _=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var logger=require(_0x582f('0x2'))(_0x582f('0x3'));var moment=require(_0x582f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x582f('0x5'));var rimraf=require(_0x582f('0x6'));var config=require(_0x582f('0x7'));var attributes=require(_0x582f('0x8'));module[_0x582f('0x9')]=function(_0x15d332,_0x459755){return _0x15d332['define'](_0x582f('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x582f('0xb'),'fields':[_0x582f('0xc')],'type':_0x582f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x493a93,_0x2dd742,_0x3bcabe){var _0x57b83e=_0x15d332[_0x582f('0xe')];var _0x297ff5=_0x493a93[_0x582f('0xf')]({'plain':!![]});if(_0x297ff5[_0x582f('0x10')][_0x582f('0x11')]()==='in'||_0x297ff5['direction']['toLowerCase']()===_0x582f('0x12')&&!_0x297ff5[_0x582f('0x13')]&&!_[_0x582f('0x14')](_0x297ff5[_0x582f('0x15')])){_0x57b83e[_0x582f('0x16')]['findOne']({'where':{'id':_0x297ff5[_0x582f('0x17')]}})[_0x582f('0x18')](function(_0x4cb70c){if(_0x4cb70c){_0x4cb70c[_0x582f('0x19')]({'lastMsgAt':_0x297ff5[_0x582f('0x1a')],'lastMsgDirection':_0x297ff5[_0x582f('0x10')][_0x582f('0x11')]()});}})[_0x582f('0x1b')](function(_0x4b63c1){console[_0x582f('0x1c')](_0x4b63c1);});}_0x3bcabe();}},'charset':_0x582f('0x1d'),'collate':_0x582f('0x1e')});};
\ No newline at end of file
+var _0x330c=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then'];(function(_0x383875,_0x45b02b){var _0x128fc2=function(_0x247f99){while(--_0x247f99){_0x383875['push'](_0x383875['shift']());}};_0x128fc2(++_0x45b02b);}(_0x330c,0x186));var _0xc330=function(_0x56f0f8,_0x28d84a){_0x56f0f8=_0x56f0f8-0x0;var _0x29c23c=_0x330c[_0x56f0f8];return _0x29c23c;};'use strict';var _=require(_0xc330('0x0'));var util=require(_0xc330('0x1'));var logger=require(_0xc330('0x2'))(_0xc330('0x3'));var moment=require('moment');var BPromise=require(_0xc330('0x4'));var rp=require(_0xc330('0x5'));var fs=require('fs');var path=require(_0xc330('0x6'));var rimraf=require(_0xc330('0x7'));var config=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module['exports']=function(_0x4f49fb,_0x53d0ca){return _0x4f49fb[_0xc330('0xa')](_0xc330('0xb'),attributes,{'tableName':_0xc330('0xc'),'paranoid':![],'indexes':[{'name':_0xc330('0xd'),'fields':[_0xc330('0xe')],'type':_0xc330('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bebaa,_0x48480e,_0x150c7d){var _0x4c1a5f=_0x4f49fb[_0xc330('0x10')];var _0x49ad4c=_0x1bebaa[_0xc330('0x11')]({'plain':!![]});if(_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()==='in'||_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()===_0xc330('0x14')&&!_0x49ad4c[_0xc330('0x15')]&&!_[_0xc330('0x16')](_0x49ad4c[_0xc330('0x17')])){_0x4c1a5f['ChatInteraction']['findOne']({'where':{'id':_0x49ad4c[_0xc330('0x18')]}})[_0xc330('0x19')](function(_0x5066d8){if(_0x5066d8){_0x5066d8[_0xc330('0x1a')]({'lastMsgAt':_0x49ad4c[_0xc330('0x1b')],'lastMsgDirection':_0x49ad4c[_0xc330('0x12')][_0xc330('0x13')]()});}})[_0xc330('0x1c')](function(_0xdd6f7f){console[_0xc330('0x1d')](_0xdd6f7f);});}_0x150c7d();}},'charset':_0xc330('0x1e'),'collate':_0xc330('0x1f')});};
\ No newline at end of file