Modify() private method

Add a participant to the list, indexed by full nick JID.
private Modify ( Presence pres, Modification &mod ) : RoomParticipant
pres Presence The latest presence
mod Modification Was this a JOIN, a LEAVE, or no change?
return RoomParticipant
Example #1
0
 private void GotList(object sender, IQ iq, object state)
 {
     RetrieveParticipantsState rps = (RetrieveParticipantsState)state;
     if (iq.Type == IQType.error)
     {
         rps.Callback(this, null, rps.State);
         return;
     }
     /*
     <iq from='*****@*****.**'
     id='ban2'
     to='[email protected]/throne'
     type='result'>
       <query xmlns='http://jabber.org/protocol/muc#admin'>
     <item affiliation='outcast'
       jid='*****@*****.**'>
       <reason>Treason</reason>
     </item>
       </query>
     </iq>
     */
     ParticipantCollection parties = new ParticipantCollection();
     AdminQuery query = (AdminQuery)iq.Query;
     ParticipantCollection.Modification mod;
     foreach (AdminItem item in query.GetItems())
     {
         Presence pres = new Presence(m_manager.Stream.Document);
         pres.From = new JID(m_jid.User, m_jid.Server, item.Nick);
         UserX x = new UserX(m_manager.Stream.Document);
         RoomItem xi = x.RoomItem;
         xi.Role = item.Role;
         xi.Affiliation = item.Affiliation;
         xi.Nick = item.Nick;
         xi.JID = item.JID;
         pres.AppendChild(x);
         parties.Modify(pres, out mod);
     }
     rps.Callback(this, parties, rps.State);
 }