| Wocky Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
WockyStanza * wocky_pubsub_make_event_stanza (const gchar *node,const gchar *from,WockyNode **item_out); WockyStanza * wocky_pubsub_make_stanza (const gchar *service,WockyStanzaSubType sub_type,const gchar *pubsub_ns,const gchar *action_name,WockyNode **pubsub_node,WockyNode **action_node); WockyStanza * wocky_pubsub_make_publish_stanza (const gchar *service,const gchar *node,WockyNode **pubsub_out,WockyNode **publish_out,WockyNode **item_out); void wocky_send_ll_pep_event (WockySession *session,WockyStanza *stanza); gboolean wocky_pubsub_distill_iq_reply (GObject *source,GAsyncResult *res,const gchar *pubsub_ns,const gchar *child_name,WockyNodeTree **child_out,GError **error); gboolean wocky_pubsub_distill_ambivalent_iq_reply (GObject *source,GAsyncResult *res,const gchar *pubsub_ns,const gchar *child_name,WockyNodeTree **child_out,GError **error); gboolean wocky_pubsub_distill_void_iq_reply (GObject *source,GAsyncResult *res,GError **error); gboolean wocky_pubsub_distill_stanza (WockyStanza *result,const gchar *pubsub_ns,const gchar *child_name,gboolean body_optional,WockyNodeTree **child_out,GError **error);
WockyStanza * wocky_pubsub_make_event_stanza (const gchar *node,const gchar *from,WockyNode **item_out);
Generates a new message stanza to send to other contacts about an updated PEP node.
Note that this should only be used in link-local
connections. Regular pubsub consists of making a publish stanza
with wocky_pubsub_make_publish_stanza() and sending it to your own
server. The server will then send the event stanza on to your
contacts who have the appropriate capability.
|
the the name of the pubsub node; may not be NULL
|
|
a JID to use as the 'from' attribute, or NULL
|
|
a location to store the item WockyNode, or NULL
|
Returns : |
a new WockyStanza pubsub event stanza; free with g_object_unref()
|
WockyStanza * wocky_pubsub_make_stanza (const gchar *service,WockyStanzaSubType sub_type,const gchar *pubsub_ns,const gchar *action_name,WockyNode **pubsub_node,WockyNode **action_node);
|
the JID of a PubSub service, or NULL
|
|
WOCKY_STANZA_SUB_TYPE_SET or WOCKY_STANZA_SUB_TYPE_GET, as you wish |
|
the namespace for the <pubsub/> node of the stanza |
|
the action node to add to <pubsub/> |
|
address at which to store a pointer to the <pubsub/> node |
|
address at wihch to store a pointer to the <action/>
node |
Returns : |
a new iq[type=sub_type]/pubsub/action stanza |
WockyStanza * wocky_pubsub_make_publish_stanza (const gchar *service,const gchar *node,WockyNode **pubsub_out,WockyNode **publish_out,WockyNode **item_out);
|
the JID of a PubSub service, or NULL
|
|
the name of a node on service; may not be NULL
|
|
address at which to store a pointer to the <pubsub/> node |
|
address at which to store a pointer to the <publish/> node |
|
address at which to store a pointer to the <item/> node |
Returns : |
a new iq[type='set']/pubsub/publish/item stanza |
void wocky_send_ll_pep_event (WockySession *session,WockyStanza *stanza);
Send a PEP event to all link-local contacts interested in receiving it.
|
the WockySession to send on |
|
the PEP event stanza to send |
gboolean wocky_pubsub_distill_iq_reply (GObject *source,GAsyncResult *res,const gchar *pubsub_ns,const gchar *child_name,WockyNodeTree **child_out,GError **error);
Helper function to finish a wocky_porter_send_iq_async() operation
and extract a particular pubsub child from the resulting reply, if needed.
|
a WockyPorter instance |
|
a result passed to the callback for wocky_porter_send_iq_async()
|
|
the namespace of the <pubsub/> node expected in this reply
(such as WOCKY_XMPP_NS_PUBSUB), or NULL if one is not expected |
|
the name of the child of <pubsub/> expected in this reply
(such as "subscriptions"); ignored if pubsub_ns is NULL
|
|
location at which to store a reference to the node tree at
child_name, or NULL if you don't need it. |
|
location at which to store an error if the call to
wocky_porter_send_iq_async() returned an error, or if the reply was
an error |
Returns : |
TRUE if the desired pubsub child was found; FALSE if
sending the IQ failed, the reply had type='error', or the
pubsub child was not found, with error set appropriately. |
gboolean wocky_pubsub_distill_ambivalent_iq_reply (GObject *source,GAsyncResult *res,const gchar *pubsub_ns,const gchar *child_name,WockyNodeTree **child_out,GError **error);
Helper function to finish a wocky_porter_send_iq_async() operation
and extract a particular pubsub child from the resulting reply, if it is
present. This is like wocky_pubsub_distill_iq_reply(), but is ambivalent as
to whether the <pubsub/> structure has to be included.
|
a WockyPorter instance |
|
a result passed to the callback for wocky_porter_send_iq_async()
|
|
the namespace of the <pubsub/> node accepted in this reply (such as WOCKY_XMPP_NS_PUBSUB) |
|
the name of the child of <pubsub/> accepted in this reply (such as "subscriptions") |
|
location at which to store a reference to the node tree at
child_name, if it is found, or to be set to NULL if it is not
found |
|
location at which to store an error if the call to
wocky_porter_send_iq_async() returned an error, or if the reply was
an error |
Returns : |
TRUE if the IQ was a success; FALSE if
sending the IQ failed or the reply had type='error',
with error set appropriately. |
gboolean wocky_pubsub_distill_void_iq_reply (GObject *source,GAsyncResult *res,GError **error);
Helper function to finish a wocky_porter_send_iq_async() operation where no
pubsub child is expected in the resulting reply.
|
a WockyPorter instance |
|
a result passed to the callback for wocky_porter_send_iq_async()
|
|
location at which to store an error if the call to
wocky_porter_send_iq_async() returned an error, or if the reply was
an error |
Returns : |
TRUE if the IQ was a success; FALSE if
sending the IQ failed or the reply had type='error',
with error set appropriately. |
gboolean wocky_pubsub_distill_stanza (WockyStanza *result,const gchar *pubsub_ns,const gchar *child_name,gboolean body_optional,WockyNodeTree **child_out,GError **error);
Helper function to extract a particular pubsub child node from a reply, if
it is present. If body_optional is FALSE, the
<pubsub><child_name/></pubsub> tree being absent is not
considered an error: child_out is set to NULL and the function returns
TRUE.
If you are happy to delegate calling wocky_porter_send_iq_finish() and
extracting stanza errors, you would probably be better served by one of
wocky_pubsub_distill_iq_reply() or
wocky_pubsub_distill_ambivalent_iq_reply().
|
an iq type='result' |
|
the namespace of the <pubsub/> node expected in this reply (such as WOCKY_XMPP_NS_PUBSUB) |
|
the name of the child of <pubsub/> expected in this reply (such as "subscriptions") |
|
If TRUE, the child being absent is not considered an error |
|
location at which to store a reference to the node tree at
child_name, if it is found, or to be set to NULL if it is not. |
|
location at which to store an error if the child node is not found
and body_optional is FALSE
|
Returns : |
TRUE if the child was found or was optional; FALSE with error
set otherwise. |