Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / mailMessage / mailMessage.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xab9c=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','update'];(function(_0x22de21,_0x3b12b9){var _0x340e76=function(_0x2f69bd){while(--_0x2f69bd){_0x22de21['push'](_0x22de21['shift']());}};_0x340e76(++_0x3b12b9);}(_0xab9c,0x1f3));var _0xcab9=function(_0x1ea12f,_0x4a3d19){_0x1ea12f=_0x1ea12f-0x0;var _0x3ffb04=_0xab9c[_0x1ea12f];return _0x3ffb04;};'use strict';var EventEmitter=require(_0xcab9('0x0'));var MailMessage=require(_0xcab9('0x1'))['db'][_0xcab9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcab9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcab9('0x4'),'afterDestroy':_0xcab9('0x5')};function emitEvent(_0x251fc7){return function(_0x505156,_0x274cb7,_0x9ea715){MailMessageEvents['emit'](_0x251fc7+':'+_0x505156['id'],_0x505156);MailMessageEvents[_0xcab9('0x6')](_0x251fc7,_0x505156);_0x9ea715(null);};}for(var e in events){if(events[_0xcab9('0x7')](e)){var event=events[e];MailMessage[_0xcab9('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents;