Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index f5c0e52..d5e56b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6471=['isNil','UserId','MailInteraction','findOne','MailInteractionId','then','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','body','models','direction','toLowerCase'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x6471,0x169));var _0x1647=function(_0xa634ff,_0x377aa4){_0xa634ff=_0xa634ff-0x0;var _0x27bf1f=_0x6471[_0xa634ff];return _0x27bf1f;};'use strict';var _=require('lodash');var util=require(_0x1647('0x0'));var logger=require(_0x1647('0x1'))(_0x1647('0x2'));var moment=require(_0x1647('0x3'));var BPromise=require(_0x1647('0x4'));var rp=require(_0x1647('0x5'));var htmlToText=require(_0x1647('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1647('0x7'));var config=require(_0x1647('0x8'));var attributes=require(_0x1647('0x9'));module[_0x1647('0xa')]=function(_0x293338,_0x47493f){return _0x293338[_0x1647('0xb')](_0x1647('0xc'),attributes,{'tableName':_0x1647('0xd'),'paranoid':![],'indexes':[{'name':_0x1647('0xe'),'fields':[_0x1647('0xe')]},{'name':'fti_mail_messages','fields':[_0x1647('0xf'),_0x1647('0x10')],'type':_0x1647('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x42000b,_0x3b960,_0x579ab2){if(_0x42000b['body']){_0x42000b[_0x1647('0xf')]=htmlToText[_0x1647('0x12')](_0x42000b[_0x1647('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x579ab2(null,_0x3b960);},'afterCreate':function(_0xb76f4a,_0x29e4f1,_0x3889f6){var _0x50f40c=_0x293338[_0x1647('0x14')];var _0x48146b=_0xb76f4a['get']({'plain':!![]});if(_0x48146b[_0x1647('0x15')][_0x1647('0x16')]()==='in'||_0x48146b['direction'][_0x1647('0x16')]()==='out'&&!_0x48146b['secret']&&!_[_0x1647('0x17')](_0x48146b[_0x1647('0x18')])){_0x50f40c[_0x1647('0x19')][_0x1647('0x1a')]({'where':{'id':_0x48146b[_0x1647('0x1b')]}})[_0x1647('0x1c')](function(_0x58bdd7){if(_0x58bdd7){_0x58bdd7['update']({'lastMsgAt':_0x48146b['createdAt'],'lastMsgDirection':_0x48146b[_0x1647('0x15')][_0x1647('0x16')]()});}})[_0x1647('0x1d')](function(_0x173391){console[_0x1647('0x1e')](_0x173391);});}_0x3889f6();}},'charset':_0x1647('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