Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 0f1099c..89c7bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf151=['plainBody','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','MailInteractionId','then','catch','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','FULLTEXT'];(function(_0x4d9eb6,_0x545bc1){var _0x1f5d62=function(_0x4c0a6c){while(--_0x4c0a6c){_0x4d9eb6['push'](_0x4d9eb6['shift']());}};_0x1f5d62(++_0x545bc1);}(_0xf151,0xab));var _0x1f15=function(_0x524eb1,_0x2063d3){_0x524eb1=_0x524eb1-0x0;var _0x3071e0=_0xf151[_0x524eb1];return _0x3071e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f15('0x0'))(_0x1f15('0x1'));var moment=require(_0x1f15('0x2'));var BPromise=require(_0x1f15('0x3'));var rp=require(_0x1f15('0x4'));var htmlToText=require(_0x1f15('0x5'));var fs=require('fs');var path=require(_0x1f15('0x6'));var rimraf=require(_0x1f15('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f15('0x8'));module['exports']=function(_0x4cfc7b,_0x5ecda5){return _0x4cfc7b[_0x1f15('0x9')](_0x1f15('0xa'),attributes,{'tableName':_0x1f15('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1f15('0xc')]},{'name':_0x1f15('0xd'),'fields':['plainBody','subject'],'type':_0x1f15('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2baa12,_0x151020,_0x435cf2){if(_0x2baa12['body']){_0x2baa12[_0x1f15('0xf')]=htmlToText[_0x1f15('0x10')](_0x2baa12[_0x1f15('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x435cf2(null,_0x151020);},'afterCreate':function(_0x5ce5a6,_0x4a0955,_0x5823c3){var _0x340109=_0x4cfc7b[_0x1f15('0x12')];var _0x440c0b=_0x5ce5a6[_0x1f15('0x13')]({'plain':!![]});if(_0x440c0b[_0x1f15('0x14')][_0x1f15('0x15')]()==='in'||_0x440c0b['direction'][_0x1f15('0x15')]()===_0x1f15('0x16')&&!_0x440c0b[_0x1f15('0x17')]&&!_[_0x1f15('0x18')](_0x440c0b['UserId'])){_0x340109[_0x1f15('0x19')]['findOne']({'where':{'id':_0x440c0b[_0x1f15('0x1a')]}})[_0x1f15('0x1b')](function(_0x2960d2){if(_0x2960d2){_0x2960d2['update']({'lastMsgAt':_0x440c0b['createdAt'],'lastMsgDirection':_0x440c0b[_0x1f15('0x14')][_0x1f15('0x15')]()});}})[_0x1f15('0x1c')](function(_0x5529d7){console[_0x1f15('0x1d')](_0x5529d7);});}_0x5823c3();}},'charset':'utf8mb4','collate':_0x1f15('0x1e')});};
\ No newline at end of file
+var _0xbce8=['bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','MailInteraction','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x4f4814,_0x44959d){var _0x179592=function(_0x33f18c){while(--_0x33f18c){_0x4f4814['push'](_0x4f4814['shift']());}};_0x179592(++_0x44959d);}(_0xbce8,0x1ac));var _0x8bce=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0xbce8[_0x44b7d6];return _0x5346f0;};'use strict';var _=require(_0x8bce('0x0'));var util=require('util');var logger=require(_0x8bce('0x1'))(_0x8bce('0x2'));var moment=require(_0x8bce('0x3'));var BPromise=require(_0x8bce('0x4'));var rp=require(_0x8bce('0x5'));var htmlToText=require(_0x8bce('0x6'));var fs=require('fs');var path=require(_0x8bce('0x7'));var rimraf=require(_0x8bce('0x8'));var config=require(_0x8bce('0x9'));var attributes=require(_0x8bce('0xa'));module[_0x8bce('0xb')]=function(_0x4bbff1,_0x4c33fa){return _0x4bbff1['define'](_0x8bce('0xc'),attributes,{'tableName':_0x8bce('0xd'),'paranoid':![],'indexes':[{'name':_0x8bce('0xe'),'fields':['messageId']},{'name':_0x8bce('0xf'),'fields':[_0x8bce('0x10'),_0x8bce('0x11')],'type':_0x8bce('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7faf77,_0x40573a,_0x2a7ca9){if(_0x7faf77[_0x8bce('0x13')]){_0x7faf77[_0x8bce('0x10')]=htmlToText[_0x8bce('0x14')](_0x7faf77['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2a7ca9(null,_0x40573a);},'afterCreate':function(_0xfe8fca,_0x10ed5d,_0x2dfbfc){var _0x417d51=_0x4bbff1[_0x8bce('0x15')];var _0xd1ff5=_0xfe8fca[_0x8bce('0x16')]({'plain':!![]});if(_0xd1ff5[_0x8bce('0x17')]['toLowerCase']()==='in'||_0xd1ff5['direction'][_0x8bce('0x18')]()===_0x8bce('0x19')&&!_0xd1ff5[_0x8bce('0x1a')]&&!_[_0x8bce('0x1b')](_0xd1ff5['UserId'])){_0x417d51[_0x8bce('0x1c')]['findOne']({'where':{'id':_0xd1ff5['MailInteractionId']}})[_0x8bce('0x1d')](function(_0x18669b){if(_0x18669b){_0x18669b[_0x8bce('0x1e')]({'lastMsgAt':_0xd1ff5[_0x8bce('0x1f')],'lastMsgDirection':_0xd1ff5[_0x8bce('0x17')]['toLowerCase']()});}})[_0x8bce('0x20')](function(_0x2eac19){console[_0x8bce('0x21')](_0x2eac19);});}_0x2dfbfc();}},'charset':_0x8bce('0x22'),'collate':_0x8bce('0x23')});};
\ No newline at end of file