25c5863a56ecd8d67d2bd03dc297a9d4f7e00951
[motion2.git] / server / api / user / user.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 _0xf028=['update','emit','removeListener','register','save','remove'];(function(_0x33b264,_0x4e0f3c){var _0x53f154=function(_0x30b357){while(--_0x30b357){_0x33b264['push'](_0x33b264['shift']());}};_0x53f154(++_0x4e0f3c);}(_0xf028,0x154));var _0x8f02=function(_0x24f704,_0x45484d){_0x24f704=_0x24f704-0x0;var _0x3e69ed=_0xf028[_0x24f704];return _0x3e69ed;};'use strict';var UserEvents=require('./user.events');var events=[_0x8f02('0x0'),_0x8f02('0x1'),_0x8f02('0x2')];function createListener(_0x539842,_0x2b37c9){return function(_0x37b627){_0x2b37c9[_0x8f02('0x3')](_0x539842,_0x37b627);};}function removeListener(_0x2e9daa,_0x1a37d6){return function(){UserEvents[_0x8f02('0x4')](_0x2e9daa,_0x1a37d6);};}exports[_0x8f02('0x5')]=function(_0x306b41){for(var _0x239d41=0x0,_0x5fbc69=events['length'];_0x239d41<_0x5fbc69;_0x239d41++){var _0x3c9556=events[_0x239d41];var _0x128c9c=createListener('user:'+_0x3c9556,_0x306b41);UserEvents['on'](_0x3c9556,_0x128c9c);}};