C# Class jabber.connection.Room

Show file Open project: codebutler/jabber-net Class Usage Examples

Private Properties

Property Type Description
ConfigForm void
Configured void
FinishConfigDefault void
GotList void
OnJoinPresence void
OnLeavePresence void
Room System
m_stream_OnAfterPresenceOut void
m_stream_OnDisconect void
m_stream_OnProtocol void

Public Methods

Method Description
Ban ( JID jid, string reason ) : void

Ban a user from re-joining the room. Must be an admin.

ChangeAffiliation ( JID jid, RoomAffiliation affiliation, string reason ) : void

Change the affiliation (long-term) with the room of a user, based on their real JID.

ChangeRole ( string nick, RoomRole role, string reason ) : void

Change the role of a user in the room, by nickname. Must be a moderator.

Configure ( ) : void

Configures the room. OnRoomConfig MUST be set first. OnRoomConfig will be called back in the GUI thread if there is an InvokeControl on your XmppStream. Make sure that OnRoomConfig does not return until it has the answer, typically by popping up a modal dialog with the x:data form.

GrantMembership ( JID jid, string reason ) : void

Make this user a member of the room.

GrantVoice ( string nick, string reason ) : void

Un-mute a muted user. Give them "voice".

Invite ( JID invitee, string reason ) : void

Invite a user to join the room.

Join ( ) : void

Joins the room. If the room is created, Configure() will be called automatically.

Join ( string password ) : void

Join a room, using a password.

Kick ( string nick, string reason ) : void

Kick the given user from the room, based on their nickname.

Leave ( string reason ) : void

Exits the room. This cleans up the entry in the ConferenceManager, as well.

MakeModerator ( string nick ) : void

Make this user a moderator of the room.

ModifyAffiliations ( ParticipantCollection parties, string reason, IqCB callback, object state ) : void

Modify the roles of the parties in this list. To use, retrive a ParticipantCollection, change the roles of the parties in that collection, then pass that modified collection in here.

ModifyRoles ( ParticipantCollection parties, string reason, IqCB callback, object state ) : void

Modify the roles of the parties in this list. To use, retrive a ParticipantCollection, change the roles of the parties in that collection, then pass that modified collection in here.

PrivateMessage ( string nick, string body ) : void

Sends a private message to a single user in the room.

PublicMessage ( string body ) : void

Sends a message to everyone currently in the room.

RetrieveListByAffiliation ( RoomAffiliation affiliation, RoomParticipantsEvent callback, object state ) : void

Retrieve all of the parties with a given affiliiation. Modify the affiliations of persons in this list, then call ModifyAffiliations

RetrieveListByRole ( RoomRole role, RoomParticipantsEvent callback, object state ) : void

Retrieve all of the parties with a given role. Modify the affiliations of persons in this list, then call ModifyRoles

RevokeMembership ( JID jid, string reason ) : void

Remove the membership privileges of the given user

RevokeVoice ( string nick, string reason ) : void

Disallow a user from speaking; remove their "voice".

Private Methods

Method Description
ConfigForm ( object sender, IQ iq, object context ) : void
Configured ( object sender, IQ iq, object context ) : void
FinishConfigDefault ( ) : void

Finish up configuration, taking the default room config. Also known as an "Instant Room". Suitable for use if the user cancels the configuration request, perhaps.

GotList ( object sender, IQ iq, object state ) : void
OnJoinPresence ( Presence p ) : void
OnLeavePresence ( Presence p ) : void
Room ( ConferenceManager manager, JID roomAndNick ) : System

Create.

m_stream_OnAfterPresenceOut ( object sender, Presence pres ) : void

Whenver we change presence, send the new presence to the room, including caps etc.

m_stream_OnDisconect ( object sender ) : void
m_stream_OnProtocol ( object sender, System rp ) : void

Method Details

Ban() public method

Ban a user from re-joining the room. Must be an admin.
public Ban ( JID jid, string reason ) : void
jid JID The bare JID of the user to ban
reason string The reason for the shunning
return void

ChangeAffiliation() public method

Change the affiliation (long-term) with the room of a user, based on their real JID.
public ChangeAffiliation ( JID jid, RoomAffiliation affiliation, string reason ) : void
jid JID The bare JID of the user of which to change the affiliation
affiliation RoomAffiliation The new affiliation
reason string The reason for the change
return void

