| 1097 |
1097 |
| 1098 if(!PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, set_topic)) |
1098 if(!PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, set_topic)) |
| 1099 return; |
1099 return; |
| 1100 |
1100 |
| 1101 gtkconv = PIDGIN_CONVERSATION(conv); |
1101 gtkconv = PIDGIN_CONVERSATION(conv); |
| 1102 new_topic = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkconv->topic_text))); |
1102 new_topic = g_strdup(gtk_editable_get_text(GTK_EDITABLE(gtkconv->topic_text))); |
| 1103 current_topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
1103 current_topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
| 1104 |
1104 |
| 1105 if(current_topic && !g_utf8_collate(new_topic, current_topic)){ |
1105 if(current_topic && !g_utf8_collate(new_topic, current_topic)){ |
| 1106 g_free(new_topic); |
1106 g_free(new_topic); |
| 1107 return; |
1107 return; |
| 1108 } |
1108 } |
| 1109 |
1109 |
| 1110 if (current_topic) |
1110 if (current_topic) { |
| 1111 gtk_entry_set_text(GTK_ENTRY(gtkconv->topic_text), current_topic); |
1111 gtk_editable_set_text(GTK_EDITABLE(gtkconv->topic_text), current_topic); |
| 1112 else |
1112 } else { |
| 1113 gtk_entry_set_text(GTK_ENTRY(gtkconv->topic_text), ""); |
1113 gtk_editable_set_text(GTK_EDITABLE(gtkconv->topic_text), ""); |
| |
1114 } |
| 1114 |
1115 |
| 1115 purple_protocol_chat_set_topic(PURPLE_PROTOCOL_CHAT(protocol), gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), |
1116 purple_protocol_chat_set_topic(PURPLE_PROTOCOL_CHAT(protocol), gc, purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), |
| 1116 new_topic); |
1117 new_topic); |
| 1117 |
1118 |
| 1118 g_free(new_topic); |
1119 g_free(new_topic); |
| 2044 |
2045 |
| 2045 if (gtkconv->topic_text != NULL) |
2046 if (gtkconv->topic_text != NULL) |
| 2046 { |
2047 { |
| 2047 topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
2048 topic = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
| 2048 |
2049 |
| 2049 gtk_entry_set_text(GTK_ENTRY(gtkconv->topic_text), topic ? topic : ""); |
2050 gtk_editable_set_text(GTK_EDITABLE(gtkconv->topic_text), topic ? topic : ""); |
| 2050 gtk_widget_set_tooltip_text(gtkconv->topic_text, |
2051 gtk_widget_set_tooltip_text(gtkconv->topic_text, |
| 2051 topic ? topic : ""); |
2052 topic ? topic : ""); |
| 2052 } |
2053 } |
| 2053 } |
2054 } |
| 2054 |
2055 |
| 2076 } else { |
2077 } else { |
| 2077 markup = title; |
2078 markup = title; |
| 2078 } |
2079 } |
| 2079 } else if (PURPLE_IS_CHAT_CONVERSATION(conv)) { |
2080 } else if (PURPLE_IS_CHAT_CONVERSATION(conv)) { |
| 2080 const char *topic = gtkconv->topic_text |
2081 const char *topic = gtkconv->topic_text |
| 2081 ? gtk_entry_get_text(GTK_ENTRY(gtkconv->topic_text)) |
2082 ? gtk_editable_get_text(GTK_EDITABLE(gtkconv->topic_text)) |
| 2082 : NULL; |
2083 : NULL; |
| 2083 const char *title = purple_conversation_get_title(conv); |
2084 const char *title = purple_conversation_get_title(conv); |
| 2084 const char *name = purple_conversation_get_name(conv); |
2085 const char *name = purple_conversation_get_name(conv); |
| 2085 |
2086 |
| 2086 char *topic_esc, *unaliased, *unaliased_esc, *title_esc; |
2087 char *topic_esc, *unaliased, *unaliased_esc, *title_esc; |