changeset 5578:847ad796326d

[gaim-migrate @ 5982] Jabber looks done. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 31 May 2003 02:13:30 +0000
parents 7ed9999926af
children e0146fcc4718
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Sat May 31 02:11:42 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Sat May 31 02:13:30 2003 +0000
@@ -61,9 +61,6 @@
 
 static GaimPlugin *my_protocol = NULL;
 
-/* for win32 compatability */
-G_MODULE_IMPORT GSList *connections;
-
 /* The priv member of gjconn's is a gaim_connection for now. */
 #define GJ_GC(x) ((GaimConnection *)(x)->priv)
 /* Confused? That makes three of us. -Robot101 */
@@ -689,7 +686,7 @@
 				   "input (len %d): %s\n", len, buf);
 		XML_Parse(gjc->parser, buf, len, 0);
 		if (jd->die)
-			signoff(GJ_GC(gjc));
+			gaim_connection_destroy(GJ_GC(gjc));
 	} else if (len < 0 || errno != EAGAIN) {
 		STATE_EVT(JCONN_STATE_OFF)
 	}
@@ -772,7 +769,7 @@
 	struct jabber_data *jd;
 	gjconn gjc;
 
-	if (!g_slist_find(connections, gc)) {
+	if (!g_list_find(gaim_connections_get_all(), gc)) {
 		close(source);
 		return;
 	}
@@ -1668,7 +1665,7 @@
  */
 static void jabber_accept_add(struct jabber_add_permit *jap)
 {
-	if(g_slist_find(connections, jap->gc)) {
+	if(g_list_find(gaim_connections_get_all(), jap->gc)) {
 		jabber_accept_deny_add(jap, "subscribed");
 		/*
 		 * If we don't already have the buddy on *our* buddylist,
@@ -1689,7 +1686,7 @@
  */
 static void jabber_deny_add(struct jabber_add_permit *jap)
 {
-	if(g_slist_find(connections, jap->gc)) {
+	if(g_list_find(gaim_connections_get_all(), jap->gc)) {
 		jabber_accept_deny_add(jap, "unsubscribed");
 	}
 
@@ -2343,7 +2340,6 @@
 		} else {
 			gaim_connection_error(GJ_GC(gjc), _("Unable to connect"));
 		}
-		signoff(GJ_GC(gjc));
 		break;
 	case JCONN_STATE_CONNECTED:
 		gjc->was_connected = 1;
@@ -2377,7 +2373,6 @@
 		gaim_debug(GAIM_DEBUG_ERROR, "jabber",
 				   "unable to connect (jab_new failed)\n");
 		gaim_connection_error(gc, _("Unable to connect"));
-		signoff(gc);
 		return;
 	}
 
@@ -4179,12 +4174,7 @@
 					   "registration successful!\n");
 
 			gaim_connection_notice(GJ_GC(gjc), _("Server Registration successful!"));
-			/*
-			 * TBD: is this the correct way to do away with a
-			 * gaim_connection and all its associated memory
-			 * allocs, etc.?
-			 */
-			signoff(GJ_GC(gjc));
+			gaim_connection_destroy(GJ_GC(gjc));
 		}
 
 	} else {
@@ -4253,7 +4243,6 @@
 		} else {
 			gaim_connection_error(GJ_GC(gjc), _("Unable to connect"));
 		}
-		signoff(GJ_GC(gjc));
 		break;
 	case JCONN_STATE_CONNECTED:
 		gjc->was_connected = 1;
@@ -4299,7 +4288,6 @@
 		gaim_debug(GAIM_DEBUG_ERROR, "jabber",
 				   "unable to connect (jab_new failed)\n");
 		gaim_connection_error(gc, _("Unable to connect"));
-		signoff(gc);
 	} else {
 		gjab_state_handler(jd->gjc, jabber_handle_registration_state);
 		gjab_packet_handler(jd->gjc, jabber_handleregresp);