ChangeRole() public method

Change the role of a user in the room, by nickname. Must be a moderator.
public ChangeRole ( string nick, RoomRole role, string reason ) : void
nick string The nickname of the user to modify.
role RoomRole The new role
reason string The reason for the change
return void

Configure() public method

Configures the room. OnRoomConfig MUST be set first. OnRoomConfig will be called back in the GUI thread if there is an InvokeControl on your XmppStream. Make sure that OnRoomConfig does not return until it has the answer, typically by popping up a modal dialog with the x:data form.
public Configure ( ) : void
return void

GrantMembership() public method

Make this user a member of the room.
public GrantMembership ( JID jid, string reason ) : void
jid JID The bare jid of the user to grant membership to.
reason string
return void

GrantVoice() public method

Un-mute a muted user. Give them "voice".
public GrantVoice ( string nick, string reason ) : void
nick string The nicname of the person to unmute
reason string The reason for the change
return void

Invite() public method

Invite a user to join the room.
public Invite ( JID invitee, string reason ) : void
invitee JID The JID of the person to invite
reason string The reason for the invite, or null for none.
return void

Join() public method

Joins the room. If the room is created, Configure() will be called automatically.
public Join ( ) : void
return void

Join() public method

Join a room, using a password.
public Join ( string password ) : void
password string
return void

Kick() public method

Kick the given user from the room, based on their nickname.
public Kick ( string nick, string reason ) : void
nick string The nickname of the person to kick
reason string The reason for kicking, or null for none.
return void

Leave() public method

Exits the room. This cleans up the entry in the ConferenceManager, as well.
public Leave ( string reason ) : void
reason string Reason for leaving the room. May be null for no reason.
return void

MakeModerator() public method

Make this user a moderator of the room.
public MakeModerator ( string nick ) : void
nick string The nickname of the user to change
return void

ModifyAffiliations() public method

Modify the roles of the parties in this list. To use, retrive a ParticipantCollection, change the roles of the parties in that collection, then pass that modified collection in here.
public ModifyAffiliations ( ParticipantCollection parties, string reason, IqCB callback, object state ) : void
parties ParticipantCollection The modified participant collection
reason string The reason for the change
callback IqCB A callback to call when complete. Will have a null IQ if there were no changes to make.
state object Caller's state information
return void

ModifyRoles() public method

Modify the roles of the parties in this list. To use, retrive a ParticipantCollection, change the roles of the parties in that collection, then pass that modified collection in here.
public ModifyRoles ( ParticipantCollection parties, string reason, IqCB callback, object state ) : void
parties ParticipantCollection The modified participant collection
reason string The reason for the change
callback IqCB A callback to call when complete. Will have a null IQ if there were no changes to make.
state object Caller's state information
return void

PrivateMessage() public method

Sends a private message to a single user in the room.
public PrivateMessage ( string nick, string body ) : void
nick string The nickname of the user to send a private message to.
body string The message body to send.
return void

PublicMessage() public method

Sends a message to everyone currently in the room.
public PublicMessage ( string body ) : void
body string The message text to send.
return void

RetrieveListByAffiliation() public method

Retrieve all of the parties with a given affiliiation. Modify the affiliations of persons in this list, then call ModifyAffiliations
public RetrieveListByAffiliation ( RoomAffiliation affiliation, RoomParticipantsEvent callback, object state ) : void
affiliation RoomAffiliation The affiliation to search for
callback RoomParticipantsEvent A callback to receive the participant list
state object Caller state information
return void

RetrieveListByRole() public method

Retrieve all of the parties with a given role. Modify the affiliations of persons in this list, then call ModifyRoles
public RetrieveListByRole ( RoomRole role, RoomParticipantsEvent callback, object state ) : void
role RoomRole The role to search for
callback RoomParticipantsEvent A callback to receive the participant list
state object Caller state information
return void

RevokeMembership() public method

Remove the membership privileges of the given user
public RevokeMembership ( JID jid, string reason ) : void
jid JID The bare jid of the user to revoke the membership of.
reason string
return void

RevokeVoice() public method

Disallow a user from speaking; remove their "voice".
public RevokeVoice ( string nick, string reason ) : void
nick string The nickname of the person to mute
reason string The reason for the muting
return void