Built motion from commit 616d3211.|2.6.4
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 6dedf5f..6634724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2559=['get','toLowerCase','out','secret','isNil','UserId','ChatInteraction','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','./chatMessage.attributes','define','chat_messages','fti_chat_messages','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2559,0xbc));var _0x9255=function(_0x2cfbc1,_0x45494e){_0x2cfbc1=_0x2cfbc1-0x0;var _0x1d037c=_0x2559[_0x2cfbc1];return _0x1d037c;};'use strict';var _=require(_0x9255('0x0'));var util=require(_0x9255('0x1'));var logger=require(_0x9255('0x2'))(_0x9255('0x3'));var moment=require('moment');var BPromise=require(_0x9255('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9255('0x5'));var rimraf=require(_0x9255('0x6'));var config=require('../../config/environment');var attributes=require(_0x9255('0x7'));module['exports']=function(_0xf7c91c,_0x2833b5){return _0xf7c91c[_0x9255('0x8')]('ChatMessage',attributes,{'tableName':_0x9255('0x9'),'paranoid':![],'indexes':[{'name':_0x9255('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c72d4,_0x4da33a,_0x37de15){var _0x202513=_0xf7c91c[_0x9255('0xb')];var _0x320226=_0x2c72d4[_0x9255('0xc')]({'plain':!![]});if(_0x320226['direction']['toLowerCase']()==='in'||_0x320226['direction'][_0x9255('0xd')]()===_0x9255('0xe')&&!_0x320226[_0x9255('0xf')]&&!_[_0x9255('0x10')](_0x320226[_0x9255('0x11')])){_0x202513[_0x9255('0x12')]['findOne']({'where':{'id':_0x320226['ChatInteractionId']}})['then'](function(_0x481211){if(_0x481211){_0x481211[_0x9255('0x13')]({'lastMsgAt':_0x320226[_0x9255('0x14')],'lastMsgDirection':_0x320226['direction'][_0x9255('0xd')]()});}})[_0x9255('0x15')](function(_0x567849){console[_0x9255('0x16')](_0x567849);});}_0x37de15();}},'charset':_0x9255('0x17'),'collate':_0x9255('0x18')});};
\ No newline at end of file
+var _0xf2c4=['define','ChatMessage','chat_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x235e1b,_0x6c5869){var _0x53e3c0=function(_0x1e06b8){while(--_0x1e06b8){_0x235e1b['push'](_0x235e1b['shift']());}};_0x53e3c0(++_0x6c5869);}(_0xf2c4,0xaf));var _0x4f2c=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xf2c4[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x4f2c('0x0'));var util=require(_0x4f2c('0x1'));var logger=require(_0x4f2c('0x2'))(_0x4f2c('0x3'));var moment=require(_0x4f2c('0x4'));var BPromise=require(_0x4f2c('0x5'));var rp=require(_0x4f2c('0x6'));var fs=require('fs');var path=require(_0x4f2c('0x7'));var rimraf=require(_0x4f2c('0x8'));var config=require(_0x4f2c('0x9'));var attributes=require('./chatMessage.attributes');module[_0x4f2c('0xa')]=function(_0x40912d,_0x47b48f){return _0x40912d[_0x4f2c('0xb')](_0x4f2c('0xc'),attributes,{'tableName':_0x4f2c('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x4f2c('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4379dd,_0x1bebdb,_0x320824){var _0x3f15a2=_0x40912d[_0x4f2c('0xf')];var _0x4e4dc3=_0x4379dd[_0x4f2c('0x10')]({'plain':!![]});if(_0x4e4dc3[_0x4f2c('0x11')][_0x4f2c('0x12')]()==='in'||_0x4e4dc3[_0x4f2c('0x11')]['toLowerCase']()===_0x4f2c('0x13')&&!_0x4e4dc3['secret']&&!_[_0x4f2c('0x14')](_0x4e4dc3[_0x4f2c('0x15')])){_0x3f15a2[_0x4f2c('0x16')][_0x4f2c('0x17')]({'where':{'id':_0x4e4dc3[_0x4f2c('0x18')]}})['then'](function(_0x27dab9){if(_0x27dab9){_0x27dab9[_0x4f2c('0x19')]({'lastMsgAt':_0x4e4dc3[_0x4f2c('0x1a')],'lastMsgDirection':_0x4e4dc3['direction']['toLowerCase']()});}})[_0x4f2c('0x1b')](function(_0x466b95){console[_0x4f2c('0x1c')](_0x466b95);});}_0x320824();}},'charset':_0x4f2c('0x1d'),'collate':_0x4f2c('0x1e')});};
\ No newline at end of file