[telepathy-gabble/master] add wocky_pubsub_unregister_event_handler
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Sep 25 02:29:46 PDT 2009
---
src/wocky-pubsub.c | 19 +++++++++++++++++++
src/wocky-pubsub.h | 3 +++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/wocky-pubsub.c b/src/wocky-pubsub.c
index 96b3473..272a343 100644
--- a/src/wocky-pubsub.c
+++ b/src/wocky-pubsub.c
@@ -412,3 +412,22 @@ wocky_pubsub_register_event_handler (WockyPubsub *self,
return priv->last_id_used;
}
+
+void
+wocky_pubsub_unregister_event_handler (WockyPubsub *self,
+ guint id)
+{
+ WockyPubsubPrivate *priv = WOCKY_PUBSUB_GET_PRIVATE (self);
+ GSList *l;
+
+ for (l = priv->handlers; l != NULL; l = g_slist_next (l))
+ {
+ PubsubEventHandler *handler = l->data;
+
+ if (handler->id == id)
+ {
+ priv->handlers = g_slist_delete_link (priv->handlers, l);
+ return;
+ }
+ }
+}
diff --git a/src/wocky-pubsub.h b/src/wocky-pubsub.h
index 48bb97a..0c806b9 100644
--- a/src/wocky-pubsub.h
+++ b/src/wocky-pubsub.h
@@ -82,6 +82,9 @@ WockyXmppStanza * wocky_pubsub_send_query_finish (WockyPubsub *pubsub,
GAsyncResult *result,
GError **error);
+void wocky_pubsub_unregister_event_handler (WockyPubsub *pubsub,
+ guint id);
+
/* not methods */
WockyXmppStanza * pubsub_make_publish_msg (const gchar *to,
const gchar *node_name,
--
1.5.6.5
More information about the telepathy-commits
mailing list