xmppRefuseSubscription()

Refuses an XMPP request of type "subscriptionRequest".

Synopsis

int xmppRefuseSubscription(int clientId, string jid [, string reason]);

Parameter

Parameter Description
clientId A unique ID for this client channel. The function xmppOpen() returns the client id.
jid Jabber ID such as winccoa.etm@jabber.at of the user who sent the request.
reason Reason why the request was refused.

Return Value

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

Errors

Errors can be queried via getLastError().

Description

Refuses an XMPP request of type "subscriptionRequest".

The following example refuses an XMPP request of type

Note: 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!
#uses "CtrlXmpp"
int p;
main(mapping event)
{
  mapping m;
  int port;
  string host;
  string resource;
  bool autoAcceptSubscriptions = FALSE;
  /*When set to FALSE, a message of type "subscriptionRequest" is received,
   which must be either accepted via xmppAcceptSubscription() or refused via
   xmppRefuseSubscription().*/
  string logging;
  m["host"]= host;
  m["port"] = port;
  m["resource"] = resource;
  m["autoAcceptSubscriptions"] = autoAcceptSubscriptions;
  m["logging"] = "send";
  p = xmppOpen("winccoa.etm@jabber.at","123677", "callback", m);
  DebugN("xmppOpen:", p);
}
void callback(mapping message) /* Received message output */
{
  int l = xmppRefuseSubscription(p, "maxMuster@jabber.at","Refused subscription");
  DebugN("Refused subscription:", l);
  /*You have to receive a request from the user "maxMuster@jabber.at" in order to
  refuse the request by using this example. Replace the user by your own user*/
}

Assignment

XMPP functions

Availability

CTRL