Built motion from commit (unavailable).|2.5.2
[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 _0xed54=['../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x10f8a3,_0x2504d8){var _0x31b878=function(_0x2d0dd9){while(--_0x2d0dd9){_0x10f8a3['push'](_0x10f8a3['shift']());}};_0x31b878(++_0x2504d8);}(_0xed54,0xfc));var _0x4ed5=function(_0x293272,_0x1e0007){_0x293272=_0x293272-0x0;var _0xf15ef=_0xed54[_0x293272];return _0xf15ef;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4ed5('0x0'))['db'][_0x4ed5('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4ed5('0x2')](0x0);var events={'afterCreate':_0x4ed5('0x3'),'afterUpdate':'update','afterDestroy':_0x4ed5('0x4')};function emitEvent(_0x39d4d7){return function(_0x5f4777,_0x5c6d8b,_0xf1fb13){MailAccountEvents[_0x4ed5('0x5')](_0x39d4d7+':'+_0x5f4777['id'],_0x5f4777);MailAccountEvents[_0x4ed5('0x5')](_0x39d4d7,_0x5f4777);_0xf1fb13(null);};}for(var e in events){if(events[_0x4ed5('0x6')](e)){var event=events[e];MailAccount[_0x4ed5('0x7')](e,emitEvent(event));}}module[_0x4ed5('0x8')]=MailAccountEvents;