Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index cce2780..d6ab209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33fd=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','MailInteractionId','body','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','html-to-text'];(function(_0x45138b,_0xec2bd6){var _0x398884=function(_0x408309){while(--_0x408309){_0x45138b['push'](_0x45138b['shift']());}};_0x398884(++_0xec2bd6);}(_0x33fd,0x111));var _0xd33f=function(_0x148287,_0x18fdc6){_0x148287=_0x148287-0x0;var _0x511244=_0x33fd[_0x148287];return _0x511244;};'use strict';var _=require(_0xd33f('0x0'));var util=require(_0xd33f('0x1'));var logger=require('../../config/logger')(_0xd33f('0x2'));var moment=require(_0xd33f('0x3'));var BPromise=require(_0xd33f('0x4'));var rp=require('request-promise');var htmlToText=require(_0xd33f('0x5'));var fs=require('fs');var path=require(_0xd33f('0x6'));var rimraf=require(_0xd33f('0x7'));var config=require(_0xd33f('0x8'));var attributes=require(_0xd33f('0x9'));module[_0xd33f('0xa')]=function(_0x55f9ce,_0x58f74e){return _0x55f9ce['define'](_0xd33f('0xb'),attributes,{'tableName':_0xd33f('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd33f('0xd')]},{'name':_0xd33f('0xe'),'fields':[_0xd33f('0xf'),'subject'],'type':_0xd33f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2810c7,_0x100347,_0x2594c6){if(_0x2810c7['body']){_0x2810c7[_0xd33f('0xf')]=htmlToText[_0xd33f('0x11')](_0x2810c7['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2594c6(null,_0x100347);},'afterCreate':function(_0x924ef,_0x5ad6c4,_0x3b2507){var _0x161bca=_0x55f9ce[_0xd33f('0x12')];var _0x21ffc7=_0x924ef[_0xd33f('0x13')]({'plain':!![]});if(_0x21ffc7[_0xd33f('0x14')][_0xd33f('0x15')]()==='in'||_0x21ffc7['direction']['toLowerCase']()===_0xd33f('0x16')&&!_0x21ffc7[_0xd33f('0x17')]&&!_['isNil'](_0x21ffc7[_0xd33f('0x18')])){_0x161bca[_0xd33f('0x19')]['findOne']({'where':{'id':_0x21ffc7[_0xd33f('0x1a')]}})['then'](function(_0x5421ea){if(_0x5421ea){_0x5421ea['update']({'lastMsgAt':_0x21ffc7['createdAt'],'lastMsgDirection':_0x21ffc7[_0xd33f('0x14')][_0xd33f('0x15')](),'lastMsgBody':_0x21ffc7[_0xd33f('0x1b')]});}})['catch'](function(_0x13ecee){console[_0xd33f('0x1c')](_0x13ecee);});}_0x3b2507();}},'charset':_0xd33f('0x1d'),'collate':_0xd33f('0x1e')});};
\ No newline at end of file
+var _0xdcc3=['MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x50c109,_0x211da2){var _0x166bdc=function(_0x3a3e73){while(--_0x3a3e73){_0x50c109['push'](_0x50c109['shift']());}};_0x166bdc(++_0x211da2);}(_0xdcc3,0x76));var _0x3dcc=function(_0x4a0e11,_0x3a468d){_0x4a0e11=_0x4a0e11-0x0;var _0x27b686=_0xdcc3[_0x4a0e11];return _0x27b686;};'use strict';var _=require('lodash');var util=require(_0x3dcc('0x0'));var logger=require(_0x3dcc('0x1'))(_0x3dcc('0x2'));var moment=require(_0x3dcc('0x3'));var BPromise=require(_0x3dcc('0x4'));var rp=require(_0x3dcc('0x5'));var htmlToText=require(_0x3dcc('0x6'));var fs=require('fs');var path=require(_0x3dcc('0x7'));var rimraf=require(_0x3dcc('0x8'));var config=require('../../config/environment');var attributes=require(_0x3dcc('0x9'));module['exports']=function(_0x1c5309,_0x122546){return _0x1c5309[_0x3dcc('0xa')](_0x3dcc('0xb'),attributes,{'tableName':_0x3dcc('0xc'),'paranoid':![],'indexes':[{'name':_0x3dcc('0xd'),'fields':[_0x3dcc('0xd')]},{'name':'fti_mail_messages','fields':[_0x3dcc('0xe'),'subject'],'type':_0x3dcc('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1cff31,_0x46156b,_0x36d734){if(_0x1cff31[_0x3dcc('0x10')]){_0x1cff31[_0x3dcc('0xe')]=htmlToText[_0x3dcc('0x11')](_0x1cff31[_0x3dcc('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x36d734(null,_0x46156b);},'afterCreate':function(_0x42aaf9,_0x5e41fa,_0x3f3c5d){var _0x49e71b=_0x1c5309[_0x3dcc('0x12')];var _0x1976f6=_0x42aaf9[_0x3dcc('0x13')]({'plain':!![]});if(_0x1976f6[_0x3dcc('0x14')][_0x3dcc('0x15')]()==='in'||_0x1976f6[_0x3dcc('0x14')]['toLowerCase']()===_0x3dcc('0x16')&&!_0x1976f6[_0x3dcc('0x17')]&&!_[_0x3dcc('0x18')](_0x1976f6[_0x3dcc('0x19')])){_0x49e71b[_0x3dcc('0x1a')][_0x3dcc('0x1b')]({'where':{'id':_0x1976f6[_0x3dcc('0x1c')]}})[_0x3dcc('0x1d')](function(_0x5d742a){if(_0x5d742a){_0x5d742a[_0x3dcc('0x1e')]({'lastMsgAt':_0x1976f6[_0x3dcc('0x1f')],'lastMsgDirection':_0x1976f6[_0x3dcc('0x14')][_0x3dcc('0x15')]()});}})[_0x3dcc('0x20')](function(_0x103266){console[_0x3dcc('0x21')](_0x103266);});}_0x3f3c5d();}},'charset':_0x3dcc('0x22'),'collate':_0x3dcc('0x23')});};
\ No newline at end of file