Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 7874b44..6bee575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','ChatInteraction','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5d2e9d,_0xf6d965){var _0x4e0a11=function(_0x419594){while(--_0x419594){_0x5d2e9d['push'](_0x5d2e9d['shift']());}};_0x4e0a11(++_0xf6d965);}(_0x55ca,0x126));var _0xa55c=function(_0x18f8ff,_0x257e95){_0x18f8ff=_0x18f8ff-0x0;var _0x18de97=_0x55ca[_0x18f8ff];return _0x18de97;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('ChatMessage',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[{'name':_0xa55c('0xa'),'fields':['body'],'type':_0xa55c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x290d28,_0x52a3bc,_0x5849ad){var _0x473d0e=_0x3c97c8[_0xa55c('0xc')];var _0x381d07=_0x290d28[_0xa55c('0xd')]({'plain':!![]});if(_0x381d07[_0xa55c('0xe')][_0xa55c('0xf')]()==='in'||_0x381d07[_0xa55c('0xe')][_0xa55c('0xf')]()===_0xa55c('0x10')&&!_0x381d07[_0xa55c('0x11')]&&!_['isNil'](_0x381d07['UserId'])){_0x473d0e[_0xa55c('0x12')]['findOne']({'where':{'id':_0x381d07['ChatInteractionId']}})['then'](function(_0x18ee85){if(_0x18ee85){_0x18ee85[_0xa55c('0x13')]({'lastMsgAt':_0x381d07[_0xa55c('0x14')],'lastMsgDirection':_0x381d07[_0xa55c('0xe')][_0xa55c('0xf')]()});}})[_0xa55c('0x15')](function(_0x4e0b2f){console[_0xa55c('0x16')](_0x4e0b2f);});}_0x5849ad();}},'charset':_0xa55c('0x17'),'collate':_0xa55c('0x18')});};
\ No newline at end of file
+var _0xe9d5=['out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase'];(function(_0x4385b6,_0x22cea0){var _0x7a3252=function(_0x5a3470){while(--_0x5a3470){_0x4385b6['push'](_0x4385b6['shift']());}};_0x7a3252(++_0x22cea0);}(_0xe9d5,0x191));var _0x5e9d=function(_0x42e2a0,_0xd2a7e1){_0x42e2a0=_0x42e2a0-0x0;var _0x3dbf06=_0xe9d5[_0x42e2a0];return _0x3dbf06;};'use strict';var _=require(_0x5e9d('0x0'));var util=require(_0x5e9d('0x1'));var logger=require(_0x5e9d('0x2'))(_0x5e9d('0x3'));var moment=require(_0x5e9d('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e9d('0x5'));var fs=require('fs');var path=require(_0x5e9d('0x6'));var rimraf=require(_0x5e9d('0x7'));var config=require(_0x5e9d('0x8'));var attributes=require(_0x5e9d('0x9'));module[_0x5e9d('0xa')]=function(_0x22cedf,_0x2c156f){return _0x22cedf[_0x5e9d('0xb')](_0x5e9d('0xc'),attributes,{'tableName':_0x5e9d('0xd'),'paranoid':![],'indexes':[{'name':_0x5e9d('0xe'),'fields':['body'],'type':_0x5e9d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2747b9,_0x8bdc65,_0x43a167){var _0x11d50b=_0x22cedf[_0x5e9d('0x10')];var _0x206aaa=_0x2747b9['get']({'plain':!![]});if(_0x206aaa[_0x5e9d('0x11')][_0x5e9d('0x12')]()==='in'||_0x206aaa['direction'][_0x5e9d('0x12')]()===_0x5e9d('0x13')&&!_0x206aaa[_0x5e9d('0x14')]&&!_[_0x5e9d('0x15')](_0x206aaa[_0x5e9d('0x16')])){_0x11d50b[_0x5e9d('0x17')][_0x5e9d('0x18')]({'where':{'id':_0x206aaa[_0x5e9d('0x19')]}})[_0x5e9d('0x1a')](function(_0x224167){if(_0x224167){_0x224167['update']({'lastMsgAt':_0x206aaa['createdAt'],'lastMsgDirection':_0x206aaa[_0x5e9d('0x11')][_0x5e9d('0x12')]()});}})[_0x5e9d('0x1b')](function(_0x564037){console['error'](_0x564037);});}_0x43a167();}},'charset':_0x5e9d('0x1c'),'collate':_0x5e9d('0x1d')});};
\ No newline at end of file