Built motion from commit (unavailable).|2.5.26
[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 _0x5f83=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x102f4c,_0x58899b){var _0x5942e2=function(_0x2acb45){while(--_0x2acb45){_0x102f4c['push'](_0x102f4c['shift']());}};_0x5942e2(++_0x58899b);}(_0x5f83,0x8f));var _0x35f8=function(_0x4fcc08,_0x502069){_0x4fcc08=_0x4fcc08-0x0;var _0x3c32ab=_0x5f83[_0x4fcc08];return _0x3c32ab;};'use strict';var EventEmitter=require(_0x35f8('0x0'));var MailAccount=require(_0x35f8('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x35f8('0x2')](0x0);var events={'afterCreate':_0x35f8('0x3'),'afterUpdate':_0x35f8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1943e2){return function(_0x1d2ecf,_0x452604,_0x5296da){MailAccountEvents[_0x35f8('0x5')](_0x1943e2+':'+_0x1d2ecf['id'],_0x1d2ecf);MailAccountEvents['emit'](_0x1943e2,_0x1d2ecf);_0x5296da(null);};}for(var e in events){if(events[_0x35f8('0x6')](e)){var event=events[e];MailAccount[_0x35f8('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents;