Built motion from commit 538092ac.|2.6.10
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index e806e58..edcd1a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48f5=['mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','MailMessage'];(function(_0x1b09c6,_0x448443){var _0x4ccaee=function(_0x4de392){while(--_0x4de392){_0x1b09c6['push'](_0x1b09c6['shift']());}};_0x4ccaee(++_0x448443);}(_0x48f5,0x161));var _0x548f=function(_0x57ac3c,_0x20112e){_0x57ac3c=_0x57ac3c-0x0;var _0x387f48=_0x48f5[_0x57ac3c];return _0x387f48;};'use strict';var _=require(_0x548f('0x0'));var util=require(_0x548f('0x1'));var logger=require('../../config/logger')(_0x548f('0x2'));var moment=require('moment');var BPromise=require(_0x548f('0x3'));var rp=require(_0x548f('0x4'));var htmlToText=require(_0x548f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x548f('0x6'));var config=require(_0x548f('0x7'));var attributes=require(_0x548f('0x8'));module['exports']=function(_0x36dfa2,_0xcb03c7){return _0x36dfa2['define'](_0x548f('0x9'),attributes,{'tableName':_0x548f('0xa'),'paranoid':![],'indexes':[{'name':_0x548f('0xb'),'fields':[_0x548f('0xb')]},{'name':_0x548f('0xc'),'fields':[_0x548f('0xd'),'subject'],'type':_0x548f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x15a367,_0x410f8a,_0x232fe3){if(_0x15a367['body']){_0x15a367['plainBody']=htmlToText[_0x548f('0xf')](_0x15a367[_0x548f('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x232fe3(null,_0x410f8a);},'afterCreate':function(_0x3262f9,_0x4e9d6b,_0x31298b){var _0x42d7ac=_0x36dfa2[_0x548f('0x11')];var _0x1393f2=_0x3262f9[_0x548f('0x12')]({'plain':!![]});if(_0x1393f2[_0x548f('0x13')][_0x548f('0x14')]()==='in'||_0x1393f2['direction'][_0x548f('0x14')]()===_0x548f('0x15')&&!_0x1393f2[_0x548f('0x16')]&&!_[_0x548f('0x17')](_0x1393f2['UserId'])){_0x42d7ac[_0x548f('0x18')][_0x548f('0x19')]({'where':{'id':_0x1393f2['MailInteractionId']}})[_0x548f('0x1a')](function(_0x499899){if(_0x499899){_0x499899[_0x548f('0x1b')]({'lastMsgAt':_0x1393f2[_0x548f('0x1c')],'lastMsgDirection':_0x1393f2[_0x548f('0x13')][_0x548f('0x14')]()});}})[_0x548f('0x1d')](function(_0x57b99f){console[_0x548f('0x1e')](_0x57b99f);});}_0x31298b();}},'charset':_0x548f('0x1f'),'collate':_0x548f('0x20')});};
\ No newline at end of file
+var _0xce4d=['path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out','secret','UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x5c61fc,_0x4a91c){var _0x23b189=function(_0x47bb8f){while(--_0x47bb8f){_0x5c61fc['push'](_0x5c61fc['shift']());}};_0x23b189(++_0x4a91c);}(_0xce4d,0x19c));var _0xdce4=function(_0xf306d3,_0x2ba983){_0xf306d3=_0xf306d3-0x0;var _0x2df9a6=_0xce4d[_0xf306d3];return _0x2df9a6;};'use strict';var _=require(_0xdce4('0x0'));var util=require(_0xdce4('0x1'));var logger=require(_0xdce4('0x2'))(_0xdce4('0x3'));var moment=require(_0xdce4('0x4'));var BPromise=require(_0xdce4('0x5'));var rp=require(_0xdce4('0x6'));var htmlToText=require(_0xdce4('0x7'));var fs=require('fs');var path=require(_0xdce4('0x8'));var rimraf=require(_0xdce4('0x9'));var config=require('../../config/environment');var attributes=require(_0xdce4('0xa'));module[_0xdce4('0xb')]=function(_0xe86e1e,_0x6f7099){return _0xe86e1e[_0xdce4('0xc')](_0xdce4('0xd'),attributes,{'tableName':_0xdce4('0xe'),'paranoid':![],'indexes':[{'name':_0xdce4('0xf'),'fields':[_0xdce4('0xf')]},{'name':_0xdce4('0x10'),'fields':[_0xdce4('0x11'),_0xdce4('0x12')],'type':_0xdce4('0x13')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x48b1ca,_0x1bcaee,_0xde43a6){if(_0x48b1ca[_0xdce4('0x14')]){_0x48b1ca[_0xdce4('0x11')]=htmlToText['fromString'](_0x48b1ca[_0xdce4('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xde43a6(null,_0x1bcaee);},'afterCreate':function(_0x1a792b,_0x426c61,_0xe717d9){var _0x52412d=_0xe86e1e[_0xdce4('0x15')];var _0x840ff7=_0x1a792b['get']({'plain':!![]});if(_0x840ff7[_0xdce4('0x16')][_0xdce4('0x17')]()==='in'||_0x840ff7[_0xdce4('0x16')][_0xdce4('0x17')]()===_0xdce4('0x18')&&!_0x840ff7[_0xdce4('0x19')]&&!_['isNil'](_0x840ff7[_0xdce4('0x1a')])){_0x52412d[_0xdce4('0x1b')]['findOne']({'where':{'id':_0x840ff7[_0xdce4('0x1c')]}})[_0xdce4('0x1d')](function(_0x27204b){if(_0x27204b){_0x27204b[_0xdce4('0x1e')]({'lastMsgAt':_0x840ff7['createdAt'],'lastMsgDirection':_0x840ff7[_0xdce4('0x16')][_0xdce4('0x17')]()});}})[_0xdce4('0x1f')](function(_0x1c7efd){console[_0xdce4('0x20')](_0x1c7efd);});}_0xe717d9();}},'charset':_0xdce4('0x21'),'collate':_0xdce4('0x22')});};
\ No newline at end of file