[telepathy-gabble/master] add wocky_pep_service_make_publish_stanza

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Sep 21 06:20:13 PDT 2009


---
 src/wocky-pep-service.c |   20 ++++++++++++++++++++
 src/wocky-pep-service.h |    3 +++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/wocky-pep-service.c b/src/wocky-pep-service.c
index 0f27f98..9657db0 100644
--- a/src/wocky-pep-service.c
+++ b/src/wocky-pep-service.c
@@ -334,3 +334,23 @@ wocky_pep_service_get_finish (WockyPepService *self,
   return g_simple_async_result_get_op_res_gpointer (
       G_SIMPLE_ASYNC_RESULT (result));
 }
+
+WockyXmppStanza *
+wocky_pep_service_make_publish_stanza (WockyPepService *self,
+    WockyXmppNode **item)
+{
+  WockyPepServicePrivate *priv = WOCKY_PEP_SERVICE_GET_PRIVATE (self);
+
+  return wocky_xmpp_stanza_build (
+      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_SET,
+      NULL, NULL,
+      WOCKY_NODE, "pubsub",
+        WOCKY_NODE_XMLNS, WOCKY_XMPP_NS_PUBSUB,
+        WOCKY_NODE, "publish",
+          WOCKY_NODE_ATTRIBUTE, "node", priv->node,
+          WOCKY_NODE, "item",
+          WOCKY_NODE_ASSIGN_TO, item,
+          WOCKY_NODE_END,
+        WOCKY_NODE_END,
+      WOCKY_NODE_END, WOCKY_STANZA_END);
+}
diff --git a/src/wocky-pep-service.h b/src/wocky-pep-service.h
index aa4e857..5287a36 100644
--- a/src/wocky-pep-service.h
+++ b/src/wocky-pep-service.h
@@ -72,6 +72,9 @@ WockyXmppStanza * wocky_pep_service_get_finish (WockyPepService *pep,
     GAsyncResult *result,
     GError **error);
 
+WockyXmppStanza * wocky_pep_service_make_publish_stanza (WockyPepService *pep,
+    WockyXmppNode **item);
+
 G_END_DECLS
 
 #endif /* __WOCKY_PEP_SERVICE_H__ */
-- 
1.5.6.5




More information about the telepathy-commits mailing list