Jabber Signals

Signals:

- jabber-receiving-iq
- jabber-receiving-message
- jabber-receiving-presence
- jabber-watched-iq
- jabber-register-namespace-watcher
- jabber-unregister-namespace-watcher
- jabber-sending-xmlnode
- jabber-receiving-xmlnode

# jabber-receiving-iq

gboolean (*iq_received)(PurpleConnection *gc, const char *type, const char *id,
const char *from, xmlnode *iq);

Description:
  Emitted when an XMPP IQ stanza is received. Allows a plugin to process IQ stanzas.

Parameters

  gc | The connection on which the stanza is received
  type | The IQ type ('get', 'set', 'result', or 'error')
  id | The ID attribute from the stanza. MUST NOT be NULL.
  from | The originator of the stanza. MAY BE NULL if the stanza originated from the user's server.
  iq | The full stanza received.

Returns
  TRUE if the plugin processed this stanza and nobody else should process it. FALSE otherwise.

# jabber-receiving-message

gboolean (*message_received)(PurpleConnection *gc, const char *type,
const char *id, const char *from, const char *to,
xmlnode *message);

Description:
  Emitted when an XMPP message stanza is received. Allows a plugin to process message stanzas.

Parameters

  gc | The connection on which the stanza is received
  type | The message type (see rfc3921 or rfc3921bis)
  id | The ID attribute from the stanza. MAY BE NULL.
  from | The originator of the stanza. MAY BE NULL if the stanza originated from the user's server.
  to | The destination of the stanza. This is probably either the full JID of the receiver or the receiver's bare JID.
  message | The full stanza received.

Returns
  TRUE if the plugin processed this stanza and nobody else should process it. FALSE otherwise.

# jabber-receiving-presence

gboolean (*presence_received)(PurpleConnection *gc, const char *type,
const char *from, xmlnode *presence);

Description:
  Emitted when an XMPP presence stanza is received. Allows a plugin to process presence stanzas.

Parameters

  gc | The connection on which the stanza is received
  type | The presence type (see rfc3921 or rfc3921bis). NULL indicates this is an "available" (i.e. online) presence.
  from | The originator of the stanza. MAY BE NULL if the stanza originated from the user's server.
  presence | The full stanza received.

Returns
  TRUE if the plugin processed this stanza and nobody else should process it. FALSE otherwise.

# jabber-watched-iq

gboolean (*watched_iq)(PurpleConnection *gc, const char *type, const char *id,
const char *from, xmlnode *child);

Description:
  Emitted when an IQ with a watched (child, namespace) pair is received. See jabber-register-namespace-watcher and jabber-unregister-namespace-watcher.

Parameters

  gc | The connection on which the stanza is received
  type | The IQ type ('get', 'set', 'result', or 'error')
  id | The ID attribute from the stanza. MUST NOT be NULL.
  from | The originator of the stanza. MAY BE NULL if the stanza originated from the user's server.
  child | The child node with namespace.

Returns
  TRUE if the plugin processed this stanza and nobody else should process it. FALSE otherwise.

# jabber-register-namespace-watcher

void (register_namespace_watcher)(const char *node, const char *namespace);

Description:
  Emit this signal to register your desire to have specific IQ stanzas to be emitted via the jabber-watched-iq signal when received.

Parameters

  node | The IQ child name to longer watch.
  namespace | The IQ child namespace to longer watch.

# jabber-unregister-namespace-watcher

void (unregister_namespace_watcher)(const char *node, const char *namespace);

Description:
  Emit this signal to unregister your desire to have specific IQ stanzas to be emitted via the jabber-watched-iq signal when received.

Parameters

  node | The IQ child name to no longer watch.
  namespace | The IQ child namespace to no longer watch.

# jabber-sending-xmlnode

void (sending_xmlnode)(PurpleConnection *gc, xmlnode **stanza);

Description:
  Emit this signal (`purple_signal_emit`) to send a stanza. It is preferred to use this instead of prpl_info->send_raw.

Parameters

  gc | The connection on which to send the stanza.
  stanza | The stanza to send. If stanza is not NULL after being sent, the emitter should free it.

# jabber-receiving-xmlnode

void (receiving_xmlnode)(PurpleConnection *gc, xmlnode **stanza);

Description:
  Emitted when an XMPP stanza is received. Allows a plugin to process any stanza.

Parameters

  gc | The connection on which the stanza was received.
  stanza | The received stanza. Set stanza to NULL (and free it) to stop processing the stanza.

_xmlnode
Definition: xmlnode.h:49
_PurpleConnection
Definition: connection.h:245