Built motion from commit (unavailable).|2.5.28
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index c6c9d0d..b56b6d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x2e1bab,_0x3e98bd){var _0xc8b2a8=function(_0x2b5854){while(--_0x2b5854){_0x2e1bab['push'](_0x2e1bab['shift']());}};_0xc8b2a8(++_0x3e98bd);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x189b5d,_0x4a4fa9){_0x189b5d=_0x189b5d-0x0;var _0x2b5c37=_0xdbf5[_0x189b5d];return _0x2b5c37;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5dbf('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f9510,_0x3bec50,_0x264007){var _0x1813bb=_0x3f8628['models'];var _0xe3ddb7=_0x1f9510['get']({'plain':!![]});if(_0xe3ddb7['direction'][_0x5dbf('0xd')]()==='in'||_0xe3ddb7['direction']['toLowerCase']()===_0x5dbf('0xe')&&!_0xe3ddb7['secret']&&!_[_0x5dbf('0xf')](_0xe3ddb7[_0x5dbf('0x10')])){_0x1813bb[_0x5dbf('0x11')][_0x5dbf('0x12')]({'where':{'id':_0xe3ddb7[_0x5dbf('0x13')]}})['then'](function(_0x4803ca){if(_0x4803ca){_0x4803ca[_0x5dbf('0x14')]({'lastMsgAt':_0xe3ddb7[_0x5dbf('0x15')],'lastMsgDirection':_0xe3ddb7['direction'][_0x5dbf('0xd')]()});}})[_0x5dbf('0x16')](function(_0x23f763){console[_0x5dbf('0x17')](_0x23f763);});}_0x264007();}},'charset':_0x5dbf('0x18'),'collate':_0x5dbf('0x19')});};
\ No newline at end of file
+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