Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / smsAccount / smsAccount.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 _0xf89b=['hook','exports','SmsAccount','setMaxListeners','save','update','emit'];(function(_0x451ffe,_0x3ccabd){var _0x200801=function(_0x1ae7b1){while(--_0x1ae7b1){_0x451ffe['push'](_0x451ffe['shift']());}};_0x200801(++_0x3ccabd);}(_0xf89b,0x11a));var _0xbf89=function(_0xc17d7f,_0x5e66fd){_0xc17d7f=_0xc17d7f-0x0;var _0x44c2e7=_0xf89b[_0xc17d7f];return _0x44c2e7;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xbf89('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xbf89('0x1')](0x0);var events={'afterCreate':_0xbf89('0x2'),'afterUpdate':_0xbf89('0x3'),'afterDestroy':'remove'};function emitEvent(_0x47edc9){return function(_0x47e0eb,_0x57e8d5,_0x5c600d){SmsAccountEvents[_0xbf89('0x4')](_0x47edc9+':'+_0x47e0eb['id'],_0x47e0eb);SmsAccountEvents[_0xbf89('0x4')](_0x47edc9,_0x47e0eb);_0x5c600d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xbf89('0x5')](e,emitEvent(event));}}module[_0xbf89('0x6')]=SmsAccountEvents;