Built motion from commit 5b761a7b.|2.5.36
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 1fa3e9e..28a7a34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c0f=['findOne','MailInteractionId','update','catch','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x8c0f,0xa5));var _0xf8c0=function(_0x47a0d3,_0x2398b1){_0x47a0d3=_0x47a0d3-0x0;var _0x20d918=_0x8c0f[_0x47a0d3];return _0x20d918;};'use strict';var _=require('lodash');var util=require(_0xf8c0('0x0'));var logger=require(_0xf8c0('0x1'))('api');var moment=require(_0xf8c0('0x2'));var BPromise=require(_0xf8c0('0x3'));var rp=require(_0xf8c0('0x4'));var htmlToText=require(_0xf8c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8c0('0x6'));var config=require(_0xf8c0('0x7'));var attributes=require(_0xf8c0('0x8'));module[_0xf8c0('0x9')]=function(_0x3d8419,_0x5d9cf2){return _0x3d8419[_0xf8c0('0xa')](_0xf8c0('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xf8c0('0xc'),'fields':['messageId']},{'name':_0xf8c0('0xd'),'fields':[_0xf8c0('0xe'),_0xf8c0('0xf')],'type':_0xf8c0('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x53ec12,_0x4b34ec,_0x102178){if(_0x53ec12[_0xf8c0('0x11')]){_0x53ec12[_0xf8c0('0xe')]=htmlToText[_0xf8c0('0x12')](_0x53ec12[_0xf8c0('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x102178(null,_0x4b34ec);},'afterCreate':function(_0x4c011d,_0x9f73ca,_0x872e3c){var _0x11231f=_0x3d8419[_0xf8c0('0x13')];var _0x2e7395=_0x4c011d[_0xf8c0('0x14')]({'plain':!![]});if(_0x2e7395['direction']['toLowerCase']()==='in'||_0x2e7395[_0xf8c0('0x15')][_0xf8c0('0x16')]()===_0xf8c0('0x17')&&!_0x2e7395[_0xf8c0('0x18')]&&!_[_0xf8c0('0x19')](_0x2e7395[_0xf8c0('0x1a')])){_0x11231f['MailInteraction'][_0xf8c0('0x1b')]({'where':{'id':_0x2e7395[_0xf8c0('0x1c')]}})['then'](function(_0x5c33c2){if(_0x5c33c2){_0x5c33c2[_0xf8c0('0x1d')]({'lastMsgAt':_0x2e7395['createdAt'],'lastMsgDirection':_0x2e7395[_0xf8c0('0x15')][_0xf8c0('0x16')](),'lastMsgBody':_0x2e7395[_0xf8c0('0x11')]});}})[_0xf8c0('0x1e')](function(_0x2492ea){console['error'](_0x2492ea);});}_0x872e3c();}},'charset':_0xf8c0('0x1f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xfcaf=['catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update'];(function(_0x508d27,_0x4eeeba){var _0x14eff9=function(_0x10bd6c){while(--_0x10bd6c){_0x508d27['push'](_0x508d27['shift']());}};_0x14eff9(++_0x4eeeba);}(_0xfcaf,0x1c3));var _0xffca=function(_0x4b23b0,_0xf3d9b4){_0x4b23b0=_0x4b23b0-0x0;var _0x1440d7=_0xfcaf[_0x4b23b0];return _0x1440d7;};'use strict';var _=require('lodash');var util=require(_0xffca('0x0'));var logger=require(_0xffca('0x1'))('api');var moment=require(_0xffca('0x2'));var BPromise=require(_0xffca('0x3'));var rp=require(_0xffca('0x4'));var htmlToText=require(_0xffca('0x5'));var fs=require('fs');var path=require(_0xffca('0x6'));var rimraf=require(_0xffca('0x7'));var config=require(_0xffca('0x8'));var attributes=require('./mailMessage.attributes');module[_0xffca('0x9')]=function(_0x1f2610,_0x1640fe){return _0x1f2610[_0xffca('0xa')]('MailMessage',attributes,{'tableName':_0xffca('0xb'),'paranoid':![],'indexes':[{'name':_0xffca('0xc'),'fields':[_0xffca('0xc')]},{'name':'fti_mail_messages','fields':['plainBody',_0xffca('0xd')],'type':_0xffca('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x35e94d,_0x300b4f,_0x15dd0c){if(_0x35e94d[_0xffca('0xf')]){_0x35e94d['plainBody']=htmlToText[_0xffca('0x10')](_0x35e94d['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x15dd0c(null,_0x300b4f);},'afterCreate':function(_0x5a0eb8,_0xd7a277,_0x35b1ef){var _0x1ea0f8=_0x1f2610[_0xffca('0x11')];var _0x2c15f5=_0x5a0eb8[_0xffca('0x12')]({'plain':!![]});if(_0x2c15f5[_0xffca('0x13')][_0xffca('0x14')]()==='in'||_0x2c15f5[_0xffca('0x13')][_0xffca('0x14')]()===_0xffca('0x15')&&!_0x2c15f5['secret']&&!_[_0xffca('0x16')](_0x2c15f5[_0xffca('0x17')])){_0x1ea0f8[_0xffca('0x18')][_0xffca('0x19')]({'where':{'id':_0x2c15f5[_0xffca('0x1a')]}})[_0xffca('0x1b')](function(_0x2705d6){if(_0x2705d6){_0x2705d6[_0xffca('0x1c')]({'lastMsgAt':_0x2c15f5['createdAt'],'lastMsgDirection':_0x2c15f5[_0xffca('0x13')][_0xffca('0x14')]()});}})[_0xffca('0x1d')](function(_0x5cd079){console[_0xffca('0x1e')](_0x5cd079);});}_0x35b1ef();}},'charset':'utf8mb4','collate':_0xffca('0x1f')});};
\ No newline at end of file