# HG changeset patch # User Richard Laager # Date 1124002557 0 # Node ID b53606580f68245d0dd7a97e42b1f998b615c215 # Parent fd4aba9dab9d7ea83309071cda19058759047da6 [gaim-migrate @ 13439] Patch #1226486 from Levi Bard Fixes bug #1224178 If you change the topic in a chat room and that topic change is rejected, the topic field is wrong -- it shows the new topic even thought it didn't get set. This patch resets the GUI's topic immediately when you hit enter. Then, if the topic change is successful, the server will echo the topic change back to us and we'll update the GUI to the new topic. The only question is, does the server always echo the topic back to us? From the core's point of view, I'm ready to assume yes. It's the case for both IRC and Jabber*. If someone could test changing a topic in SILC or Zephyr, that'd be great. If servers using those protocols do not echo the topic back, the prpl will have to fake it as appropriate. * I didn't actually test on Jabber, but Nathan said the server will echo the topic change back. If it's broken, let me know. committer: Tailor Script diff -r fd4aba9dab9d -r b53606580f68 src/gtkconv.c --- a/src/gtkconv.c Sun Aug 14 06:23:51 2005 +0000 +++ b/src/gtkconv.c Sun Aug 14 06:55:57 2005 +0000 @@ -3811,7 +3811,7 @@ GaimConnection *gc; GaimConversation *conv = gtkconv->active_conv; GaimGtkChatPane *gtkchat; - const char *new_topic; + char *new_topic; const char *current_topic; gc = gaim_conversation_get_gc(conv); @@ -3824,14 +3824,20 @@ gtkconv = GAIM_GTK_CONVERSATION(conv); gtkchat = gtkconv->u.chat; - new_topic = gtk_entry_get_text(GTK_ENTRY(gtkchat->topic_text)); + new_topic = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkchat->topic_text))); current_topic = gaim_conv_chat_get_topic(GAIM_CONV_CHAT(conv)); - if(current_topic && !g_utf8_collate(new_topic, current_topic)) + if(current_topic && !g_utf8_collate(new_topic, current_topic)){ + g_free(new_topic); return; + } + + gtk_entry_set_text(GTK_ENTRY(gtkchat->topic_text), current_topic); prpl_info->set_chat_topic(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(conv)), new_topic); + + g_free(new_topic); } static gint