Built motion from commit 459747fdfe53bbf13fbede61eeaffea1f1438f86. Version 3.0.0...
[motion-next.git] / server / api / chatMessage / chatMessage.model.js
index 2ee65f1..92f8dfa 100644 (file)
@@ -1 +1 @@
-const a82_0x4713=['isNil','./chatMessage.attributes','direction','update','toLowerCase','findOne','then','ChatInteractionId','FULLTEXT','models','ChatInteraction','exports','get','utf8mb4','chat_messages','out','utf8mb4_unicode_ci'];(function(_0x4fbac6,_0x4713ef){const _0x11f997=function(_0x5cf484){while(--_0x5cf484){_0x4fbac6['push'](_0x4fbac6['shift']());}};_0x11f997(++_0x4713ef);}(a82_0x4713,0xf3));const a82_0x11f9=function(_0x4fbac6,_0x4713ef){_0x4fbac6=_0x4fbac6-0x0;let _0x11f997=a82_0x4713[_0x4fbac6];return _0x11f997;};const _0x405432=a82_0x11f9;'use strict';const _=require('lodash'),attributes=require(_0x405432('0xd'));module[_0x405432('0x6')]=function(_0x5cf484){const _0xf3b1c2=_0x405432,_0x5b83a3=_0x5cf484[_0xf3b1c2('0x4')],_0x321b7a=_0x5cf484['define']('ChatMessage',attributes,{'tableName':_0xf3b1c2('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xf3b1c2('0x3')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b4005){const _0x157de6=_0xf3b1c2,_0x48b7aa=_0x2b4005[_0x157de6('0x7')]({'plain':!![]});(_0x48b7aa[_0x157de6('0xe')][_0x157de6('0x10')]()==='in'||_0x48b7aa[_0x157de6('0xe')][_0x157de6('0x10')]()===_0x157de6('0xa')&&!_0x48b7aa['secret']&&!_[_0x157de6('0xc')](_0x48b7aa['UserId']))&&_0x5b83a3[_0x157de6('0x5')][_0x157de6('0x0')]({'where':{'id':_0x48b7aa[_0x157de6('0x2')]}})[_0x157de6('0x1')](function(_0x2cc4a0){const _0x22b9ff=_0x157de6;_0x2cc4a0&&_0x2cc4a0[_0x22b9ff('0xf')]({'lastMsgAt':_0x48b7aa['createdAt'],'lastMsgDirection':_0x48b7aa[_0x22b9ff('0xe')]['toLowerCase']()});})['catch'](function(_0x2410c9){console['error'](_0x2410c9);});}},'charset':_0xf3b1c2('0x8'),'collate':_0xf3b1c2('0xb')});return _0x321b7a;};
\ No newline at end of file
+const a82_0x3ac5=['models','UserId','lodash','ChatInteraction','body','FULLTEXT','get','chat_messages','error','isNil','createdAt','utf8mb4','out','direction','toLowerCase','ChatInteractionId','exports','define','ChatMessage','catch','then','secret'];(function(_0x282a89,_0x3ac50c){const _0x2eef1d=function(_0xcfb252){while(--_0xcfb252){_0x282a89['push'](_0x282a89['shift']());}};_0x2eef1d(++_0x3ac50c);}(a82_0x3ac5,0x88));const a82_0x2eef=function(_0x282a89,_0x3ac50c){_0x282a89=_0x282a89-0x0;let _0x2eef1d=a82_0x3ac5[_0x282a89];return _0x2eef1d;};const _0x43628f=a82_0x2eef;'use strict';const _=require(_0x43628f('0x14')),attributes=require('./chatMessage.attributes');module[_0x43628f('0xc')]=function(_0xcfb252){const _0x5e1d15=_0x43628f,_0x5befa6=_0xcfb252[_0x5e1d15('0x12')],_0x307ce7=_0xcfb252[_0x5e1d15('0xd')](_0x5e1d15('0xe'),attributes,{'tableName':_0x5e1d15('0x3'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5e1d15('0x0')],'type':_0x5e1d15('0x1')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x283d05){const _0x32cf79=_0x5e1d15,_0x16c9b4=_0x283d05[_0x32cf79('0x2')]({'plain':!![]});(_0x16c9b4[_0x32cf79('0x9')][_0x32cf79('0xa')]()==='in'||_0x16c9b4[_0x32cf79('0x9')]['toLowerCase']()===_0x32cf79('0x8')&&!_0x16c9b4[_0x32cf79('0x11')]&&!_[_0x32cf79('0x5')](_0x16c9b4[_0x32cf79('0x13')]))&&_0x5befa6[_0x32cf79('0x15')]['findOne']({'where':{'id':_0x16c9b4[_0x32cf79('0xb')]}})[_0x32cf79('0x10')](function(_0x38460f){const _0xdf6055=_0x32cf79;_0x38460f&&_0x38460f['update']({'lastMsgAt':_0x16c9b4[_0xdf6055('0x6')],'lastMsgDirection':_0x16c9b4[_0xdf6055('0x9')][_0xdf6055('0xa')]()});})[_0x32cf79('0xf')](function(_0x37daed){const _0x10017d=_0x32cf79;console[_0x10017d('0x4')](_0x37daed);});}},'charset':_0x5e1d15('0x7'),'collate':'utf8mb4_unicode_ci'});return _0x307ce7;};
\ No newline at end of file