42286496c799925e5834387fd9e2ef87b5dafbb6
[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 _0x95c4=['remove','removeListener','length','./user.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95c4,0x1ca));var _0x495c=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x95c4[_0x4e9d3c];return _0x2d0825;};'use strict';var UserEvents=require(_0x495c('0x0'));var events=[_0x495c('0x1'),_0x495c('0x2'),'update'];function createListener(_0x19a6cc,_0xa98668){return function(_0x3eee13){_0xa98668['emit'](_0x19a6cc,_0x3eee13);};}function removeListener(_0x1ac8ae,_0x116fcc){return function(){UserEvents[_0x495c('0x3')](_0x1ac8ae,_0x116fcc);};}exports['register']=function(_0x50fdb2){for(var _0x21d92f=0x0,_0x1ffdd9=events[_0x495c('0x4')];_0x21d92f<_0x1ffdd9;_0x21d92f++){var _0x3a1384=events[_0x21d92f];var _0x20b68c=createListener('user:'+_0x3a1384,_0x50fdb2);UserEvents['on'](_0x3a1384,_0x20b68c);}};