Built motion from commit (unavailable).|2.5.4
[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 _0x1df4=['emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x3b3d63,_0x5b6997){var _0x553915=function(_0x507208){while(--_0x507208){_0x3b3d63['push'](_0x3b3d63['shift']());}};_0x553915(++_0x5b6997);}(_0x1df4,0x130));var _0x41df=function(_0x37313f,_0x4ffab4){_0x37313f=_0x37313f-0x0;var _0x4a127c=_0x1df4[_0x37313f];return _0x4a127c;};'use strict';var EventEmitter=require(_0x41df('0x0'));var MailAccount=require(_0x41df('0x1'))['db'][_0x41df('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x41df('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56dcb5){return function(_0x416eb1,_0x568c61,_0x21a7b0){MailAccountEvents[_0x41df('0x4')](_0x56dcb5+':'+_0x416eb1['id'],_0x416eb1);MailAccountEvents[_0x41df('0x4')](_0x56dcb5,_0x416eb1);_0x21a7b0(null);};}for(var e in events){if(events[_0x41df('0x5')](e)){var event=events[e];MailAccount[_0x41df('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents;