/// <summary> /// Requests a new copy of the roster. /// </summary> public void GetRoster() { if (IsAuthenticated) { if (this.SupportNestedGroups && String.IsNullOrEmpty(this.NestedGroupDelimiter)) { PrivateIQ privIq = new PrivateIQ(this.Document); RosterDelimiter rosterDelim = new RosterDelimiter(privIq.OwnerDocument); privIq.Instruction.AddChild(rosterDelim); this.Write(privIq); } else { RosterIQ riq = new RosterIQ(this.Document); riq.Type = IQType.get; this.Write(riq); } } else { throw new InvalidOperationException("Client must be authenticated before getting roster."); } }
private void FireOnIQ(object sender, IQ iq) { // We know we're on the GUI thread. if (OnIQ != null) { OnIQ(this, iq); } if (this.SupportNestedGroups && !iq.Handled && iq.Query != null && iq.Type == IQType.result && iq.Query.NamespaceURI == URI.PRIVATE && iq.GetChildElement <Private>().GetChildElement <RosterDelimiter>() != null) { RosterDelimiter rosterDelimiter = iq.GetChildElement <Private>().GetChildElement <RosterDelimiter>(); if (String.IsNullOrEmpty(rosterDelimiter.InnerText)) { this.NestedGroupDelimiter = this.NestedGroupDefaultDelimiter; if (this.AutoStoreNestedGroupsDelimiter) { PrivateIQ privIq = new PrivateIQ(this.Document); RosterDelimiter rosterDelim = new RosterDelimiter(privIq.OwnerDocument); rosterDelim.InnerText = this.NestedGroupDelimiter; privIq.Instruction.AddChild(rosterDelim); privIq.Type = IQType.set; this.Write(privIq); } } else { this.NestedGroupDelimiter = rosterDelimiter.InnerText; } this.GetRoster(); } if (AutoIQErrors) { if (!iq.Handled && iq.HasAttribute("from") && // Belt. Suspenders. Don't respond to roster pushes. (iq.Type == IQType.get || iq.Type == IQType.set)) { Write(iq.GetErrorResponse(this.Document, Error.FEATURE_NOT_IMPLEMENTED)); } } }
private void FireOnIQ(object sender, IQ iq) { // We know we're on the GUI thread. if (OnIQ != null) OnIQ(this, iq); if (this.SupportNestedGroups && !iq.Handled && iq.Query != null && iq.Type == IQType.result && iq.Query.NamespaceURI == URI.PRIVATE && iq.GetChildElement<Private>().GetChildElement<RosterDelimiter>() != null) { RosterDelimiter rosterDelimiter = iq.GetChildElement<Private>().GetChildElement<RosterDelimiter>(); if (String.IsNullOrEmpty(rosterDelimiter.InnerText)) { this.NestedGroupDelimiter = this.NestedGroupDefaultDelimiter; if (this.AutoStoreNestedGroupsDelimiter) { PrivateIQ privIq = new PrivateIQ(this.Document); RosterDelimiter rosterDelim = new RosterDelimiter(privIq.OwnerDocument); rosterDelim.InnerText = this.NestedGroupDelimiter; privIq.Instruction.AddChild(rosterDelim); privIq.Type = IQType.set; this.Write(privIq); } } else { this.NestedGroupDelimiter = rosterDelimiter.InnerText; } this.GetRoster(); } if (AutoIQErrors) { if (!iq.Handled && iq.HasAttribute("from") && // Belt. Suspenders. Don't respond to roster pushes. (iq.Type == IQType.get || iq.Type == IQType.set)) { Write(iq.GetErrorResponse(this.Document, Error.FEATURE_NOT_IMPLEMENTED)); } } }
/// <summary> /// Requests a new copy of the roster. /// </summary> public void GetRoster() { if (IsAuthenticated) { if (this.SupportNestedGroups && String.IsNullOrEmpty(this.NestedGroupDelimiter)) { PrivateIQ privIq = new PrivateIQ(this.Document); RosterDelimiter rosterDelim = new RosterDelimiter(privIq.OwnerDocument); privIq.Instruction.AddChild(rosterDelim); this.Write(privIq); } else { RosterIQ riq = new RosterIQ(this.Document); riq.Type = IQType.get; this.Write(riq); } } else { throw new InvalidOperationException("Client must be authenticated before getting roster."); } }