Built motion from commit (unavailable).|2.4.17
[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 _0x228d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','update','remove'];(function(_0x33fab6,_0x532a04){var _0x314e60=function(_0x56e5d6){while(--_0x56e5d6){_0x33fab6['push'](_0x33fab6['shift']());}};_0x314e60(++_0x532a04);}(_0x228d,0xfe));var _0xd228=function(_0x32f9e6,_0x55ed80){_0x32f9e6=_0x32f9e6-0x0;var _0x11a5ea=_0x228d[_0x32f9e6];return _0x11a5ea;};'use strict';var EventEmitter=require(_0xd228('0x0'));var MailAccount=require(_0xd228('0x1'))['db'][_0xd228('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd228('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd228('0x4'),'afterDestroy':_0xd228('0x5')};function emitEvent(_0xa06a3f){return function(_0x560ad1,_0x42172b,_0x2c9e33){MailAccountEvents[_0xd228('0x6')](_0xa06a3f+':'+_0x560ad1['id'],_0x560ad1);MailAccountEvents[_0xd228('0x6')](_0xa06a3f,_0x560ad1);_0x2c9e33(null);};}for(var e in events){if(events[_0xd228('0x7')](e)){var event=events[e];MailAccount[_0xd228('0x8')](e,emitEvent(event));}}module[_0xd228('0x9')]=MailAccountEvents;