Mercurial > pidgin.yaz
diff src/protocols/toc/toc.c @ 5234:890b29f00b68
[gaim-migrate @ 5604]
Chats in the buddy list!
You can now put chat rooms in your buddy list, and double-click them to join
them, instead of having to do all that typing. I'm eventually gonna add
auto-join support, so that ugly hack involving pouncing can go away.
Someone should make some new artwork so we don't have 2 + icons next to
each other in the menus.
This also has some fixes to let gaim compile again, after the renaming of
the buddy list files.
This also fixes the problem with offline buddies not showing up in the list
sometimes for accounts that didn't log in at startup.
This probably fixes other stuff, but I can't remember any of it off the top
of my head.
I'm going to stop typing and let people play with this now.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 26 Apr 2003 20:30:43 +0000 |
parents | fefad67de2c7 |
children | ad445074d239 |
line wrap: on
line diff
--- a/src/protocols/toc/toc.c Sat Apr 26 20:05:01 2003 +0000 +++ b/src/protocols/toc/toc.c Sat Apr 26 20:30:43 2003 +0000 @@ -818,14 +818,18 @@ gaim_chat_remove_user(chat, buddy, NULL); } else if (!g_ascii_strcasecmp(c, "CHAT_INVITE")) { char *name, *who, *message; - int *id = g_new0(int, 1); + int id; + GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, g_free); name = strtok(NULL, ":"); - sscanf(strtok(NULL, ":"), "%d", id); + sscanf(strtok(NULL, ":"), "%d", &id); who = strtok(NULL, ":"); message = strtok(NULL, ":"); - serv_got_chat_invite(gc, name, who, message, g_list_append(NULL, id)); + g_hash_table_replace(components, g_strdup("id"), g_strdup_printf("%d", id)); + + serv_got_chat_invite(gc, name, who, message, components); } else if (!g_ascii_strcasecmp(c, "CHAT_LEFT")) { GSList *bcs = gc->buddy_chats; struct gaim_conversation *b = NULL; @@ -1185,10 +1189,12 @@ pce = g_new0(struct proto_chat_entry, 1); pce->label = _("Join what group:"); + pce->identifier = "room"; m = g_list_append(m, pce); pce = g_new0(struct proto_chat_entry, 1); pce->label = _("Exchange:"); + pce->identifier = "exchange"; pce->is_int = TRUE; pce->min = 4; pce->max = 20; @@ -1197,23 +1203,20 @@ return m; } -static void toc_join_chat(struct gaim_connection *g, GList *data) +static void toc_join_chat(struct gaim_connection *g, GHashTable *data) { char buf[BUF_LONG]; - int *exchange; - char *name; - int *i; - - if (!data) - return; + char *name, *exchange; + char *id; - if (!data->next) { - i = data->data; - g_snprintf(buf, 255, "toc_chat_accept %d", *i); + name = g_hash_table_lookup(data, "room"); + exchange = g_hash_table_lookup(data, "exchange"); + id = g_hash_table_lookup(data, "id"); + + if (id) { + g_snprintf(buf, 255, "toc_chat_accept %d", atoi(id)); } else { - name = data->data; - exchange = data->next->data; - g_snprintf(buf, sizeof(buf) / 2, "toc_chat_join %d \"%s\"", *exchange, name); + g_snprintf(buf, sizeof(buf) / 2, "toc_chat_join %d \"%s\"", atoi(exchange), name); } sflap_send(g, buf, -1, TYPE_DATA);