Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index c39a3cf..a710671 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bfa=['messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','exports','define'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x8bfa,0xee));var _0xa8bf=function(_0x31c5fd,_0x33131f){_0x31c5fd=_0x31c5fd-0x0;var _0x3799ab=_0x8bfa[_0x31c5fd];return _0x3799ab;};'use strict';var _=require(_0xa8bf('0x0'));var util=require('util');var logger=require(_0xa8bf('0x1'))('api');var moment=require(_0xa8bf('0x2'));var BPromise=require(_0xa8bf('0x3'));var rp=require(_0xa8bf('0x4'));var htmlToText=require(_0xa8bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8bf('0x6'));var config=require(_0xa8bf('0x7'));var attributes=require('./mailMessage.attributes');module[_0xa8bf('0x8')]=function(_0x5b4c92,_0x256902){return _0x5b4c92[_0xa8bf('0x9')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xa8bf('0xa'),'fields':[_0xa8bf('0xa')]},{'name':_0xa8bf('0xb'),'fields':[_0xa8bf('0xc'),_0xa8bf('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4316ba,_0x85489d,_0x528efc){if(_0x4316ba[_0xa8bf('0xe')]){_0x4316ba[_0xa8bf('0xc')]=htmlToText['fromString'](_0x4316ba['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x528efc(null,_0x85489d);},'afterCreate':function(_0x1ccce0,_0x5a2eaf,_0x2baa0e){var _0x3b9f1c=_0x5b4c92[_0xa8bf('0xf')];var _0x2033e2=_0x1ccce0[_0xa8bf('0x10')]({'plain':!![]});if(_0x2033e2[_0xa8bf('0x11')]['toLowerCase']()==='in'||_0x2033e2[_0xa8bf('0x11')][_0xa8bf('0x12')]()==='out'&&!_0x2033e2['secret']&&!_[_0xa8bf('0x13')](_0x2033e2[_0xa8bf('0x14')])){_0x3b9f1c[_0xa8bf('0x15')][_0xa8bf('0x16')]({'where':{'id':_0x2033e2[_0xa8bf('0x17')]}})[_0xa8bf('0x18')](function(_0x525d06){if(_0x525d06){_0x525d06[_0xa8bf('0x19')]({'lastMsgAt':_0x2033e2[_0xa8bf('0x1a')],'lastMsgDirection':_0x2033e2[_0xa8bf('0x11')][_0xa8bf('0x12')]()});}})[_0xa8bf('0x1b')](function(_0x2e4751){console[_0xa8bf('0x1c')](_0x2e4751);});}_0x2baa0e();}},'charset':_0xa8bf('0x1d'),'collate':_0xa8bf('0x1e')});};
\ No newline at end of file
+var _0xd48f=['path','rimraf','../../config/environment','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','catch','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x22b5fa,_0x5702d8){var _0x385ac0=function(_0x2b1ef1){while(--_0x2b1ef1){_0x22b5fa['push'](_0x22b5fa['shift']());}};_0x385ac0(++_0x5702d8);}(_0xd48f,0x87));var _0xfd48=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd48f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfd48('0x0'));var util=require(_0xfd48('0x1'));var logger=require(_0xfd48('0x2'))(_0xfd48('0x3'));var moment=require(_0xfd48('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfd48('0x5'));var rimraf=require(_0xfd48('0x6'));var config=require(_0xfd48('0x7'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x417ddb,_0x37c242){return _0x417ddb['define'](_0xfd48('0x8'),attributes,{'tableName':_0xfd48('0x9'),'paranoid':![],'indexes':[{'name':_0xfd48('0xa'),'fields':['messageId']},{'name':_0xfd48('0xb'),'fields':[_0xfd48('0xc'),'subject'],'type':_0xfd48('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x380caf,_0x3e5455,_0x4bc0ec){if(_0x380caf[_0xfd48('0xe')]){_0x380caf[_0xfd48('0xc')]=htmlToText[_0xfd48('0xf')](_0x380caf[_0xfd48('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4bc0ec(null,_0x3e5455);},'afterCreate':function(_0x41b264,_0x6744fd,_0x1be06a){var _0x122668=_0x417ddb[_0xfd48('0x10')];var _0x5f5c08=_0x41b264[_0xfd48('0x11')]({'plain':!![]});if(_0x5f5c08['direction']['toLowerCase']()==='in'||_0x5f5c08[_0xfd48('0x12')][_0xfd48('0x13')]()===_0xfd48('0x14')&&!_0x5f5c08[_0xfd48('0x15')]&&!_[_0xfd48('0x16')](_0x5f5c08[_0xfd48('0x17')])){_0x122668['MailInteraction'][_0xfd48('0x18')]({'where':{'id':_0x5f5c08[_0xfd48('0x19')]}})['then'](function(_0x139572){if(_0x139572){_0x139572['update']({'lastMsgAt':_0x5f5c08['createdAt'],'lastMsgDirection':_0x5f5c08[_0xfd48('0x12')]['toLowerCase']()});}})[_0xfd48('0x1a')](function(_0x335fa2){console['error'](_0x335fa2);});}_0x1be06a();}},'charset':_0xfd48('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file