/// <summary> /// Retrieve all of the parties with a given role. /// Modify the affiliations of persons in this list, then call ModifyRoles /// </summary> /// <param name="role">The role to search for</param> /// <param name="callback">A callback to receive the participant list</param> /// <param name="state">Caller state information</param> public void RetrieveListByRole(RoomRole role, RoomParticipantsEvent callback, object state) { if (callback == null) throw new ArgumentNullException("callback"); /* <iq from='[email protected]/globe' id='voice3' to='*****@*****.**' type='get'> <query xmlns='http://jabber.org/protocol/muc#admin'> <item role='participant'/> </query> </iq> */ RoomAdminIQ iq = new RoomAdminIQ(m_manager.Stream.Document); iq.To = m_room; AdminQuery query = iq.Instruction; query.AddItem().Role = role; m_manager.BeginIQ(iq, new IqCB(GotList), new RetrieveParticipantsState(callback, state)); }
/// <summary> /// Retrieve all of the parties with a given affiliiation. /// Modify the affiliations of persons in this list, then call ModifyAffiliations /// </summary> /// <param name="affiliation">The affiliation to search for</param> /// <param name="callback">A callback to receive the participant list</param> /// <param name="state">Caller state information</param> public void RetrieveListByAffiliation(RoomAffiliation affiliation, RoomParticipantsEvent callback, object state) { if (callback == null) throw new ArgumentNullException("callback"); /* <iq from='[email protected]/throne' id='ban2' to='*****@*****.**' type='get'> <query xmlns='http://jabber.org/protocol/muc#admin'> <item affiliation='outcast'/> </query> </iq> */ RoomAdminIQ iq = new RoomAdminIQ(m_manager.Stream.Document); iq.To = m_room; AdminQuery query = iq.Instruction; query.AddItem().Affiliation = affiliation; m_manager.BeginIQ(iq, new IqCB(GotList), new RetrieveParticipantsState(callback, state)); }
public RetrieveParticipantsState(RoomParticipantsEvent callback, object state) { this.Callback = callback; this.State = state; }