Built motion from commit 994c64e1.|2.6.1
[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 _0xcc58=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update','remove'];(function(_0x1738fe,_0x805230){var _0x72dd8e=function(_0x488fb5){while(--_0x488fb5){_0x1738fe['push'](_0x1738fe['shift']());}};_0x72dd8e(++_0x805230);}(_0xcc58,0xab));var _0x8cc5=function(_0x241084,_0x2124b7){_0x241084=_0x241084-0x0;var _0x50241f=_0xcc58[_0x241084];return _0x50241f;};'use strict';var EventEmitter=require(_0x8cc5('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8cc5('0x1')](0x0);var events={'afterCreate':_0x8cc5('0x2'),'afterUpdate':_0x8cc5('0x3'),'afterDestroy':_0x8cc5('0x4')};function emitEvent(_0x485b40){return function(_0x5b0fac,_0x19bf0c,_0x1fcb99){MailAccountEvents[_0x8cc5('0x5')](_0x485b40+':'+_0x5b0fac['id'],_0x5b0fac);MailAccountEvents[_0x8cc5('0x5')](_0x485b40,_0x5b0fac);_0x1fcb99(null);};}for(var e in events){if(events[_0x8cc5('0x6')](e)){var event=events[e];MailAccount[_0x8cc5('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents;