Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / mailAccount / mailAccount.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 _0xc55e=['hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit'];(function(_0x4baac8,_0x5f1dc7){var _0x56ebc5=function(_0x23d717){while(--_0x23d717){_0x4baac8['push'](_0x4baac8['shift']());}};_0x56ebc5(++_0x5f1dc7);}(_0xc55e,0x146));var _0xec55=function(_0x1d5164,_0x4de06e){_0x1d5164=_0x1d5164-0x0;var _0x2428de=_0xc55e[_0x1d5164];return _0x2428de;};'use strict';var EventEmitter=require(_0xec55('0x0'));var MailAccount=require(_0xec55('0x1'))['db'][_0xec55('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xec55('0x3')](0x0);var events={'afterCreate':_0xec55('0x4'),'afterUpdate':'update','afterDestroy':_0xec55('0x5')};function emitEvent(_0x1f2bc5){return function(_0x35cd14,_0xdcb93,_0x3b7b45){MailAccountEvents['emit'](_0x1f2bc5+':'+_0x35cd14['id'],_0x35cd14);MailAccountEvents[_0xec55('0x6')](_0x1f2bc5,_0x35cd14);_0x3b7b45(null);};}for(var e in events){if(events[_0xec55('0x7')](e)){var event=events[e];MailAccount[_0xec55('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents;