xmppRoomLeave()

This function allows you to leave a chat room.

Synopsis

int xmppRoomLeave(int clientId, string room [, string message]);

Parameter

Parameter Description
clientid The unique client id for the client channel. The id is returned by the xmppOpen() function.
room The room (name ) that is left.
message The message why the room was left.

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 leave a chat room.

The following example allows the user winccoa.etm to leave a chat room.

Anmerkung: In order to leave a chat room, the user has join the chat room first.
#uses "CtrlXmpp"
int p;
main(mapping event)
{
  mapping m;
  int port;
  string host;
  string resource;
  bool autoAcceptSubscriptions = FALSE;
  string logging;
  m["host"]= host;
  m["port"] = port;
  m["resource"] = resource;
  m["autoAcceptSubscriptions"] = autoAcceptSubscriptions;
  m["logging"] = "send";
  p = xmppOpen("winccoa.etm@jabber.at","123677");
  DebugN("xmppOpen:", p);
  int s = xmppRoomJoin(p,"testraum@conference.jabber.at", "WinCCOA");
  DebugN("Joined the room:", s);
  int l = xmppRoomLeave(p,"testraum@conference.jabber.at", "Need to go");
  DebugN("Left the room:", l);
}
Abbildung 1. The user winccoa.etm with the nickname "WinCCOA" leaves the room testraum

Assignment

XMPP functions

Availability

CTRL