Update of /cvsroot/gaim/gaim/src/protocols/oscar
In directory usw-pr-cvs1:/tmp/cvs-serv27900/protocols/oscar
Modified Files:
oscar.c
Log Message:
i think this is better.
Index: oscar.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- oscar.c 2001/12/01 00:56:31 1.78
+++ oscar.c 2001/12/01 01:13:12 1.79
@@ -82,8 +82,7 @@
guint cnpa;
guint paspa;
- int create_exchange;
- char *create_name;
+ GSList *create_rooms;
gboolean conf;
gboolean reqemail;
@@ -102,6 +101,11 @@
GSList *evilhack;
};
+struct create_room {
+ char *name;
+ int exchange;
+};
+
struct chat_connection {
char *name;
char *show; /* AOL did something funny to us */
@@ -365,10 +369,12 @@
gaim_input_remove(odata->cnpa);
odata->cnpa = 0;
debug_printf("removing chatnav input watcher\n");
- if (odata->create_exchange) {
- odata->create_exchange = 0;
- g_free(odata->create_name);
- odata->create_name = NULL;
+ while (odata->create_rooms) {
+ struct create_room *cr = odata->create_rooms->data;
+ g_free(cr->name);
+ odata->create_rooms =
+ g_slist_remove(odata->create_rooms, cr);
+ g_free(cr);
do_error_dialog(_("Chat is currently unavailable"),
_("Gaim - Chat"));
}
@@ -446,7 +452,6 @@
char buf[256];
struct gaim_connection *gc = new_gaim_conn(user);
struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);
- odata->create_exchange = 0;
if (isdigit(*user->username)) {
odata->icq = TRUE;
@@ -526,8 +531,12 @@
g_free(odata->evilhack->data);
odata->evilhack = g_slist_remove(odata->evilhack, odata->evilhack->data);
}
- if (odata->create_name)
- g_free(odata->create_name);
+ while (odata->create_rooms) {
+ struct create_room *cr = odata->create_rooms->data;
+ g_free(cr->name);
+ odata->create_rooms = g_slist_remove(odata->create_rooms, cr);
+ g_free(cr);
+ }
if (odata->email)
g_free(odata->email);
if (odata->newp)
@@ -1680,13 +1689,13 @@
debug_printf("chat info: \tExchange List: (%d total)\n", exchangecount);
for (i = 0; i < exchangecount; i++)
debug_printf("chat info: \t\t%d\n", exchanges[i].number);
- if (odata->create_exchange) {
- debug_printf("creating room %s\n", odata->create_name);
- aim_chatnav_createroom(sess, fr->conn, odata->create_name,
- odata->create_exchange);
- odata->create_exchange = 0;
- g_free(odata->create_name);
- odata->create_name = NULL;
+ while (odata->create_rooms) {
+ struct create_room *cr = odata->create_rooms->data;
+ debug_printf("creating room %s\n", cr->name);
+ aim_chatnav_createroom(sess, fr->conn, cr->name, cr->exchange);
+ g_free(cr->name);
+ odata->create_rooms = g_slist_remove(odata->create_rooms, cr);
+ g_free(cr);
}
}
break;
@@ -2452,9 +2461,11 @@
aim_chatnav_createroom(odata->sess, cur, name, *exchange);
} else {
/* this gets tricky */
+ struct create_room *cr = g_new0(struct create_room, 1);
debug_printf("chatnav does not exist, opening chatnav\n");
- odata->create_exchange = *exchange;
- odata->create_name = g_strdup(name);
+ cr->exchange = *exchange;
+ cr->name = g_strdup(name);
+ odata->create_rooms = g_slist_append(odata->create_rooms, cr);
aim_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV);
}
}
|