Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 14d73d7..d5e56b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eed=['get','direction','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString'];(function(_0x102fd7,_0x1edca5){var _0x10116a=function(_0x270aaf){while(--_0x270aaf){_0x102fd7['push'](_0x102fd7['shift']());}};_0x10116a(++_0x1edca5);}(_0x9eed,0x1ed));var _0xd9ee=function(_0x4998be,_0x5d473c){_0x4998be=_0x4998be-0x0;var _0x22a62b=_0x9eed[_0x4998be];return _0x22a62b;};'use strict';var _=require(_0xd9ee('0x0'));var util=require(_0xd9ee('0x1'));var logger=require(_0xd9ee('0x2'))(_0xd9ee('0x3'));var moment=require(_0xd9ee('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0xd9ee('0x5'));var fs=require('fs');var path=require(_0xd9ee('0x6'));var rimraf=require(_0xd9ee('0x7'));var config=require('../../config/environment');var attributes=require(_0xd9ee('0x8'));module['exports']=function(_0x47fe69,_0x26544b){return _0x47fe69[_0xd9ee('0x9')](_0xd9ee('0xa'),attributes,{'tableName':_0xd9ee('0xb'),'paranoid':![],'indexes':[{'name':_0xd9ee('0xc'),'fields':[_0xd9ee('0xc')]},{'name':_0xd9ee('0xd'),'fields':[_0xd9ee('0xe'),_0xd9ee('0xf')],'type':_0xd9ee('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ad562,_0x58c7fb,_0x53c291){if(_0x3ad562[_0xd9ee('0x11')]){_0x3ad562[_0xd9ee('0xe')]=htmlToText[_0xd9ee('0x12')](_0x3ad562['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x53c291(null,_0x58c7fb);},'afterCreate':function(_0x505f68,_0x539b51,_0x224581){var _0x19bc47=_0x47fe69['models'];var _0x5b2120=_0x505f68[_0xd9ee('0x13')]({'plain':!![]});if(_0x5b2120[_0xd9ee('0x14')][_0xd9ee('0x15')]()==='in'||_0x5b2120[_0xd9ee('0x14')][_0xd9ee('0x15')]()===_0xd9ee('0x16')&&!_0x5b2120[_0xd9ee('0x17')]&&!_[_0xd9ee('0x18')](_0x5b2120['UserId'])){_0x19bc47[_0xd9ee('0x19')][_0xd9ee('0x1a')]({'where':{'id':_0x5b2120['MailInteractionId']}})[_0xd9ee('0x1b')](function(_0x1fcc91){if(_0x1fcc91){_0x1fcc91['update']({'lastMsgAt':_0x5b2120[_0xd9ee('0x1c')],'lastMsgDirection':_0x5b2120[_0xd9ee('0x14')][_0xd9ee('0x15')]()});}})[_0xd9ee('0x1d')](function(_0x35d903){console[_0xd9ee('0x1e')](_0x35d903);});}_0x224581();}},'charset':_0xd9ee('0x1f'),'collate':'utf8mb4_unicode_ci'});};
\ 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