Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / chatMessage / chatMessage.model.js
index 9482472..209f584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e6a=['body','FULLTEXT','models','get','direction','toLowerCase','out','secret','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x278380,_0x42ffbb){var _0x145f90=function(_0x324ece){while(--_0x324ece){_0x278380['push'](_0x278380['shift']());}};_0x145f90(++_0x42ffbb);}(_0x4e6a,0xc0));var _0xa4e6=function(_0x307006,_0x5693aa){_0x307006=_0x307006-0x0;var _0x59a93f=_0x4e6a[_0x307006];return _0x59a93f;};'use strict';var _=require(_0xa4e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa4e6('0x1'));var moment=require(_0xa4e6('0x2'));var BPromise=require(_0xa4e6('0x3'));var rp=require(_0xa4e6('0x4'));var fs=require('fs');var path=require(_0xa4e6('0x5'));var rimraf=require(_0xa4e6('0x6'));var config=require(_0xa4e6('0x7'));var attributes=require(_0xa4e6('0x8'));module['exports']=function(_0x1c2853,_0x5eee47){return _0x1c2853[_0xa4e6('0x9')](_0xa4e6('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xa4e6('0xb')],'type':_0xa4e6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x319b36,_0x1bb7ec,_0x48eee4){var _0x499aa1=_0x1c2853[_0xa4e6('0xd')];var _0x35fbdc=_0x319b36[_0xa4e6('0xe')]({'plain':!![]});if(_0x35fbdc[_0xa4e6('0xf')][_0xa4e6('0x10')]()==='in'||_0x35fbdc[_0xa4e6('0xf')][_0xa4e6('0x10')]()===_0xa4e6('0x11')&&!_0x35fbdc[_0xa4e6('0x12')]&&!_['isNil'](_0x35fbdc['UserId'])){_0x499aa1[_0xa4e6('0x13')][_0xa4e6('0x14')]({'where':{'id':_0x35fbdc[_0xa4e6('0x15')]}})[_0xa4e6('0x16')](function(_0xb91575){if(_0xb91575){_0xb91575[_0xa4e6('0x17')]({'lastMsgAt':_0x35fbdc[_0xa4e6('0x18')],'lastMsgDirection':_0x35fbdc[_0xa4e6('0xf')][_0xa4e6('0x10')]()});}})[_0xa4e6('0x19')](function(_0x5d1f41){console[_0xa4e6('0x1a')](_0x5d1f41);});}_0x48eee4();}},'charset':_0xa4e6('0x1b'),'collate':_0xa4e6('0x1c')});};
\ No newline at end of file
+var _0x885f=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x408c8f,_0x27989b){var _0x2e7fb1=function(_0x2666b3){while(--_0x2666b3){_0x408c8f['push'](_0x408c8f['shift']());}};_0x2e7fb1(++_0x27989b);}(_0x885f,0xa5));var _0xf885=function(_0x579a2f,_0x2a815a){_0x579a2f=_0x579a2f-0x0;var _0x5c9e93=_0x885f[_0x579a2f];return _0x5c9e93;};'use strict';var _=require(_0xf885('0x0'));var util=require(_0xf885('0x1'));var logger=require(_0xf885('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf885('0x3'));var rp=require(_0xf885('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf885('0x5'));var config=require(_0xf885('0x6'));var attributes=require(_0xf885('0x7'));module['exports']=function(_0x9be6dd,_0x22945b){return _0x9be6dd[_0xf885('0x8')](_0xf885('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xf885('0xa'),'fields':[_0xf885('0xb')],'type':_0xf885('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30f1de,_0x25585c,_0x4d2e89){var _0xc29066=_0x9be6dd[_0xf885('0xd')];var _0x4559da=_0x30f1de[_0xf885('0xe')]({'plain':!![]});if(_0x4559da[_0xf885('0xf')]['toLowerCase']()==='in'||_0x4559da['direction'][_0xf885('0x10')]()==='out'&&!_0x4559da[_0xf885('0x11')]&&!_[_0xf885('0x12')](_0x4559da[_0xf885('0x13')])){_0xc29066[_0xf885('0x14')][_0xf885('0x15')]({'where':{'id':_0x4559da[_0xf885('0x16')]}})[_0xf885('0x17')](function(_0x51b4d6){if(_0x51b4d6){_0x51b4d6[_0xf885('0x18')]({'lastMsgAt':_0x4559da['createdAt'],'lastMsgDirection':_0x4559da[_0xf885('0xf')][_0xf885('0x10')]()});}})['catch'](function(_0x16b1cb){console[_0xf885('0x19')](_0x16b1cb);});}_0x4d2e89();}},'charset':_0xf885('0x1a'),'collate':_0xf885('0x1b')});};
\ No newline at end of file