Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index d04279d..22a536b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf457=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','direction','toLowerCase','out','secret','UserId','findOne','MailInteractionId','update','createdAt','catch','error'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0xf457,0x1f1));var _0x7f45=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf457[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7f45('0x0'));var util=require(_0x7f45('0x1'));var logger=require(_0x7f45('0x2'))(_0x7f45('0x3'));var moment=require(_0x7f45('0x4'));var BPromise=require(_0x7f45('0x5'));var rp=require(_0x7f45('0x6'));var htmlToText=require(_0x7f45('0x7'));var fs=require('fs');var path=require(_0x7f45('0x8'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7f45('0x9'));module['exports']=function(_0x1e52d1,_0x312ae7){return _0x1e52d1[_0x7f45('0xa')](_0x7f45('0xb'),attributes,{'tableName':_0x7f45('0xc'),'paranoid':![],'indexes':[{'name':_0x7f45('0xd'),'fields':[_0x7f45('0xd')]},{'name':_0x7f45('0xe'),'fields':['plainBody',_0x7f45('0xf')],'type':_0x7f45('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x568439,_0x49b18a,_0x2bee6b){if(_0x568439[_0x7f45('0x11')]){_0x568439[_0x7f45('0x12')]=htmlToText['fromString'](_0x568439[_0x7f45('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bee6b(null,_0x49b18a);},'afterCreate':function(_0x2fb934,_0x2e98ff,_0xec8bc1){var _0x4c10d5=_0x1e52d1['models'];var _0x5c7cd4=_0x2fb934['get']({'plain':!![]});if(_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()==='in'||_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()===_0x7f45('0x15')&&!_0x5c7cd4[_0x7f45('0x16')]&&!_['isNil'](_0x5c7cd4[_0x7f45('0x17')])){_0x4c10d5['MailInteraction'][_0x7f45('0x18')]({'where':{'id':_0x5c7cd4[_0x7f45('0x19')]}})['then'](function(_0x376824){if(_0x376824){_0x376824[_0x7f45('0x1a')]({'lastMsgAt':_0x5c7cd4[_0x7f45('0x1b')],'lastMsgDirection':_0x5c7cd4[_0x7f45('0x13')][_0x7f45('0x14')]()});}})[_0x7f45('0x1c')](function(_0x197260){console[_0x7f45('0x1d')](_0x197260);});}_0xec8bc1();}},'charset':_0x7f45('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb449=['path','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text'];(function(_0x3f0122,_0x1627ca){var _0x2039d7=function(_0x5631dd){while(--_0x5631dd){_0x3f0122['push'](_0x3f0122['shift']());}};_0x2039d7(++_0x1627ca);}(_0xb449,0x90));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b44('0x2'));var BPromise=require(_0x9b44('0x3'));var rp=require(_0x9b44('0x4'));var htmlToText=require(_0x9b44('0x5'));var fs=require('fs');var path=require(_0x9b44('0x6'));var rimraf=require(_0x9b44('0x7'));var config=require(_0x9b44('0x8'));var attributes=require('./mailMessage.attributes');module[_0x9b44('0x9')]=function(_0x2375c9,_0x1318da){return _0x2375c9[_0x9b44('0xa')](_0x9b44('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x9b44('0xc'),'fields':['messageId']},{'name':_0x9b44('0xd'),'fields':[_0x9b44('0xe'),'subject'],'type':_0x9b44('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x565416,_0x301056,_0x5844d4){if(_0x565416[_0x9b44('0x10')]){_0x565416[_0x9b44('0xe')]=htmlToText[_0x9b44('0x11')](_0x565416[_0x9b44('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5844d4(null,_0x301056);},'afterCreate':function(_0x51fa2f,_0x17dd90,_0x3d0d01){var _0x2bce5c=_0x2375c9['models'];var _0x3b1853=_0x51fa2f[_0x9b44('0x12')]({'plain':!![]});if(_0x3b1853[_0x9b44('0x13')][_0x9b44('0x14')]()==='in'||_0x3b1853['direction'][_0x9b44('0x14')]()===_0x9b44('0x15')&&!_0x3b1853[_0x9b44('0x16')]&&!_[_0x9b44('0x17')](_0x3b1853[_0x9b44('0x18')])){_0x2bce5c[_0x9b44('0x19')]['findOne']({'where':{'id':_0x3b1853[_0x9b44('0x1a')]}})[_0x9b44('0x1b')](function(_0x367e04){if(_0x367e04){_0x367e04['update']({'lastMsgAt':_0x3b1853['createdAt'],'lastMsgDirection':_0x3b1853[_0x9b44('0x13')]['toLowerCase']()});}})['catch'](function(_0x18d32e){console[_0x9b44('0x1c')](_0x18d32e);});}_0x3d0d01();}},'charset':'utf8mb4','collate':_0x9b44('0x1d')});};
\ No newline at end of file