Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 1905591..40bad20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf164=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','body','FULLTEXT','models','get','direction','toLowerCase','out','secret'];(function(_0x4650fd,_0x453fd1){var _0x392588=function(_0xc153c1){while(--_0xc153c1){_0x4650fd['push'](_0x4650fd['shift']());}};_0x392588(++_0x453fd1);}(_0xf164,0x6f));var _0x4f16=function(_0x8fb7a4,_0x607700){_0x8fb7a4=_0x8fb7a4-0x0;var _0x1fdca2=_0xf164[_0x8fb7a4];return _0x1fdca2;};'use strict';var _=require(_0x4f16('0x0'));var util=require(_0x4f16('0x1'));var logger=require(_0x4f16('0x2'))('api');var moment=require(_0x4f16('0x3'));var BPromise=require(_0x4f16('0x4'));var rp=require(_0x4f16('0x5'));var fs=require('fs');var path=require(_0x4f16('0x6'));var rimraf=require(_0x4f16('0x7'));var config=require(_0x4f16('0x8'));var attributes=require(_0x4f16('0x9'));module[_0x4f16('0xa')]=function(_0x552a58,_0x3339dc){return _0x552a58[_0x4f16('0xb')](_0x4f16('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x4f16('0xd')],'type':_0x4f16('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e6c94,_0x1a1c2d,_0x2e8c67){var _0x3940e8=_0x552a58[_0x4f16('0xf')];var _0x462072=_0x4e6c94[_0x4f16('0x10')]({'plain':!![]});if(_0x462072[_0x4f16('0x11')][_0x4f16('0x12')]()==='in'||_0x462072[_0x4f16('0x11')][_0x4f16('0x12')]()===_0x4f16('0x13')&&!_0x462072[_0x4f16('0x14')]&&!_[_0x4f16('0x15')](_0x462072[_0x4f16('0x16')])){_0x3940e8[_0x4f16('0x17')][_0x4f16('0x18')]({'where':{'id':_0x462072[_0x4f16('0x19')]}})[_0x4f16('0x1a')](function(_0x5736d3){if(_0x5736d3){_0x5736d3[_0x4f16('0x1b')]({'lastMsgAt':_0x462072[_0x4f16('0x1c')],'lastMsgDirection':_0x462072[_0x4f16('0x11')][_0x4f16('0x12')]()});}})[_0x4f16('0x1d')](function(_0x2bcc02){console[_0x4f16('0x1e')](_0x2bcc02);});}_0x2e8c67();}},'charset':_0x4f16('0x1f'),'collate':_0x4f16('0x20')});};
\ No newline at end of file
+var _0x38a9=['direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','models','get'];(function(_0x10c391,_0x27de01){var _0x82810c=function(_0x462fe5){while(--_0x462fe5){_0x10c391['push'](_0x10c391['shift']());}};_0x82810c(++_0x27de01);}(_0x38a9,0xb6));var _0x938a=function(_0xaf5f47,_0x2662a7){_0xaf5f47=_0xaf5f47-0x0;var _0x19d5eb=_0x38a9[_0xaf5f47];return _0x19d5eb;};'use strict';var _=require(_0x938a('0x0'));var util=require(_0x938a('0x1'));var logger=require(_0x938a('0x2'))(_0x938a('0x3'));var moment=require(_0x938a('0x4'));var BPromise=require('bluebird');var rp=require(_0x938a('0x5'));var fs=require('fs');var path=require(_0x938a('0x6'));var rimraf=require('rimraf');var config=require(_0x938a('0x7'));var attributes=require(_0x938a('0x8'));module[_0x938a('0x9')]=function(_0x1904d3,_0x22d249){return _0x1904d3[_0x938a('0xa')]('ChatMessage',attributes,{'tableName':_0x938a('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x466cf1,_0x26ee45,_0x4b38dd){var _0x3b1fed=_0x1904d3[_0x938a('0xc')];var _0x163767=_0x466cf1[_0x938a('0xd')]({'plain':!![]});if(_0x163767[_0x938a('0xe')]['toLowerCase']()==='in'||_0x163767[_0x938a('0xe')][_0x938a('0xf')]()===_0x938a('0x10')&&!_0x163767[_0x938a('0x11')]&&!_[_0x938a('0x12')](_0x163767[_0x938a('0x13')])){_0x3b1fed[_0x938a('0x14')]['findOne']({'where':{'id':_0x163767[_0x938a('0x15')]}})[_0x938a('0x16')](function(_0x1c23b0){if(_0x1c23b0){_0x1c23b0[_0x938a('0x17')]({'lastMsgAt':_0x163767[_0x938a('0x18')],'lastMsgDirection':_0x163767[_0x938a('0xe')][_0x938a('0xf')]()});}})['catch'](function(_0x1927ea){console[_0x938a('0x19')](_0x1927ea);});}_0x4b38dd();}},'charset':_0x938a('0x1a'),'collate':_0x938a('0x1b')});};
\ No newline at end of file