Built motion from commit (unavailable).|2.5.30
[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 _0xa6b1=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','update'];(function(_0x413895,_0x2a6a61){var _0x24b8a9=function(_0x47be85){while(--_0x47be85){_0x413895['push'](_0x413895['shift']());}};_0x24b8a9(++_0x2a6a61);}(_0xa6b1,0x125));var _0x1a6b=function(_0x129fb1,_0x597109){_0x129fb1=_0x129fb1-0x0;var _0x61f3c5=_0xa6b1[_0x129fb1];return _0x61f3c5;};'use strict';var EventEmitter=require(_0x1a6b('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1a6b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a6b('0x2'),'afterDestroy':_0x1a6b('0x3')};function emitEvent(_0x104043){return function(_0x20a18e,_0x50a4b7,_0x5dd9cb){MailAccountEvents[_0x1a6b('0x4')](_0x104043+':'+_0x20a18e['id'],_0x20a18e);MailAccountEvents['emit'](_0x104043,_0x20a18e);_0x5dd9cb(null);};}for(var e in events){if(events[_0x1a6b('0x5')](e)){var event=events[e];MailAccount[_0x1a6b('0x6')](e,emitEvent(event));}}module[_0x1a6b('0x7')]=MailAccountEvents;