changeset 50:3e0d4fd75b03

added that to disable widgets that decorate or link text.
author mikanbako <maoutwo@gmail.com>
date Wed, 14 May 2008 23:45:26 +0900
parents 82b2b3767311
children d5f251b37f6b
files pidgin-twitter.c
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Tue May 13 22:19:54 2008 +0900
+++ b/pidgin-twitter.c	Wed May 14 23:45:26 2008 +0900
@@ -581,7 +581,7 @@
 static void
 attach_to_gtkconv(PidginConversation *gtkconv, gpointer null)
 {
-    GtkWidget *box, *sep, *counter;
+    GtkWidget *box, *sep, *counter, *menus;
 
     box = gtkconv->toolbar;
     counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter");
@@ -601,6 +601,22 @@
     gtk_widget_show_all(sep);
     g_object_set_data(G_OBJECT(box), PLUGIN_ID "-sep", sep);
 
+    /* Disable widgets that decorate or link text
+     * because Twitter can't receive decorated them.
+     * About lean-view and wide-view, See pidgin/gtkimhtmltoolbar.c
+     */
+    menus = g_object_get_data(G_OBJECT(box), "lean-view");
+    if(menus) {
+        gtk_widget_set_sensitive(GTK_WIDGET(menus), FALSE);
+    }
+    menus = g_object_get_data(G_OBJECT(box), "wide-view");
+    if(menus) {
+        gtk_widget_set_sensitive(GTK_WIDGET(menus), FALSE);
+    }
+    purple_conversation_set_features(gtkconv->active_conv,
+        purple_conversation_get_features(
+            gtkconv->active_conv) & (~PURPLE_CONNECTION_HTML));
+
     /* connect signals, etc. */
     g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text",
                      G_CALLBACK(insert_text_cb), gtkconv);