diff src/protocols/oscar/family_chat.c @ 13254:e9802db22b06

[gaim-migrate @ 15620] This is the way we clean the code, clean the code, clean the code This is the way we clean the code, clean the code, clean the code So early in the morning committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 12 Feb 2006 22:14:38 +0000
parents 87a7c3077c19
children b08f8f3c9197
line wrap: on
line diff
--- a/src/protocols/oscar/family_chat.c	Sun Feb 12 21:27:04 2006 +0000
+++ b/src/protocols/oscar/family_chat.c	Sun Feb 12 22:14:38 2006 +0000
@@ -63,23 +63,28 @@
 /* XXX get this into conn.c -- evil!! */
 faim_export OscarConnection *aim_chat_getconn(OscarSession *sess, const char *name)
 {
-	OscarConnection *cur;
+	GList *cur;
 
-	for (cur = sess->connlist; cur; cur = cur->next) {
-		struct chatconnpriv *ccp = (struct chatconnpriv *)cur->internal;
+	for (cur = sess->oscar_connections; cur; cur = cur->next)
+	{
+		OscarConnection *conn;
+		struct chatconnpriv *ccp;
 
-		if (cur->type != AIM_CONN_TYPE_CHAT)
+		conn = cur->data;
+		ccp = (struct chatconnpriv *)conn->internal;
+
+		if (conn->type != AIM_CONN_TYPE_CHAT)
 			continue;
-		if (!cur->internal) {
-			gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", cur->fd);
+		if (!conn->internal) {
+			gaim_debug_misc("oscar", "faim: chat: chat connection with no name! (fd = %d)\n", conn->fd);
 			continue;
 		}
 
 		if (strcmp(ccp->name, name) == 0)
-			break;
+			return conn;;
 	}
 
-	return cur;
+	return NULL;
 }
 
 faim_export int aim_chat_attachname(OscarConnection *conn, guint16 exchange, const char *roomname, guint16 instance)
@@ -126,7 +131,7 @@
 	if (!(conn = aim_chat_getconn(sess, name)))
 		return -ENOENT;
 
-	aim_conn_close(conn);
+	aim_conn_close(sess, conn);
 
 	return 0;
 }