Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 5e98e38..0d2fc50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af5=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','fromString','body','models','toLowerCase','direction','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error'];(function(_0x38e20c,_0x26b3c7){var _0x10174a=function(_0x262fd2){while(--_0x262fd2){_0x38e20c['push'](_0x38e20c['shift']());}};_0x10174a(++_0x26b3c7);}(_0x9af5,0x10a));var _0x59af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9af5[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x59af('0x0'));var util=require(_0x59af('0x1'));var logger=require(_0x59af('0x2'))(_0x59af('0x3'));var moment=require(_0x59af('0x4'));var BPromise=require('bluebird');var rp=require(_0x59af('0x5'));var htmlToText=require(_0x59af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x59af('0x7'));var config=require(_0x59af('0x8'));var attributes=require('./mailMessage.attributes');module[_0x59af('0x9')]=function(_0x38fe9a,_0x2f18eb){return _0x38fe9a[_0x59af('0xa')](_0x59af('0xb'),attributes,{'tableName':_0x59af('0xc'),'paranoid':![],'indexes':[{'name':_0x59af('0xd'),'fields':[_0x59af('0xd')]},{'name':_0x59af('0xe'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3889bd,_0x317ab4,_0x470d07){if(_0x3889bd['body']){_0x3889bd[_0x59af('0xf')]=htmlToText[_0x59af('0x10')](_0x3889bd[_0x59af('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x470d07(null,_0x317ab4);},'afterCreate':function(_0x22f1ad,_0x1c6c8c,_0x17aeee){var _0x13b927=_0x38fe9a[_0x59af('0x12')];var _0xeed0eb=_0x22f1ad['get']({'plain':!![]});if(_0xeed0eb['direction'][_0x59af('0x13')]()==='in'||_0xeed0eb[_0x59af('0x14')]['toLowerCase']()==='out'&&!_0xeed0eb[_0x59af('0x15')]&&!_['isNil'](_0xeed0eb[_0x59af('0x16')])){_0x13b927[_0x59af('0x17')][_0x59af('0x18')]({'where':{'id':_0xeed0eb[_0x59af('0x19')]}})[_0x59af('0x1a')](function(_0x391785){if(_0x391785){_0x391785[_0x59af('0x1b')]({'lastMsgAt':_0xeed0eb[_0x59af('0x1c')],'lastMsgDirection':_0xeed0eb[_0x59af('0x14')][_0x59af('0x13')](),'lastMsgBody':_0xeed0eb[_0x59af('0x11')]});}})[_0x59af('0x1d')](function(_0x508247){console[_0x59af('0x1e')](_0x508247);});}_0x17aeee();}},'charset':_0x59af('0x1f'),'collate':_0x59af('0x20')});};
\ No newline at end of file
+var _0xede8=['moment','bluebird','request-promise','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xede8,0xe4));var _0x8ede=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xede8[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x8ede('0x0'));var logger=require(_0x8ede('0x1'))(_0x8ede('0x2'));var moment=require(_0x8ede('0x3'));var BPromise=require(_0x8ede('0x4'));var rp=require(_0x8ede('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x8ede('0x6'));var rimraf=require(_0x8ede('0x7'));var config=require('../../config/environment');var attributes=require(_0x8ede('0x8'));module['exports']=function(_0x5332df,_0x5bcf2f){return _0x5332df[_0x8ede('0x9')](_0x8ede('0xa'),attributes,{'tableName':_0x8ede('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x8ede('0xc'),_0x8ede('0xd')],'type':_0x8ede('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x107afe,_0x1a3ff6,_0x5f0fd0){if(_0x107afe[_0x8ede('0xf')]){_0x107afe[_0x8ede('0xc')]=htmlToText[_0x8ede('0x10')](_0x107afe[_0x8ede('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5f0fd0(null,_0x1a3ff6);},'afterCreate':function(_0x518cf4,_0x4f9262,_0x278b7f){var _0x2042e6=_0x5332df[_0x8ede('0x11')];var _0x5b4e2b=_0x518cf4[_0x8ede('0x12')]({'plain':!![]});if(_0x5b4e2b[_0x8ede('0x13')]['toLowerCase']()==='in'||_0x5b4e2b[_0x8ede('0x13')][_0x8ede('0x14')]()===_0x8ede('0x15')&&!_0x5b4e2b[_0x8ede('0x16')]&&!_[_0x8ede('0x17')](_0x5b4e2b[_0x8ede('0x18')])){_0x2042e6[_0x8ede('0x19')]['findOne']({'where':{'id':_0x5b4e2b[_0x8ede('0x1a')]}})[_0x8ede('0x1b')](function(_0x307a60){if(_0x307a60){_0x307a60[_0x8ede('0x1c')]({'lastMsgAt':_0x5b4e2b['createdAt'],'lastMsgDirection':_0x5b4e2b[_0x8ede('0x13')][_0x8ede('0x14')](),'lastMsgBody':_0x5b4e2b[_0x8ede('0xf')]});}})[_0x8ede('0x1d')](function(_0xafc406){console[_0x8ede('0x1e')](_0xafc406);});}_0x278b7f();}},'charset':_0x8ede('0x1f'),'collate':_0x8ede('0x20')});};
\ No newline at end of file