xmppRoomBanUser()

This function allows you to ban a specified user (jid) from a chat room.

Synopsis

int xmppRoomBanUser( int clientId, string room, string jid [, string reason]);

Parameter

Parameter Description
clientid The unique client id for the client channel. The id is returned by the xmppOpen() function.
room The room (name ) whose user is banned.("roomname@conference.jabber.at")
jid

Jabber ID of a user such as winccoa.etm@jabber.at.

The jid can be specified with or without a resource. E.g.

winccoa.etm@jabber.at (addressing this user on any resource) or

winccoa.etm@jabber.at/mobile (only addressing this specific resource)

reason The reason why a user is banned.

Return Value

Returns 0 when the function was successfully executed or -1 in case of errors

Errors

Errors can be queried via getLastError().

Description

This function allows you to ban a specified user (jid) from a chat room.

The following example shows how to ban a user from a chat room.

Anmerkung: You have to replace the code: p = xmppOpen("winccoa.etm@jabber.at","123677", "callback", m); DebugN("xmppOpen:", p); by your own user and password. This code is an example!
Anmerkung: Note also that in order to ban a user, the user has join the chat room first.
#uses "CtrlXmpp"
int p;
main(mapping event)
{
  p = xmppOpen("winccoa.etm@jabber.at","123677");
  DebugN("xmppOpen:", p);
  int s = xmppRoomJoin(p,"testraum@conference.jabber.at", "WinCCOA");
  DebugN("Joined the room:", s);
  DebugN("User banned:", xmppRoomBanUser(p, "testraum@conference.jabber.at", "winccoa.etm@jabber.at", "Ban you"));
}

Assignment

XMPP functions

Availability

CTRL