# HG changeset patch # User Matthew Wild # Date 1270470225 -3600 # Node ID a3febc43e4e97b656d6ce772270408e05c355aa7 # Parent 815816ceb1adbcca52d85731ee9aa0589c1e8b8a Changes to work with new callback syntax diff -r 815816ceb1ad -r a3febc43e4e9 src/js/supportchat.js --- a/src/js/supportchat.js Mon Apr 05 13:18:24 2010 +0100 +++ b/src/js/supportchat.js Mon Apr 05 13:23:45 2010 +0100 @@ -76,15 +76,15 @@ // Create our question room var question_muc = new MUC(conn, { // Handle room joins - joined: function (stanza, muc, nick) + joined: function (stanza, muc, occupant) { - if(nick == our_nick) + if(occupant.nick == our_nick) // We joined the question room, now join the team room and tell them team_muc.join(support_config.team_rooms[question_type], our_nick); else if(ui_state == "wait") { // We were waiting for an assistant, and one just joined - var html = "" + htmlescape(nick) + "" + " is answering your query
\n"; + var html = "" + htmlescape(occupant.nick) + "" + " is answering your query
\n"; $("#support-log").append(html).scrollTop($("#support-log")[0].scrollHeight); $("#support-send-button").click(function () { @@ -120,18 +120,15 @@ // Create the team MUC object (it will be joined after we join the question MUC) var team_muc = new MUC(conn, { // Someone joined the team MUC - joined: function (stanza, muc, nick) + joined: function (stanza, muc, occupant) { - if(nick != our_nick) + if(occupant.nick != our_nick) return; var sent = false; for(var nick in team_muc.occupants) { - var affiliation = $(stanza) - .find("x[xmlns='http://jabber.org/protocol/muc#user']>item") - .attr("affiliation"); - if(affiliation == "none" || nick == our_nick) + if(team_muc.occupants[nick].affiliation == "none" || nick == our_nick) continue; sent = true; if(support_config.send_invites)