changeset 28766:4e9a36bdda0f

merge of 'a582dd339f019301adca693df4b1a8fb135a1774' and 'e2fb4cc366c55b86f89304bddac780a92ff73394'
author Paul Aurich <paul@darkrain42.org>
date Sun, 06 Dec 2009 19:26:52 +0000
parents edf0aa0e55cb (diff) 17fed2099778 (current diff)
children 9ab75ab032b4
files
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Sun Dec 06 19:26:45 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Sun Dec 06 19:26:52 2009 +0000
@@ -30,6 +30,7 @@
 #include "google.h"
 #include "jabber.h"
 #include "presence.h"
+#include "roster.h"
 #include "iq.h"
 #include "chat.h"
 
@@ -949,6 +950,18 @@
 	jabber_iq_send(iq);
 }
 
+static void
+roster_init_cb(JabberStream *js, const char *from, JabberIqType type,
+               const char *id, xmlnode *packet, gpointer data)
+{
+	xmlnode *query = xmlnode_get_child(packet, "query");
+
+	if (type == JABBER_IQ_RESULT && query)
+		jabber_roster_parse(js, from, type, id, query);
+
+	jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
+}
+
 void jabber_google_roster_init(JabberStream *js)
 {
 	JabberIq *iq;
@@ -960,6 +973,7 @@
 	xmlnode_set_attrib(query, "xmlns:gr", "google:roster");
 	xmlnode_set_attrib(query, "gr:ext", "2");
 
+	jabber_iq_set_callback(iq, roster_init_cb, NULL);
 	jabber_iq_send(iq);
 }