Built motion from commit 857c5af.|0.0.124
[motion.git] / server / api / report_agent / report_agent.socket.js
index f6d496d..a038542 100644 (file)
@@ -1,50 +1 @@
-/**
- * Broadcast updates to client when the model changes
- */
-
-'use strict';
-
-var ReportAgent = require('../../models').ReportAgent;
-
-exports.register = function(socket) {
-  ReportAgent.afterCreate(function(doc) {
-    onSave(socket, doc);
-  });
-  ReportAgent.afterUpdate(function(doc) {
-    onSave(socket, doc);
-  });
-  ReportAgent.afterDestroy(function(doc) {
-    onRemove(socket, doc);
-  });
-}
-
-function onSave(socket, doc, cb) {
-  // socket.emit('report_agent:save', {
-  //   id: doc.id,
-  //   uniqueid: doc.uniqueid,
-  //   calleridnum: doc.callerinum,
-  //   calleridname: doc.calleridname,
-  //   queue: doc.queue,
-  //   interface: doc.interface,
-  //   membername: doc.membername,
-  //   agentcalledAt: doc.agentcalledAt,
-  //   agentconnectAt: doc.agentconnectAt,
-  //   holdtime: doc.holdtime,
-  //   agentcomplete: doc.agentcomplete,
-  //   agentcompleteAt: doc.agentcompleteAt,
-  //   talktime: doc.talktime,
-  //   agentacw: doc.agentacw,
-  //   acwtime: doc.acwtime,
-  //   agentringnoanswer: doc.agentringnoanswer,
-  //   agentringnoanswerAt: doc.agentringnoanswerAt,
-  //   lastevent: doc.lastevent
-  // });
-  if (socket.name === doc.membername || socket.role === 'admin') {
-    socket.emit('report_agent:save', doc);
-  }
-
-}
-
-function onRemove(socket, doc, cb) {
-  socket.emit('report_agent:remove', doc);
-}
+var _0x1a82=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x2E\x2F\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x2E\x65\x76\x65\x6E\x74\x73","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65","\x72\x65\x67\x69\x73\x74\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A","\x6F\x6E","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x6E\x61\x6D\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x72\x6F\x6C\x65","\x61\x64\x6D\x69\x6E","\x65\x6D\x69\x74","\x72\x65\x6D\x6F\x76\x65\x4C\x69\x73\x74\x65\x6E\x65\x72"];_0x1a82[0];const ReportAgentEvents=require(_0x1a82[1]);var events=[_0x1a82[2],_0x1a82[3]];exports[_0x1a82[4]]= function(_0x9f54x3){for(var _0x9f54x4=0,_0x9f54x5=events[_0x1a82[5]];_0x9f54x4< _0x9f54x5;_0x9f54x4++){var _0x9f54x6=events[_0x9f54x4];var _0x9f54x7=createListener(_0x1a82[6]+ _0x9f54x6,_0x9f54x3);ReportAgentEvents[_0x1a82[7]](_0x9f54x6,_0x9f54x7);_0x9f54x3[_0x1a82[7]](_0x1a82[8],removeListener(_0x9f54x6,_0x9f54x7))}};function createListener(_0x9f54x6,_0x9f54x3){return function(_0x9f54x9){if(_0x9f54x3[_0x1a82[9]]=== _0x9f54x9[_0x1a82[10]]|| _0x9f54x3[_0x1a82[11]]=== _0x1a82[12]){_0x9f54x3[_0x1a82[13]](_0x9f54x6,_0x9f54x9)}}}function removeListener(_0x9f54x6,_0x9f54x7){return function(){ReportAgentEvents[_0x1a82[14]](_0x9f54x6,_0x9f54x7)}}
\ No newline at end of file