58c0880a40fd211edf59b0d4c122d0b778949021
[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 _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','emit'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var MailAccount=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){MailAccountEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);MailAccountEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];MailAccount[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=MailAccountEvents;