Built motion from commit (unavailable).|2.0.70
[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 _0x3cb6=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','MailAccount'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x3cb6,0x166));var _0x63cb=function(_0x53eb1d,_0x22599f){_0x53eb1d=_0x53eb1d-0x0;var _0xddaf10=_0x3cb6[_0x53eb1d];return _0xddaf10;};'use strict';var EventEmitter=require(_0x63cb('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x63cb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x63cb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x63cb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35d85e){return function(_0x3033ec,_0x2a56e6,_0x7fe296){MailAccountEvents[_0x63cb('0x4')](_0x35d85e+':'+_0x3033ec['id'],_0x3033ec);MailAccountEvents[_0x63cb('0x4')](_0x35d85e,_0x3033ec);_0x7fe296(null);};}for(var e in events){if(events[_0x63cb('0x5')](e)){var event=events[e];MailAccount[_0x63cb('0x6')](e,emitEvent(event));}}module[_0x63cb('0x7')]=MailAccountEvents;