xmppAcceptSubscription()

Accepts an XMPP request of type "subscriptionRequest".

Synopsis

int xmppAcceptSubscription(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 accepted.

Return Value

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

Errors

Errors can be queried via getLastError().

Description

Accepts an XMPP request of type "subscriptionRequest".

The following example accepts an XMPP request of type "subscriptionRequest".

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!
#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 = xmppAcceptSubscription(p, "maxMuster@jabber.at","Accepted subscription");
  DebugN("Accepted subscription:", l);
  /*You have to receive a request from the user "maxMuster@jabber.at" in order to accept the request by using this example */
}

Assignment

XMPP functions

Availability

CTRL