Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
 public void Remove(RosterItem value)
 {
     List.Remove(value);
 }
Пример #4
0
 public int IndexOf(RosterItem value)
 {
     return (List.IndexOf(value));
 }
Пример #5
0
 public bool Contains(RosterItem value)
 {
     return (List.Contains(value));
 }
Пример #6
0
 public int Add(RosterItem value)
 {
     return (List.Add(value));
 }