disco.c
changeset 22 6d0d6bbf98d0
parent 21 299300f1dd31
child 23 63a8b60efcb2
--- a/disco.c	Wed Jan 20 19:50:41 2010 +0200
+++ b/disco.c	Wed Jan 20 19:59:55 2010 +0200
@@ -275,7 +275,7 @@
 
 void disco_info_request (const gchar *jid, const gchar *dnode, disco_info_handler_t handler, gpointer userdata, GDestroyNotify notify)
 {
-	if (!handler) {
+	if (!handler || !xmpp_is_online ()) {
 		if (notify)
 			notify (userdata);
 		return;
@@ -342,7 +342,7 @@
 
 void disco_items_request (const gchar *jid, const gchar *dnode, disco_items_handler_t handler, gpointer userdata, GDestroyNotify notify)
 {
-	if (!handler) {
+	if (!handler || !xmpp_is_online ()) {
 		if (notify)
 			notify (userdata);
 		return;
@@ -552,6 +552,10 @@
 	for (hel = reply_handlers; hel; hel = hel -> next) {
 		LmMessageHandler *handler = hel -> data;
 		lm_message_handler_invalidate (handler);
+#ifdef HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER
+		if (lconnection)
+			lm_connection_unregister_reply_handler (handler);
+#endif
 	}
 
 	g_slist_free (reply_handlers);