/// <summary> /// Updates the contact data. /// </summary> public void Update() { IQ iq = new IQ(); RosterQuery query = new RosterQuery(); RosterItem item = new RosterItem(); iq.Type = IQType.Set; item.Jid = this.ContactId.BareIdentifier; item.Name = this.DisplayName; item.Subscription = (RosterSubscriptionType)this.Subscription; item.Groups.AddRange(this.Groups); query.Items.Add(item); iq.Items.Add(query); this.session.Send(iq); }
/// <summary> /// Adds to group. /// </summary> /// <param name="groupName">Name of the group.</param> public void AddToGroup(string groupName) { IQ iq = new IQ(); RosterQuery query = new RosterQuery(); RosterItem item = new RosterItem(); if (!this.Groups.Contains(groupName)) { this.Groups.Add(groupName); } iq.Type = IQType.Set; item.Jid = this.ContactId.BareIdentifier; item.Name = this.Name; item.Subscription = (RosterSubscriptionType)this.Subscription; item.Groups.Add(groupName); query.Items.Add(item); iq.Items.Add(query); this.session.Send(iq); }
public void Remove(RosterItem value) { List.Remove(value); }
public int IndexOf(RosterItem value) { return (List.IndexOf(value)); }
public bool Contains(RosterItem value) { return (List.Contains(value)); }
public int Add(RosterItem value) { return (List.Add(value)); }