Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index c961a0d..d5e56b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f0=['FULLTEXT','body','plainBody','fromString','models','get','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','direction','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject'];(function(_0x523dda,_0x282705){var _0x2db386=function(_0x28fa52){while(--_0x28fa52){_0x523dda['push'](_0x523dda['shift']());}};_0x2db386(++_0x282705);}(_0x75f0,0x1f0));var _0x075f=function(_0x465e84,_0x2ad6f8){_0x465e84=_0x465e84-0x0;var _0x29c6df=_0x75f0[_0x465e84];return _0x29c6df;};'use strict';var _=require(_0x075f('0x0'));var util=require('util');var logger=require(_0x075f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x075f('0x2'));var htmlToText=require(_0x075f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x075f('0x4'));var config=require(_0x075f('0x5'));var attributes=require(_0x075f('0x6'));module[_0x075f('0x7')]=function(_0x461ee8,_0x11830f){return _0x461ee8[_0x075f('0x8')](_0x075f('0x9'),attributes,{'tableName':_0x075f('0xa'),'paranoid':![],'indexes':[{'name':_0x075f('0xb'),'fields':['messageId']},{'name':_0x075f('0xc'),'fields':['plainBody',_0x075f('0xd')],'type':_0x075f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x32d32f,_0x558534,_0x15c2ab){if(_0x32d32f[_0x075f('0xf')]){_0x32d32f[_0x075f('0x10')]=htmlToText[_0x075f('0x11')](_0x32d32f[_0x075f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x15c2ab(null,_0x558534);},'afterCreate':function(_0x1cb8c0,_0x56889f,_0x183650){var _0x5ca485=_0x461ee8[_0x075f('0x12')];var _0x3ec0b9=_0x1cb8c0[_0x075f('0x13')]({'plain':!![]});if(_0x3ec0b9['direction'][_0x075f('0x14')]()==='in'||_0x3ec0b9['direction']['toLowerCase']()===_0x075f('0x15')&&!_0x3ec0b9[_0x075f('0x16')]&&!_['isNil'](_0x3ec0b9[_0x075f('0x17')])){_0x5ca485[_0x075f('0x18')][_0x075f('0x19')]({'where':{'id':_0x3ec0b9[_0x075f('0x1a')]}})[_0x075f('0x1b')](function(_0x430db7){if(_0x430db7){_0x430db7[_0x075f('0x1c')]({'lastMsgAt':_0x3ec0b9[_0x075f('0x1d')],'lastMsgDirection':_0x3ec0b9[_0x075f('0x1e')][_0x075f('0x14')](),'lastMsgBody':_0x3ec0b9['body']});}})['catch'](function(_0x4fb8c4){console[_0x075f('0x1f')](_0x4fb8c4);});}_0x183650();}},'charset':_0x075f('0x20'),'collate':_0x075f('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