Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index bf7da5a..d5e56b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5af=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','get','toLowerCase','direction','out','secret','isNil','UserId','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x47d5d2,_0x60bdf2){var _0x5109f4=function(_0x5abaea){while(--_0x5abaea){_0x47d5d2['push'](_0x47d5d2['shift']());}};_0x5109f4(++_0x60bdf2);}(_0xc5af,0x174));var _0xfc5a=function(_0x5435ef,_0x369e17){_0x5435ef=_0x5435ef-0x0;var _0x1abf1e=_0xc5af[_0x5435ef];return _0x1abf1e;};'use strict';var _=require(_0xfc5a('0x0'));var util=require(_0xfc5a('0x1'));var logger=require(_0xfc5a('0x2'))(_0xfc5a('0x3'));var moment=require(_0xfc5a('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc5a('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfc5a('0x6'));var rimraf=require(_0xfc5a('0x7'));var config=require(_0xfc5a('0x8'));var attributes=require(_0xfc5a('0x9'));module[_0xfc5a('0xa')]=function(_0x226cfb,_0x14f026){return _0x226cfb[_0xfc5a('0xb')](_0xfc5a('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfc5a('0xd')]},{'name':_0xfc5a('0xe'),'fields':['plainBody',_0xfc5a('0xf')],'type':_0xfc5a('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d4381,_0xec173e,_0x4b9ccf){if(_0x2d4381[_0xfc5a('0x11')]){_0x2d4381[_0xfc5a('0x12')]=htmlToText['fromString'](_0x2d4381['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4b9ccf(null,_0xec173e);},'afterCreate':function(_0x20f888,_0x16ef92,_0x5f2cbe){var _0x545207=_0x226cfb['models'];var _0x2a2d85=_0x20f888[_0xfc5a('0x13')]({'plain':!![]});if(_0x2a2d85['direction'][_0xfc5a('0x14')]()==='in'||_0x2a2d85[_0xfc5a('0x15')]['toLowerCase']()===_0xfc5a('0x16')&&!_0x2a2d85[_0xfc5a('0x17')]&&!_[_0xfc5a('0x18')](_0x2a2d85[_0xfc5a('0x19')])){_0x545207['MailInteraction'][_0xfc5a('0x1a')]({'where':{'id':_0x2a2d85[_0xfc5a('0x1b')]}})[_0xfc5a('0x1c')](function(_0x557f87){if(_0x557f87){_0x557f87[_0xfc5a('0x1d')]({'lastMsgAt':_0x2a2d85[_0xfc5a('0x1e')],'lastMsgDirection':_0x2a2d85[_0xfc5a('0x15')][_0xfc5a('0x14')](),'lastMsgBody':_0x2a2d85[_0xfc5a('0x11')]});}})[_0xfc5a('0x1f')](function(_0x8a5139){console['error'](_0x8a5139);});}_0x5f2cbe();}},'charset':_0xfc5a('0x20'),'collate':_0xfc5a('0x21')});};
\ No newline at end of file
+var _0x0f29=['then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne'];(function(_0x9033c9,_0x519986){var _0x4fe710=function(_0x1e933f){while(--_0x1e933f){_0x9033c9['push'](_0x9033c9['shift']());}};_0x4fe710(++_0x519986);}(_0x0f29,0x14f));var _0x90f2=function(_0x3b06c1,_0x17eba6){_0x3b06c1=_0x3b06c1-0x0;var _0x1b8e9c=_0x0f29[_0x3b06c1];return _0x1b8e9c;};'use strict';var _=require(_0x90f2('0x0'));var util=require(_0x90f2('0x1'));var logger=require(_0x90f2('0x2'))(_0x90f2('0x3'));var moment=require('moment');var BPromise=require(_0x90f2('0x4'));var rp=require(_0x90f2('0x5'));var htmlToText=require(_0x90f2('0x6'));var fs=require('fs');var path=require(_0x90f2('0x7'));var rimraf=require(_0x90f2('0x8'));var config=require(_0x90f2('0x9'));var attributes=require(_0x90f2('0xa'));module['exports']=function(_0x486c51,_0x1762ed){return _0x486c51[_0x90f2('0xb')](_0x90f2('0xc'),attributes,{'tableName':_0x90f2('0xd'),'paranoid':![],'indexes':[{'name':_0x90f2('0xe'),'fields':[_0x90f2('0xe')]},{'name':_0x90f2('0xf'),'fields':[_0x90f2('0x10'),_0x90f2('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10e246,_0x1e12b1,_0x9be5c7){if(_0x10e246[_0x90f2('0x12')]){_0x10e246[_0x90f2('0x10')]=htmlToText[_0x90f2('0x13')](_0x10e246[_0x90f2('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x9be5c7(null,_0x1e12b1);},'afterCreate':function(_0x1de085,_0x3a809f,_0x22b4ef){var _0x3f1d03=_0x486c51['models'];var _0x9f0b9f=_0x1de085[_0x90f2('0x14')]({'plain':!![]});if(_0x9f0b9f[_0x90f2('0x15')]['toLowerCase']()==='in'||_0x9f0b9f['direction'][_0x90f2('0x16')]()===_0x90f2('0x17')&&!_0x9f0b9f['secret']&&!_[_0x90f2('0x18')](_0x9f0b9f[_0x90f2('0x19')])){_0x3f1d03[_0x90f2('0x1a')][_0x90f2('0x1b')]({'where':{'id':_0x9f0b9f['MailInteractionId']}})[_0x90f2('0x1c')](function(_0x54cdcd){if(_0x54cdcd){_0x54cdcd[_0x90f2('0x1d')]({'lastMsgAt':_0x9f0b9f['createdAt'],'lastMsgDirection':_0x9f0b9f[_0x90f2('0x15')][_0x90f2('0x16')]()});}})[_0x90f2('0x1e')](function(_0x4d7828){console['error'](_0x4d7828);});}_0x22b4ef();}},'charset':_0x90f2('0x1f'),'collate':_0x90f2('0x20')});};
\ No newline at end of file