Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index b56b6d5..6bee575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce1a=['ChatInteraction','findOne','update','createdAt','catch','error','utf8mb4','lodash','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','UserId'];(function(_0x272394,_0x226305){var _0x211a06=function(_0x5d2c6d){while(--_0x5d2c6d){_0x272394['push'](_0x272394['shift']());}};_0x211a06(++_0x226305);}(_0xce1a,0xbf));var _0xace1=function(_0xd3606f,_0x38bdc9){_0xd3606f=_0xd3606f-0x0;var _0x561ed4=_0xce1a[_0xd3606f];return _0x561ed4;};'use strict';var _=require(_0xace1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xace1('0x1'));var BPromise=require(_0xace1('0x2'));var rp=require(_0xace1('0x3'));var fs=require('fs');var path=require(_0xace1('0x4'));var rimraf=require(_0xace1('0x5'));var config=require('../../config/environment');var attributes=require(_0xace1('0x6'));module['exports']=function(_0x4becaf,_0x55bc3e){return _0x4becaf[_0xace1('0x7')](_0xace1('0x8'),attributes,{'tableName':_0xace1('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xace1('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a5b7c,_0x3c8579,_0x3d34c){var _0x13f8ac=_0x4becaf[_0xace1('0xb')];var _0x56d3e3=_0x4a5b7c[_0xace1('0xc')]({'plain':!![]});if(_0x56d3e3[_0xace1('0xd')]['toLowerCase']()==='in'||_0x56d3e3[_0xace1('0xd')][_0xace1('0xe')]()==='out'&&!_0x56d3e3['secret']&&!_['isNil'](_0x56d3e3[_0xace1('0xf')])){_0x13f8ac[_0xace1('0x10')][_0xace1('0x11')]({'where':{'id':_0x56d3e3['ChatInteractionId']}})['then'](function(_0x4e8389){if(_0x4e8389){_0x4e8389[_0xace1('0x12')]({'lastMsgAt':_0x56d3e3[_0xace1('0x13')],'lastMsgDirection':_0x56d3e3[_0xace1('0xd')][_0xace1('0xe')]()});}})[_0xace1('0x14')](function(_0x303080){console[_0xace1('0x15')](_0x303080);});}_0x3d34c();}},'charset':_0xace1('0x16'),'collate':'utf8mb4_unicode_ci'});};
\ 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