Built motion from commit (unavailable).|2.6.0
[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 _0xc884=['save','update','emit','hasOwnProperty','hook','../../mysqldb','MailAccount'];(function(_0x3d83b9,_0x5da92b){var _0x47a7f7=function(_0x125748){while(--_0x125748){_0x3d83b9['push'](_0x3d83b9['shift']());}};_0x47a7f7(++_0x5da92b);}(_0xc884,0x1a2));var _0x4c88=function(_0x44b4e8,_0x39eed7){_0x44b4e8=_0x44b4e8-0x0;var _0xed3344=_0xc884[_0x44b4e8];return _0xed3344;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4c88('0x0'))['db'][_0x4c88('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c88('0x2'),'afterUpdate':_0x4c88('0x3'),'afterDestroy':'remove'};function emitEvent(_0x114cdb){return function(_0x411a13,_0xfab80c,_0x52bfd3){MailAccountEvents[_0x4c88('0x4')](_0x114cdb+':'+_0x411a13['id'],_0x411a13);MailAccountEvents['emit'](_0x114cdb,_0x411a13);_0x52bfd3(null);};}for(var e in events){if(events[_0x4c88('0x5')](e)){var event=events[e];MailAccount[_0x4c88('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents;