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