Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * When a new topic is added under the path /chat/chatsessions/,
- * the addUser callback is called to add a representation of the
- * chat session to the agent interface.
- */
- var registerTopicListener = function (session){
- var listener = {
- onDescendantNotification: function() {},
- onTopicNotification: function(topicPath, topicSpecification, type) {
- addUser(topicPath);
- },
- onClose: function() {},
- onError: function(error) {}
- };
- session.notifications.addListener(listener).then(function(reg) {
- reg.select("*chat/chatsessions/");
- });
- return session;
- }
Add Comment
Please, Sign In to add comment