Built motion from commit (unavailable).|2.5.25
[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 _0x064d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x571ba3,_0x2315f5){var _0x2bd1b4=function(_0x15d6d4){while(--_0x15d6d4){_0x571ba3['push'](_0x571ba3['shift']());}};_0x2bd1b4(++_0x2315f5);}(_0x064d,0x113));var _0xd064=function(_0x25910b,_0x51fe8a){_0x25910b=_0x25910b-0x0;var _0x240787=_0x064d[_0x25910b];return _0x240787;};'use strict';var EventEmitter=require(_0xd064('0x0'));var MailAccount=require(_0xd064('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd064('0x2')](0x0);var events={'afterCreate':_0xd064('0x3'),'afterUpdate':_0xd064('0x4'),'afterDestroy':_0xd064('0x5')};function emitEvent(_0x4fea9c){return function(_0x480f56,_0x471880,_0x4dfc58){MailAccountEvents[_0xd064('0x6')](_0x4fea9c+':'+_0x480f56['id'],_0x480f56);MailAccountEvents[_0xd064('0x6')](_0x4fea9c,_0x480f56);_0x4dfc58(null);};}for(var e in events){if(events[_0xd064('0x7')](e)){var event=events[e];MailAccount[_0xd064('0x8')](e,emitEvent(event));}}module[_0xd064('0x9')]=MailAccountEvents;