Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / api / mailMessage / mailMessage.model.js
index 6b6f37f..9984a95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf974=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then'];(function(_0x106ee4,_0x172ca9){var _0x397b09=function(_0x51f517){while(--_0x51f517){_0x106ee4['push'](_0x106ee4['shift']());}};_0x397b09(++_0x172ca9);}(_0xf974,0x141));var _0x4f97=function(_0x13a86a,_0xf387d2){_0x13a86a=_0x13a86a-0x0;var _0xc56502=_0xf974[_0x13a86a];return _0xc56502;};'use strict';var _=require('lodash');var util=require(_0x4f97('0x0'));var logger=require(_0x4f97('0x1'))(_0x4f97('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4f97('0x3'));var htmlToText=require(_0x4f97('0x4'));var fs=require('fs');var path=require(_0x4f97('0x5'));var rimraf=require(_0x4f97('0x6'));var config=require(_0x4f97('0x7'));var attributes=require('./mailMessage.attributes');module[_0x4f97('0x8')]=function(_0xf8d2a7,_0x1fd5c1){return _0xf8d2a7[_0x4f97('0x9')](_0x4f97('0xa'),attributes,{'tableName':_0x4f97('0xb'),'paranoid':![],'indexes':[{'name':_0x4f97('0xc'),'fields':[_0x4f97('0xc')]},{'name':_0x4f97('0xd'),'fields':[_0x4f97('0xe'),_0x4f97('0xf')],'type':_0x4f97('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x477724,_0x481a32,_0x8cde84){if(_0x477724['body']){_0x477724['plainBody']=htmlToText[_0x4f97('0x11')](_0x477724[_0x4f97('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8cde84(null,_0x481a32);},'afterCreate':function(_0x443a98,_0x43ca50,_0x3cbf1d){var _0x4b8784=_0xf8d2a7[_0x4f97('0x13')];var _0x2f53c5=_0x443a98['get']({'plain':!![]});if(_0x2f53c5[_0x4f97('0x14')]['toLowerCase']()==='in'||_0x2f53c5[_0x4f97('0x14')][_0x4f97('0x15')]()===_0x4f97('0x16')&&!_0x2f53c5['secret']&&!_[_0x4f97('0x17')](_0x2f53c5[_0x4f97('0x18')])){_0x4b8784[_0x4f97('0x19')][_0x4f97('0x1a')]({'where':{'id':_0x2f53c5[_0x4f97('0x1b')]}})[_0x4f97('0x1c')](function(_0x389812){if(_0x389812){_0x389812[_0x4f97('0x1d')]({'lastMsgAt':_0x2f53c5[_0x4f97('0x1e')],'lastMsgDirection':_0x2f53c5[_0x4f97('0x14')][_0x4f97('0x15')]()});}})[_0x4f97('0x1f')](function(_0x50f7b3){console[_0x4f97('0x20')](_0x50f7b3);});}_0x3cbf1d();}},'charset':_0x4f97('0x21'),'collate':_0x4f97('0x22')});};
\ No newline at end of file
+var _0x9ef9=['models','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','direction','catch','error','lodash','util','../../config/logger','api','moment','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','body','plainBody','fromString'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x9ef9,0x115));var _0x99ef=function(_0x5a2d1a,_0x24af9f){_0x5a2d1a=_0x5a2d1a-0x0;var _0xab3bab=_0x9ef9[_0x5a2d1a];return _0xab3bab;};'use strict';var _=require(_0x99ef('0x0'));var util=require(_0x99ef('0x1'));var logger=require(_0x99ef('0x2'))(_0x99ef('0x3'));var moment=require(_0x99ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x99ef('0x5'));var fs=require('fs');var path=require(_0x99ef('0x6'));var rimraf=require(_0x99ef('0x7'));var config=require(_0x99ef('0x8'));var attributes=require(_0x99ef('0x9'));module[_0x99ef('0xa')]=function(_0x54e897,_0x1736f4){return _0x54e897[_0x99ef('0xb')](_0x99ef('0xc'),attributes,{'tableName':_0x99ef('0xd'),'paranoid':![],'indexes':[{'name':_0x99ef('0xe'),'fields':['messageId']},{'name':_0x99ef('0xf'),'fields':['plainBody',_0x99ef('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x481994,_0x3ad8d7,_0x23d794){if(_0x481994[_0x99ef('0x11')]){_0x481994[_0x99ef('0x12')]=htmlToText[_0x99ef('0x13')](_0x481994['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x23d794(null,_0x3ad8d7);},'afterCreate':function(_0x4874bb,_0xe1fc9b,_0x66f2f8){var _0x568502=_0x54e897[_0x99ef('0x14')];var _0x2280e6=_0x4874bb['get']({'plain':!![]});if(_0x2280e6['direction'][_0x99ef('0x15')]()==='in'||_0x2280e6['direction'][_0x99ef('0x15')]()===_0x99ef('0x16')&&!_0x2280e6[_0x99ef('0x17')]&&!_['isNil'](_0x2280e6[_0x99ef('0x18')])){_0x568502[_0x99ef('0x19')][_0x99ef('0x1a')]({'where':{'id':_0x2280e6[_0x99ef('0x1b')]}})[_0x99ef('0x1c')](function(_0xefc85a){if(_0xefc85a){_0xefc85a[_0x99ef('0x1d')]({'lastMsgAt':_0x2280e6['createdAt'],'lastMsgDirection':_0x2280e6[_0x99ef('0x1e')][_0x99ef('0x15')]()});}})[_0x99ef('0x1f')](function(_0xaa3d55){console[_0x99ef('0x20')](_0xaa3d55);});}_0x66f2f8();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file