[pkg-otr-team] [irssi-plugin-otr] 64/167: * gtk-dialog.c: Make the menu item say "Reauthenticate buddy" when the buddy is already authenticated.

Holger Levsen holger at moszumanska.debian.org
Mon Mar 3 21:55:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to tag 4.0.0
in repository irssi-plugin-otr.

commit 3db7d5391ccfd0337f10ad4f2d2d4de25b09226b
Author: cypherpunk <cypherpunk>
Date:   Mon Jun 16 12:22:20 2008 +0000

    	* gtk-dialog.c: Make the menu item say "Reauthenticate buddy"
    	when the buddy is already authenticated.
---
 ChangeLog    |  5 +++++
 gtk-dialog.c | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 7ff6d14..02eb898 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-16
+
+	* gtk-dialog.c: Make the menu item say "Reauthenticate buddy"
+	when the buddy is already authenticated.
+
 2008-06-15
 
 	* gtk-dialog.c: Don't try to destroy the submenu when we've
diff --git a/gtk-dialog.c b/gtk-dialog.c
index 03d4602..65250a0 100644
--- a/gtk-dialog.c
+++ b/gtk-dialog.c
@@ -1194,6 +1194,11 @@ static void dialog_update_label_conv(PurpleConversation *conv, TrustLevel level)
 	    (level == TRUST_NOT_PRIVATE || level == TRUST_FINISHED) ?
 		    NULL : conv);
 
+    /* Use any non-NULL value for "unauthenticated", NULL for
+     * "authenticated" */
+    purple_conversation_set_data(conv, "otr-authenticated",
+	    (level == TRUST_PRIVATE) ? conv : NULL);
+
     /* Use any non-NULL value for "finished", NULL for "not finished" */
     purple_conversation_set_data(conv, "otr-finished",
 	    level == TRUST_FINISHED ? conv : NULL);
@@ -1794,6 +1799,8 @@ static int otr_get_menu_insert_pos(PurpleConversation *conv) {
 
 static void otr_set_menu_labels(PurpleConversation *conv, GtkWidget *query, GtkWidget *end, GtkWidget *smp) {
     int insecure = purple_conversation_get_data(conv, "otr-private") ? 0 : 1;
+    int authen = purple_conversation_get_data(conv, "otr-authenticated") ?
+	1 : 0;
     int finished = purple_conversation_get_data(conv, "otr-finished") ? 1 : 0;
 
     GtkWidget * label = gtk_bin_get_child(GTK_BIN(query));
@@ -1802,6 +1809,12 @@ static void otr_set_menu_labels(PurpleConversation *conv, GtkWidget *query, GtkW
         insecure ? _("Start _private conversation") :
         _("Refresh _private conversation"));
 
+    label = gtk_bin_get_child(GTK_BIN(smp));
+
+    gtk_label_set_markup_with_mnemonic(GTK_LABEL(label),
+        (!insecure && authen) ? _("Re_authenticate buddy") :
+        _("_Authenticate buddy"));
+
     gtk_widget_set_sensitive(GTK_WIDGET(end), !insecure || finished);
     gtk_widget_set_sensitive(GTK_WIDGET(smp), !insecure);
 }
@@ -2160,6 +2173,7 @@ static void conversation_destroyed(PurpleConversation *conv, void *data)
     g_hash_table_remove(conv->data, "otr-icon");
     g_hash_table_remove(conv->data, "otr-menu");
     g_hash_table_remove(conv->data, "otr-private");
+    g_hash_table_remove(conv->data, "otr-authenticated");
     g_hash_table_remove(conv->data, "otr-finished");
 #ifdef OLD_OTR_BUTTON
     g_hash_table_remove(conv->data, "otr-icontext");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-otr/packages/irssi-plugin-otr.git



More information about the Pkg-otr-team mailing list