//>>built
define("dojox/xmpp/UserService",["dijit","dojo","dojox"],function(k,g,d){g.provide("dojox.xmpp.UserService");g.declare("dojox.xmpp.UserService",null,{constructor:function(a){this.session=a},getPersonalProfile:function(){var a={id:this.session.getNextIqId(),type:"get"},c=new d.string.Builder(d.xmpp.util.createElement("iq",a,!1));c.append(d.xmpp.util.createElement("query",{xmlns:"jabber:iq:private"},!1));c.append(d.xmpp.util.createElement("sunmsgr",{xmlsns:"sun:xmpp:properties"},!0));c.append("\x3c/query\x3e\x3c/iq\x3e");
this.session.dispatchPacket(c.toString(),"iq",a.id).addCallback(this,"_onGetPersonalProfile")},setPersonalProfile:function(a){var c={id:this.session.getNextIqId(),type:"set"},b=new d.string.Builder(d.xmpp.util.createElement("iq",c,!1));b.append(d.xmpp.util.createElement("query",{xmlns:"jabber:iq:private"},!1));b.append(d.xmpp.util.createElement("sunmsgr",{xmlsns:"sun:xmpp:properties"},!1));for(var e in a)b.append(d.xmpp.util.createElement("property",{name:e},!1)),b.append(d.xmpp.util.createElement("value",
{},!1)),b.append(a[e]),b.append("\x3c/value\x3e\x3c/props\x3e");b.append("\x3c/sunmsgr\x3e\x3c/query\x3e\x3c/iq\x3e");this.session.dispatchPacket(b.toString(),"iq",c.id).addCallback(this,"_onSetPersonalProfile")},_onSetPersonalProfile:function(a){if("result"==a.getAttribute("type"))this.onSetPersonalProfile(a.getAttribute("id"));else"error"==a.getAttribute("type")&&(a=this.session.processXmppError(a),this.onSetPersonalProfileFailure(a))},onSetPersonalProfile:function(a){},onSetPersonalProfileFailure:function(a){},
_onGetPersonalProfile:function(a){if("result"==a.getAttribute("type")){var c={};if(a.hasChildNodes()){var b=a.firstChild;if("query"==b.nodeName&&"jabber:iq:private"==b.getAttribute("xmlns")&&(b=b.firstChild,"query"==b.nodeName&&"sun:xmpp:properties"==b.getAttributes("xmlns")))for(var e=0;e<b.childNodes.length;e++){var f=b.childNodes[e];if("property"==f.nodeName){var h=f.getAttribute("name");c[h]=f.firstChild||""}}this.onGetPersonalProfile(c)}}else"error"==a.getAttribute("type")&&(c=this.session.processXmppError(a),
this.onGetPersonalProfileFailure(c));return a},onGetPersonalProfile:function(a){},onGetPersonalProfileFailure:function(a){}})});