Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 85a1384..d5e56b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea8d=['./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','out','secret','isNil','MailInteraction','findOne','then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x304320,_0x232a69){var _0xe607da=function(_0x2eb451){while(--_0x2eb451){_0x304320['push'](_0x304320['shift']());}};_0xe607da(++_0x232a69);}(_0xea8d,0x102));var _0xdea8=function(_0x2264cc,_0x5b4181){_0x2264cc=_0x2264cc-0x0;var _0x8a36e=_0xea8d[_0x2264cc];return _0x8a36e;};'use strict';var _=require('lodash');var util=require(_0xdea8('0x0'));var logger=require(_0xdea8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdea8('0x2'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xdea8('0x3'));var rimraf=require(_0xdea8('0x4'));var config=require(_0xdea8('0x5'));var attributes=require(_0xdea8('0x6'));module[_0xdea8('0x7')]=function(_0x45a274,_0x2a7bac){return _0x45a274[_0xdea8('0x8')](_0xdea8('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xdea8('0xa')]},{'name':_0xdea8('0xb'),'fields':[_0xdea8('0xc'),_0xdea8('0xd')],'type':_0xdea8('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e6c94,_0x94fa22,_0x4c2890){if(_0x4e6c94[_0xdea8('0xf')]){_0x4e6c94[_0xdea8('0xc')]=htmlToText[_0xdea8('0x10')](_0x4e6c94[_0xdea8('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c2890(null,_0x94fa22);},'afterCreate':function(_0x4d2cc2,_0x440280,_0xe008d3){var _0x1f13e0=_0x45a274[_0xdea8('0x11')];var _0x2c2860=_0x4d2cc2[_0xdea8('0x12')]({'plain':!![]});if(_0x2c2860['direction'][_0xdea8('0x13')]()==='in'||_0x2c2860['direction'][_0xdea8('0x13')]()===_0xdea8('0x14')&&!_0x2c2860[_0xdea8('0x15')]&&!_[_0xdea8('0x16')](_0x2c2860['UserId'])){_0x1f13e0[_0xdea8('0x17')][_0xdea8('0x18')]({'where':{'id':_0x2c2860['MailInteractionId']}})[_0xdea8('0x19')](function(_0xab64c1){if(_0xab64c1){_0xab64c1[_0xdea8('0x1a')]({'lastMsgAt':_0x2c2860[_0xdea8('0x1b')],'lastMsgDirection':_0x2c2860[_0xdea8('0x1c')][_0xdea8('0x13')](),'lastMsgBody':_0x2c2860[_0xdea8('0xf')]});}})[_0xdea8('0x1d')](function(_0x4c64fc){console[_0xdea8('0x1e')](_0x4c64fc);});}_0xe008d3();}},'charset':_0xdea8('0x1f'),'collate':_0xdea8('0x20')});};
\ 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