Index: src/gtkblist.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkblist.c,v retrieving revision 1.160 diff -u -p -r1.160 gtkblist.c --- src/gtkblist.c 15 Aug 2004 19:34:15 -0000 1.160 +++ src/gtkblist.c 17 Aug 2004 02:46:31 -0000 @@ -660,6 +660,7 @@ rebuild_joinchat_entries(GaimGtkJoinChat { GaimConnection *gc; GList *list, *tmp; + GHashTable *defaults = NULL; struct proto_chat_entry *pce; gboolean focus = TRUE; @@ -678,6 +679,9 @@ rebuild_joinchat_entries(GaimGtkJoinChat list = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info(gc); + if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults != NULL) + defaults = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info_defaults(gc, NULL); + for (tmp = list; tmp; tmp = tmp->next) { GtkWidget *label; @@ -712,13 +716,15 @@ rebuild_joinchat_entries(GaimGtkJoinChat else { GtkWidget *entry = gtk_entry_new(); + char *value; gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); g_object_set_data(G_OBJECT(entry), "identifier", pce->identifier); data->entries = g_list_append(data->entries, entry); - if (pce->def) - gtk_entry_set_text(GTK_ENTRY(entry), pce->def); + value = g_hash_table_lookup(defaults, pce->identifier); + if (value != NULL) + gtk_entry_set_text(GTK_ENTRY(entry), value); if (focus) { @@ -4208,8 +4214,6 @@ rebuild_addchat_entries(GaimGtkAddChatDa value = g_hash_table_lookup(defaults, pce->identifier); if (value != NULL) gtk_entry_set_text(GTK_ENTRY(entry), value); - else if (pce->def) - gtk_entry_set_text(GTK_ENTRY(entry), pce->def); if (focus) { Index: src/prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.177 diff -u -p -r1.177 prpl.h --- src/prpl.h 15 Aug 2004 21:17:58 -0000 1.177 +++ src/prpl.h 17 Aug 2004 02:46:31 -0000 @@ -98,7 +98,6 @@ typedef struct { struct proto_chat_entry { char *label; char *identifier; - char *def; gboolean is_int; int min; int max; Index: src/protocols/jabber/chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/chat.c,v retrieving revision 1.37 diff -u -p -r1.37 chat.c --- src/protocols/jabber/chat.c 16 Aug 2004 01:14:57 -0000 1.37 +++ src/protocols/jabber/chat.c 17 Aug 2004 02:46:31 -0000 @@ -36,7 +36,6 @@ GList *jabber_chat_info(GaimConnection * { GList *m = NULL; struct proto_chat_entry *pce; - JabberStream *js = gc->proto_data; pce = g_new0(struct proto_chat_entry, 1); pce->label = _("_Room:"); @@ -46,13 +45,11 @@ GList *jabber_chat_info(GaimConnection * pce = g_new0(struct proto_chat_entry, 1); pce->label = _("_Server:"); pce->identifier = "server"; - pce->def = js->chat_servers ? js->chat_servers->data : "conference.jabber.org"; m = g_list_append(m, pce); pce = g_new0(struct proto_chat_entry, 1); pce->label = _("_Handle:"); pce->identifier = "handle"; - pce->def = js->user->node; m = g_list_append(m, pce); pce = g_new0(struct proto_chat_entry, 1); @@ -67,15 +64,23 @@ GList *jabber_chat_info(GaimConnection * GHashTable *jabber_chat_info_defaults(GaimConnection *gc, const char *chat_name) { GHashTable *defaults; + JabberStream *js = gc->proto_data; defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); + g_hash_table_insert(defaults, "handle", g_strdup(js->user->node)); + + if (js->chat_servers) + g_hash_table_insert(defaults, "server", g_strdup(js->chat_servers->data)); + else + g_hash_table_insert(defaults, "server", g_strdup("conference.jabber.org")); + if (chat_name != NULL) { JabberID *jid = jabber_id_new(chat_name); if(jid) { g_hash_table_insert(defaults, "room", g_strdup(jid->node)); if(jid->domain) - g_hash_table_insert(defaults, "server", g_strdup(jid->domain)); + g_hash_table_replace(defaults, "server", g_strdup(jid->domain)); jabber_id_free(jid); } } Index: src/protocols/oscar/oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.641 diff -u -p -r1.641 oscar.c --- src/protocols/oscar/oscar.c 15 Aug 2004 23:07:54 -0000 1.641 +++ src/protocols/oscar/oscar.c 17 Aug 2004 02:46:33 -0000 @@ -6209,7 +6209,7 @@ static GList *oscar_chat_info(GaimConnec struct proto_chat_entry *pce; pce = g_new0(struct proto_chat_entry, 1); - pce->label = _("_Group:"); + pce->label = _("_Room:"); pce->identifier = "room"; m = g_list_append(m, pce);