d254e799f33dc814fda617bc71a470fa003b5a94
[motion2.git] / server / api / plugin / plugin.socket.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 _0x1dbd=['length','plugin:','removeListener','register'];(function(_0x5013cb,_0x55ca23){var _0x7f06b3=function(_0x468428){while(--_0x468428){_0x5013cb['push'](_0x5013cb['shift']());}};_0x7f06b3(++_0x55ca23);}(_0x1dbd,0x15a));var _0xd1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbd[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove','update'];function createListener(_0x472dc5,_0x408463){return function(_0x30fc47){_0x408463['emit'](_0x472dc5,_0x30fc47);};}function removeListener(_0xd3c25c,_0x44a441){return function(){PluginEvents[_0xd1db('0x0')](_0xd3c25c,_0x44a441);};}exports[_0xd1db('0x1')]=function(_0x37d507){for(var _0x3c359b=0x0,_0x4ec41c=events[_0xd1db('0x2')];_0x3c359b<_0x4ec41c;_0x3c359b++){var _0x53c0b0=events[_0x3c359b];var _0x2d86fa=createListener(_0xd1db('0x3')+_0x53c0b0,_0x37d507);PluginEvents['on'](_0x53c0b0,_0x2d86fa);}};