[pkg-otr-team] [irssi-plugin-otr] 50/167: * tooltipmenu.[ch]: New classes to allow tooltips on menus.

Holger Levsen holger at moszumanska.debian.org
Mon Mar 3 21:55:31 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 70ef4a79a91a62d9c87faeb12c3ddc88c813c29b
Author: cypherpunk <cypherpunk>
Date:   Tue May 27 13:32:08 2008 +0000

    	* tooltipmenu.[ch]: New classes to allow tooltips on menus.
    
    	* otr-icons.h: New OTR icons from <cyrus_xiii at yahoo.com>.
    
    	* README:
    	* AUTHORS:
    	* *.[ch]: Update copyright dates to 2004-2008 and add Rob Smits
    	as an author. (Rob wrote the new gtk-dialog stuff to handle user
    	authentication with an explicit question, inserted inline OTR
    	icons into the conversation when the status changes, and moved
    	the OTR button to the menu bar.)
    
    	* gtk-ui.c: Updated variable names to reflect the (old) change
    	from "OTR Options" to "OTR Settings".
    
    	* ui.h:
    	* ui.c:
    	* gtk-ui.c: Added new OTR UI Options section of the
    	configuration panel, which currently controls only whether the
    	old OTR button will still show up.
    
    	* dialogs.h:
    	* dialogs.c:
    	* gtk-dialog.c:
    	* otr-plugin.h:
    	* otr-plugin.c: Support starting the SMP authentication with an
    	explicit question.
    
    	* otr-plugin.c: Better handling of the case where an SMP message
    	fails a verification step.
    
    	* configure.ac:
    	* Makefile.mingw: Update version number to 3.2.0.
    
    	* gtk-dialog.c: Made new OTR menus (one master one, and one for
    	each active conversation in the window) that replace the old OTR
    	button.  [The old button is still available as an option, but
    	the menu is always present.]
    
    	* gtk-dialog.c: OTR icons are inserted inline into the
    	conversation when the OTR status changes.
    
    	* configure.ac:
    	* po/ar.po:
    	* po/de.po:
    	* po/ru.po: New translations:
    	Arabic (Ahmad Gharbeia ﺄﺤﻣﺩ ﻍﺮﺒﻳﺓ <gharbeia at gmail.com>),
    	German (Thorsten Mühlfelder <thenktor at gmx.de>),
    	Russian (Sergei Smirnov <moscow at hro.org>)
    
    	* dialogs.h: Help URLs now have version numbers in them, so the
    	appropriate help page can be served.
    
    	* Makefile.am: Include new files in compilation and distribution
    	targets.
---
 AUTHORS        |    3 +-
 ChangeLog      |   58 ++
 Makefile.am    |    4 +-
 Makefile.mingw |    2 +-
 NEWS           |   15 +
 README         |   15 +-
 configure.ac   |    6 +-
 dialogs.c      |   13 +-
 dialogs.h      |   15 +-
 gtk-dialog.c   | 2063 +++++++++++++++++++++++++++++++++++---------------------
 gtk-dialog.h   |    3 +-
 gtk-ui.c       |  244 +++++--
 gtk-ui.h       |    3 +-
 otr-icons.h    |  508 ++++++++++++++
 otr-plugin.c   |  107 +--
 otr-plugin.h   |   10 +-
 po/ar.po       |  500 ++++++++++++++
 po/de.po       |  495 ++++++++++++++
 po/ru.po       |  495 ++++++++++++++
 tooltipmenu.c  |  252 +++++++
 tooltipmenu.h  |  123 ++++
 ui.c           |    5 +-
 ui.h           |    4 +-
 23 files changed, 4035 insertions(+), 908 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index f9406d8..091315a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,6 +2,7 @@ Off-the-Record Messaging plugin for pidgin
 
 Authors:
 
-    Ian Goldberg, Chris Alexander, Nikita Borisov <otr at cypherpunks.ca>
+    Ian Goldberg, Rob Smits, Chris Alexander, Nikita Borisov
+    <otr at cypherpunks.ca>
 
 See the README file for mailing list information
diff --git a/ChangeLog b/ChangeLog
index 49cbf35..d8ed418 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2008-05-28
+
+	* tooltipmenu.[ch]: New classes to allow tooltips on menus.
+
+	* otr-icons.h: New OTR icons from <cyrus_xiii at yahoo.com>.
+
+	* README:
+	* AUTHORS:
+	* *.[ch]: Update copyright dates to 2004-2008 and add Rob Smits
+	as an author. (Rob wrote the new gtk-dialog stuff to handle user
+	authentication with an explicit question, inserted inline OTR
+	icons into the conversation when the status changes, and moved
+	the OTR button to the menu bar.)
+
+	* gtk-ui.c: Updated variable names to reflect the (old) change
+	from "OTR Options" to "OTR Settings".
+
+	* ui.h:
+	* ui.c:
+	* gtk-ui.c: Added new OTR UI Options section of the
+	configuration panel, which currently controls only whether the
+	old OTR button will still show up.
+
+	* dialogs.h:
+	* dialogs.c:
+	* gtk-dialog.c: 
+	* otr-plugin.h:
+	* otr-plugin.c: Support starting the SMP authentication with an
+	explicit question.
+
+	* otr-plugin.c: Better handling of the case where an SMP message
+	fails a verification step.
+
+	* configure.ac:
+	* Makefile.mingw: Update version number to 3.2.0.
+
+	* gtk-dialog.c: Made new OTR menus (one master one, and one for
+	each active conversation in the window) that replace the old OTR
+	button.  [The old button is still available as an option, but
+	the menu is always present.]
+
+	* gtk-dialog.c: OTR icons are inserted inline into the
+	conversation when the OTR status changes.
+
+	* configure.ac:
+	* po/ar.po:
+	* po/de.po:
+	* po/ru.po: New translations:
+	Arabic (Ahmad Gharbeia ﺄﺤﻣﺩ ﻍﺮﺒﻳﺓ <gharbeia at gmail.com>),
+	German (Thorsten Mühlfelder <thenktor at gmx.de>),
+	Russian (Sergei Smirnov <moscow at hro.org>)
+
+	* dialogs.h: Help URLs now have version numbers in them, so the
+	appropriate help page can be served.
+
+	* Makefile.am: Include new files in compilation and distribution
+	targets.
+
 2007-07-28
 
 	* configure.ac: Fix PKG_CHECK_MODULES so that it gives a
diff --git a/Makefile.am b/Makefile.am
index 509a8c5..f5573f7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,11 +9,13 @@ plugindir=		${libdir}/pidgin
 
 plugin_LTLIBRARIES=	pidgin-otr.la
 
-pidgin_otr_la_SOURCES=	otr-plugin.c ui.c dialogs.c gtk-ui.c gtk-dialog.c
+pidgin_otr_la_SOURCES=	otr-plugin.c ui.c dialogs.c gtk-ui.c gtk-dialog.c \
+                        tooltipmenu.c
 pidgin_otr_la_LDFLAGS=	-module -avoid-version
 pidgin_otr_la_LDFLAGS+=	@LIBGCRYPT_LIBS@ @LIBOTR_LIBS@
 
 EXTRA_DIST=		dialogs.h gtk-dialog.h gtk-ui.h otr-plugin.h ui.h \
+			otr-icons.h tooltipmenu.h \
 			Makefile.mingw packaging/windows/pidgin-otr.nsi \
 			packaging/fedora/pidgin-otr.spec po/Makefile.mingw \
 			po/README intltool-extract.in intltool-merge.in \
diff --git a/Makefile.mingw b/Makefile.mingw
index 7f5a732..a8864b1 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -1,7 +1,7 @@
 WIN32=1
 
 # The version number to put in the plugin info
-PIDGIN_OTR_VERSION = 3.1.0
+PIDGIN_OTR_VERSION = 3.2.0
 
 # Name of the gettext domain
 GETTEXT_PACKAGE = pidgin-otr
diff --git a/NEWS b/NEWS
index 7e8296c..5dff01a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+28 May 2008:
+
+- The functionality of the OTR button has now moved to a menu.  There's
+  an "OTR" menu, as well as an icon showing the current OTR state of
+  each active conversation in the window.
+- New OTR icons from <cyrus_xiii at yahoo.com>
+- OTR icons show up inline in the conversation window when the OTR
+  status changes.
+- Buddy authentication has been revamped, based on the user study
+  published in SOUPS 2008.  The default is now to choose a question and
+  an answer only you and the buddy should know.  The question is
+  displayed to the buddy, who is prompted for the answer.  The "shared
+  secret" and "fingerprint" authentication methods are still available.
+- Translations for Arabic, German, Russian
+
 1 Aug 2007:
 - Released 3.1.0
 
diff --git a/README b/README
index 5502367..620b1c3 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 	       Off-the-Record Messaging plugin for pidgin
-			  v3.1.0,  1 Aug 2007
+			  v3.2.0, 27 May 2008
 
 This is a pidgin plugin which implements Off-the-Record (OTR) Messaging.
 It is known to work (at least) under the Linux and Windows versions of
@@ -32,7 +32,7 @@ checkbox next to it.  Click "Configure Plugin" to bring up the OTR UI.
 The UI has two "pages": "Config" and "Known fingerprints".
 
 The "Config" page allows you generate private keys, and to set OTR
-options.
+settings and options.
 
     Private keys are used to authenticate you to your buddies.  Choose
     one of your accounts from the menu, click "Generate" and wait until
@@ -43,12 +43,12 @@ options.
     Note that if you don't generate keys in this way, they will be
     generated automatically, when they are needed.
 
-    The OTR options determine when private messaging is enabled.  The
+    The OTR settings determine when private messaging is enabled.  The
     checkboxes on this page control the default settings; you can edit
     the per-buddy settings by right-clicking on your buddy in the buddy
-    list, and choosing "OTR Options" from the menu.
+    list, and choosing "OTR Settings" from the menu.
 
-    The options are:
+    The settings are:
     [X] Enable private messaging
       [X] Automatically initiate private messaging
         [ ] Require private messaging
@@ -93,7 +93,7 @@ instead.]
 If your buddy does have the OTR plugin (and it's enabled), a private
 conversation will be initiated.
 
-If both you and your buddy have OTR software, and your OTR options set
+If both you and your buddy have OTR software, and your OTR settings set
 to automatically initiate private messaging, your clients may recognize
 each other and automatically start a private conversation.
 
@@ -260,7 +260,8 @@ CONTACT
 To report problems, comments, suggestions, patches, etc., you can email
 the authors:
 
-Ian Goldberg, Chris Alexander, and Nikita Borisov <otr at cypherpunks.ca>
+Ian Goldberg, Rob Smits, Chris Alexander, and Nikita Borisov
+<otr at cypherpunks.ca>
 
 For more information on Off-the-Record Messaging, visit
 http://otr.cypherpunks.ca/
diff --git a/configure.ac b/configure.ac
index de38349..555e321 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce configure.
 
-AC_INIT(pidgin-otr, 3.1.0)
+AC_INIT(pidgin-otr, 3.2.0)
 
 AM_CONFIG_HEADER(config.h)
 
@@ -14,7 +14,7 @@ AM_PROG_LIBTOOL
 
 AM_PATH_LIBGCRYPT(1:1.2.0,,AC_MSG_ERROR(libgcrypt 1.2.0 or newer is required.))
 
-AM_PATH_LIBOTR(3.1.0,,AC_MSG_ERROR(libotr 3.1.0 or newer is required.))
+AM_PATH_LIBOTR(3.2.0,,AC_MSG_ERROR(libotr 3.2.0 or newer is required.))
 
 PKG_CHECK_MODULES([EXTRA], [glib-2.0 >= 2.6 gtk+-2.0 >= 2.6 pidgin >= 2.0 purple >= 2.0])
 
@@ -24,7 +24,7 @@ GETTEXT_PACKAGE=pidgin-otr
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define the gettext package to be used])
 
-ALL_LINGUAS="es fr nl sk"
+ALL_LINGUAS="ar de es fr nl ru sk"
 AM_GLIB_GNU_GETTEXT
 
 AC_OUTPUT([Makefile po/Makefile.in])
diff --git a/dialogs.c b/dialogs.c
index 997d8ba..d36ee02 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -140,7 +141,15 @@ void otrg_dialog_verify_fingerprint(Fingerprint *fprint)
 /* Show a dialog asking the user to give an SMP secret. */
 void otrg_dialog_socialist_millionaires(ConnContext *context)
 {
-    ui_ops->socialist_millionaires(context, TRUE);
+    ui_ops->socialist_millionaires(context, NULL, TRUE);
+}
+
+/* Show a dialog asking the user to give an SMP secret, prompting with a
+ * question. */
+void otrg_dialog_socialist_millionaires_q(ConnContext *context,
+	char *question)
+{
+    ui_ops->socialist_millionaires(context, question, TRUE);
 }
 
 /* Update the status of an ongoing socialist millionaires protocol. */
diff --git a/dialogs.h b/dialogs.h
index f3eaf64..970be94 100644
--- a/dialogs.h
+++ b/dialogs.h
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -28,12 +29,12 @@
 #include <libotr/message.h>
 
 /* The various help URLs */
-#define BASE_HELPURL "http://otr-help.cypherpunks.ca/"
+#define BASE_HELPURL "http://otr-help.cypherpunks.ca/" PIDGIN_OTR_VERSION "/"
 #define AUTHENTICATE_HELPURL  BASE_HELPURL "authenticate.php"
 #define FINGERPRINT_HELPURL   BASE_HELPURL "fingerprint.php"
 #define SESSIONID_HELPURL     BASE_HELPURL "sessionid.php"
 #define UNVERIFIED_HELPURL    BASE_HELPURL "unverified.php"
-#define BUTTON_HELPURL        BASE_HELPURL "buttonhelp.php"
+#define LEVELS_HELPURL        BASE_HELPURL "levels.php"
 
 typedef struct s_OtrgDialogWait *OtrgDialogWaitHandle;
 
@@ -59,7 +60,8 @@ typedef struct {
 
     void (*verify_fingerprint)(Fingerprint *fprint);
 
-    void (*socialist_millionaires)(ConnContext *context, gboolean responder);
+    void (*socialist_millionaires)(ConnContext *context, char *question,
+	    gboolean responder);
 
     void (*update_smp)(ConnContext *context, double progress_level);
 
@@ -139,6 +141,11 @@ void otrg_dialog_verify_fingerprint(Fingerprint *fprint);
 /* Show a dialog asking the user to give an SMP secret. */
 void otrg_dialog_socialist_millionaires(ConnContext *context);
 
+/* Show a dialog asking the user to give an SMP secret, prompting with a
+ * question. */
+void otrg_dialog_socialist_millionaires_q(ConnContext *context,
+	char *question);
+
 /* Update the status of an ongoing socialist millionaires protocol. */
 void otrg_dialog_update_smp(ConnContext *context, double progress_level);
 
diff --git a/gtk-dialog.c b/gtk-dialog.c
index 9ce4833..9312a9b 100644
--- a/gtk-dialog.c
+++ b/gtk-dialog.c
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -39,6 +40,9 @@
 #include "gtkutils.h"
 #include "gtkimhtml.h"
 #include "util.h"
+#include "core.h"
+#include "gtkmenutray.h"
+#include "tooltipmenu.h"
 
 #ifdef ENABLE_NLS
 /* internationalisation headers */
@@ -57,558 +61,24 @@
 #include "dialogs.h"
 #include "gtk-dialog.h"
 #include "ui.h"
+#include "otr-icons.h"
+
+static GHashTable * otr_win_menus = 0;
+static GHashTable * otr_win_status = 0;
+
+static int img_id_not_private = 0;
+static int img_id_unverified = 0;
+static int img_id_private = 0;
+static int img_id_finished = 0;
 
-/* The OTR icons */
-
-static const char * not_private_xpm[] = {
-"20 20 100 2",
-"  	c None",
-". 	c #555555",
-"+ 	c #5A5A5A",
-"@ 	c #404040",
-"# 	c #515151",
-"$ 	c #919191",
-"% 	c #9C9C9C",
-"& 	c #949494",
-"* 	c #848484",
-"= 	c #646464",
-"- 	c #161616",
-"; 	c #959595",
-"> 	c #B7B7B7",
-", 	c #C2C2C2",
-"' 	c #AFAFAF",
-") 	c #8F8F8F",
-"! 	c #7B7B7B",
-"~ 	c #4F4F4F",
-"{ 	c #5C5C5C",
-"] 	c #A8A8A8",
-"^ 	c #CECECE",
-"/ 	c #D4D4D4",
-"( 	c #B9B9B9",
-"_ 	c #7A7A7A",
-": 	c #686868",
-"< 	c #101010",
-"[ 	c #636363",
-"} 	c #A3A3A3",
-"| 	c #C4C4C4",
-"1 	c #888888",
-"2 	c #757575",
-"3 	c #6B6B6B",
-"4 	c #141414",
-"5 	c #9E9E9E",
-"6 	c #9D9D9D",
-"7 	c #8C8C8C",
-"8 	c #6D6D6D",
-"9 	c #0C0C0C",
-"0 	c #777777",
-"a 	c #808080",
-"b 	c #7E7E7E",
-"c 	c #767676",
-"d 	c #6C6C6C",
-"e 	c #373737",
-"f 	c #000000",
-"g 	c #313131",
-"h 	c #696969",
-"i 	c #606060",
-"j 	c #3D3D3D",
-"k 	c #707070",
-"l 	c #676767",
-"m 	c #626262",
-"n 	c #0E0E0E",
-"o 	c #020202",
-"p 	c #DADADA",
-"q 	c #B2B2B2",
-"r 	c #969696",
-"s 	c #898989",
-"t 	c #5E5E5E",
-"u 	c #5B5B5B",
-"v 	c #727272",
-"w 	c #303030",
-"x 	c #CFCFCF",
-"y 	c #A2A2A2",
-"z 	c #828282",
-"A 	c #7C7C7C",
-"B 	c #797979",
-"C 	c #CBCBCB",
-"D 	c #9F9F9F",
-"E 	c #747474",
-"F 	c #6E6E6E",
-"G 	c #9A9A9A",
-"H 	c #868686",
-"I 	c #272727",
-"J 	c #BFBFBF",
-"K 	c #909090",
-"L 	c #818181",
-"M 	c #7D7D7D",
-"N 	c #151515",
-"O 	c #878787",
-"P 	c #717171",
-"Q 	c #1A1A1A",
-"R 	c #8B8B8B",
-"S 	c #656565",
-"T 	c #292929",
-"U 	c #4D4D4D",
-"V 	c #1D1D1D",
-"W 	c #616161",
-"X 	c #3A3A3A",
-"Y 	c #525252",
-"Z 	c #464646",
-"` 	c #080808",
-" .	c #565656",
-"..	c #2E2E2E",
-"+.	c #262626",
-"@.	c #2F2F2F",
-"#.	c #535353",
-"$.	c #4B4B4B",
-"%.	c #111111",
-"&.	c #2C2C2C",
-"      . + @                             ",
-"  # $ % & * = -             . + @       ",
-"  ; > , ' ) ! ~         # $ % & * = -   ",
-"{ ] ^ / ( $ _ : <       ; > , ' ) ! ~   ",
-"[ } , | ] 1 2 3 4     { ] ^ / ( $ _ : < ",
-"# ) 5 6 7 _ 8 { 9     [ } , | ] 1 2 3 4 ",
-"  0 a b c d = e f     # ) 5 6 7 _ 8 { 9 ",
-"  g h d h i j . + @     0 a b c d = e f ",
-"  & k l m # $ % & * = - g h d h i j n o ",
-"  p q r s ; > , ' ) ! ~ & k l m t u v w ",
-"  x y 1 { ] ^ / ( $ _ : < q r s z A B m ",
-"  C D 1 [ } , | ] 1 2 3 4 y 1 b _ E F u ",
-"  | G H # ) 5 6 7 _ 8 { 9 D 1 b _ 2 8 I ",
-"  J K L _ 0 a b c d = e f G H M B E 3 N ",
-"  } O _ 2 g h d h i j n o K L _ c P : Q ",
-"  R M v 3 & k l m t u v w O _ 2 P d S T ",
-"  3 c h U p q r s z A B m V v 3 : l W X ",
-"  Y P Z ` x y 1 b _ E F u  ...U +. at .#.$.",
-"    i <   C D 1 b _ 2 8 I %. at .&.    n Z ",
-"          | G H M B E 3 N i <           "};
-
-static const char * unverified_xpm[] = {
-"20 20 103 2",
-"  	c None",
-". 	c #555555",
-"+ 	c #5A5A5A",
-"@ 	c #404040",
-"# 	c #000000",
-"$ 	c #515151",
-"% 	c #919191",
-"& 	c #9C9C9C",
-"* 	c #949494",
-"= 	c #848484",
-"- 	c #646464",
-"; 	c #161616",
-"> 	c #FFFF00",
-", 	c #959595",
-"' 	c #B7B7B7",
-") 	c #C2C2C2",
-"! 	c #AFAFAF",
-"~ 	c #8F8F8F",
-"{ 	c #7B7B7B",
-"] 	c #4F4F4F",
-"^ 	c #5C5C5C",
-"/ 	c #A8A8A8",
-"( 	c #CECECE",
-"_ 	c #D4D4D4",
-": 	c #B9B9B9",
-"< 	c #7A7A7A",
-"[ 	c #686868",
-"} 	c #101010",
-"| 	c #636363",
-"1 	c #A3A3A3",
-"2 	c #C4C4C4",
-"3 	c #888888",
-"4 	c #757575",
-"5 	c #6B6B6B",
-"6 	c #141414",
-"7 	c #9E9E9E",
-"8 	c #9D9D9D",
-"9 	c #8C8C8C",
-"0 	c #6D6D6D",
-"a 	c #0C0C0C",
-"b 	c #777777",
-"c 	c #808080",
-"d 	c #7E7E7E",
-"e 	c #767676",
-"f 	c #6C6C6C",
-"g 	c #373737",
-"h 	c #313131",
-"i 	c #696969",
-"j 	c #606060",
-"k 	c #3D3D3D",
-"l 	c #0E0E0E",
-"m 	c #020202",
-"n 	c #707070",
-"o 	c #676767",
-"p 	c #626262",
-"q 	c #5E5E5E",
-"r 	c #5B5B5B",
-"s 	c #727272",
-"t 	c #303030",
-"u 	c #DADADA",
-"v 	c #B2B2B2",
-"w 	c #969696",
-"x 	c #898989",
-"y 	c #828282",
-"z 	c #7C7C7C",
-"A 	c #797979",
-"B 	c #1D1D1D",
-"C 	c #CFCFCF",
-"D 	c #A2A2A2",
-"E 	c #747474",
-"F 	c #6E6E6E",
-"G 	c #565656",
-"H 	c #2E2E2E",
-"I 	c #CBCBCB",
-"J 	c #9F9F9F",
-"K 	c #272727",
-"L 	c #111111",
-"M 	c #2F2F2F",
-"N 	c #2C2C2C",
-"O 	c #9A9A9A",
-"P 	c #868686",
-"Q 	c #7D7D7D",
-"R 	c #151515",
-"S 	c #BFBFBF",
-"T 	c #909090",
-"U 	c #818181",
-"V 	c #717171",
-"W 	c #1A1A1A",
-"X 	c #878787",
-"Y 	c #656565",
-"Z 	c #292929",
-"` 	c #8B8B8B",
-" .	c #616161",
-"..	c #3A3A3A",
-"+.	c #4D4D4D",
-"@.	c #262626",
-"#.	c #535353",
-"$.	c #4B4B4B",
-"%.	c #525252",
-"&.	c #464646",
-"*.	c #080808",
-"=.	c #121212",
-"-.	c #242424",
-"      . + @               # # # # #     ",
-"  $ % & * = - ;         # > > > > > #   ",
-"  , ' ) ! ~ { ]       # > > > # > > > # ",
-"^ / ( _ : % < [ }     # > > #   # > > # ",
-"| 1 ) 2 / 3 4 5 6     # > > #   # > > # ",
-"$ ~ 7 8 9 < 0 ^ a     # > > #   # > > # ",
-"  b c d e f - g #       # #     # > > # ",
-"  h i f i j k l m             # > > > # ",
-"  * n o p q r s t             # > > #   ",
-"  u v w x y z A p B         # > > #     ",
-"  C D 3 d < E F r G H       # > #       ",
-"  I J 3 d < 4 0 K L M N     # > #       ",
-"  2 O P Q A E 5 R             #         ",
-"  S T U < e V [ W           # # #       ",
-"  1 X < 4 V f Y Z         # > > > #     ",
-"  ` Q s 5 [ o  ...        # > > > #     ",
-"  5 e i +. at .M #.$.m       # > > > #     ",
-"  %.V &.*.    l &.=.        # # #       ",
-"    j }           -.                    ",
-"                                        "};
-
-static const char * private_xpm[] = {
-"20 20 148 2",
-"  	c None",
-". 	c #978214",
-"+ 	c #A58A10",
-"@ 	c #77620A",
-"# 	c #85781D",
-"$ 	c #EBD437",
-"% 	c #F4DE44",
-"& 	c #F3D936",
-"* 	c #EFC819",
-"= 	c #C19207",
-"- 	c #2C1E01",
-"; 	c #EAD641",
-"> 	c #F6E978",
-", 	c #F7EB8D",
-"' 	c #F5E569",
-") 	c #F2D42C",
-"! 	c #EBB50C",
-"~ 	c #9C6302",
-"{ 	c #99891F",
-"] 	c #F5E45C",
-"^ 	c #F8EFA4",
-"/ 	c #F8F0B0",
-"( 	c #F6E97D",
-"_ 	c #F1D531",
-": 	c #E9B20C",
-"< 	c #CE7C02",
-"[ 	c #201000",
-"} 	c #AB961B",
-"| 	c #F4E252",
-"1 	c #F6EB8F",
-"2 	c #F6EC93",
-"3 	c #F4E25C",
-"4 	c #EECB22",
-"5 	c #E4A407",
-"6 	c #D67401",
-"7 	c #291400",
-"8 	c #8F7A13",
-"9 	c #F0D32E",
-"0 	c #F2DC4B",
-"a 	c #F2DB49",
-"b 	c #EECE2B",
-"c 	c #E6B10F",
-"d 	c #D88503",
-"e 	c #B95800",
-"f 	c #190A00",
-"g 	c #D9AE15",
-"h 	c #E7BC1A",
-"i 	c #E6B817",
-"j 	c #E0A60D",
-"k 	c #D58404",
-"l 	c #C76301",
-"m 	c #6E2E00",
-"n 	c #010000",
-"o 	c #58440B",
-"p 	c #C68E0C",
-"q 	c #D28A07",
-"r 	c #CE7904",
-"s 	c #BE5F02",
-"t 	c #793601",
-"u 	c #1A0F02",
-"v 	c #040300",
-"w 	c #A9A480",
-"x 	c #8A8156",
-"y 	c #9C8032",
-"z 	c #A27A23",
-"A 	c #9D7E1F",
-"B 	c #9C801A",
-"C 	c #C39D21",
-"D 	c #5B3B05",
-"E 	c #F5EEC0",
-"F 	c #F0E074",
-"G 	c #EAD243",
-"H 	c #E7C72C",
-"I 	c #E5BE20",
-"J 	c #E1B218",
-"K 	c #DDA615",
-"L 	c #C27003",
-"M 	c #3B1C00",
-"N 	c #F5ECA9",
-"O 	c #F1DE53",
-"P 	c #ECCD25",
-"Q 	c #E9C013",
-"R 	c #E8B50C",
-"S 	c #E2A307",
-"T 	c #D98B03",
-"U 	c #B66501",
-"V 	c #AC5201",
-"W 	c #5D2B00",
-"X 	c #F6ECA1",
-"Y 	c #F3DF4B",
-"Z 	c #F0CF21",
-"` 	c #EDC30F",
-" .	c #EBB709",
-"..	c #E5A405",
-"+.	c #D88603",
-"@.	c #4E2600",
-"#.	c #231000",
-"$.	c #5F2900",
-"%.	c #582300",
-"&.	c #F6EA93",
-"*.	c #F4DD40",
-"=.	c #F1CF1B",
-"-.	c #EEC10C",
-";.	c #EBB307",
-">.	c #E49D04",
-",.	c #D47A02",
-"'.	c #2B1500",
-").	c #F6E889",
-"!.	c #F2D72F",
-"~.	c #EFC614",
-"{.	c #ECB508",
-"].	c #E8A604",
-"^.	c #E09002",
-"/.	c #CF6E01",
-"(.	c #351800",
-"_.	c #EEDB59",
-":.	c #F0CB1E",
-"<.	c #EAB40B",
-"[.	c #E5A205",
-"}.	c #D87B01",
-"|.	c #C96101",
-"1.	c #532100",
-"2.	c #DCC33B",
-"3.	c #EAB811",
-"4.	c #E09804",
-"5.	c #D57D02",
-"6.	c #CD6601",
-"7.	c #C35600",
-"8.	c #742D00",
-"9.	c #BD9D19",
-"0.	c #E3A109",
-"a.	c #D17402",
-"b.	c #9A4801",
-"c.	c #4C2400",
-"d.	c #5E2900",
-"e.	c #A64300",
-"f.	c #963500",
-"g.	c #050200",
-"h.	c #957610",
-"i.	c #DC9107",
-"j.	c #8B4101",
-"k.	c #100600",
-"l.	c #1C0A00",
-"m.	c #8D3000",
-"n.	c #240B00",
-"o.	c #BB7B06",
-"p.	c #210E00",
-"q.	c #491800",
-"            . + @                       ",
-"        # $ % & * = -                   ",
-"        ; > , ' ) ! ~                   ",
-"      { ] ^ / ( _ : < [                 ",
-"      } | 1 2 3 4 5 6 7                 ",
-"      8 9 0 a b c d e f                 ",
-"        g h i j k l m n                 ",
-"        o p q r s t u v                 ",
-"        w x y z A B C D                 ",
-"        E F G H I J K L M               ",
-"        N O P Q R S T U V W             ",
-"        X Y Z `  ...+. at .#.$.%.          ",
-"        &.*.=.-.;.>.,.'.                ",
-"        ).!.~.{.].^./.(.                ",
-"        _.:.<.[.^.}.|.1.                ",
-"        2.3.4.5./.6.7.8.                ",
-"        9.0.a.b.c.d.e.f.g.              ",
-"        h.i.j.k.    l.m.n.              ",
-"          o.p.          q.              ",
-"                                        "};
-
-static const char * finished_xpm[] = {
-"20 20 101 2",
-"  	c None",
-". 	c #555555",
-"+ 	c #FF0000",
-"@ 	c #F31111",
-"# 	c #C94949",
-"$ 	c #C14242",
-"% 	c #B13232",
-"& 	c #8A0A0A",
-"* 	c #FE0000",
-"= 	c #DC5656",
-"- 	c #C2BFBF",
-"; 	c #AFAFAF",
-"> 	c #8F8F8F",
-", 	c #7B7B7B",
-"' 	c #4F4F4F",
-") 	c #C66D6D",
-"! 	c #CECECE",
-"~ 	c #D4D4D4",
-"{ 	c #B9B9B9",
-"] 	c #919191",
-"^ 	c #7A7A7A",
-"/ 	c #686868",
-"( 	c #101010",
-"_ 	c #9E3D3D",
-": 	c #A3A3A3",
-"< 	c #C2C2C2",
-"[ 	c #C4C4C4",
-"} 	c #A8A8A8",
-"| 	c #888888",
-"1 	c #757575",
-"2 	c #6B6B6B",
-"3 	c #141414",
-"4 	c #515151",
-"5 	c #9E9E9E",
-"6 	c #9D9D9D",
-"7 	c #8C8C8C",
-"8 	c #6D6D6D",
-"9 	c #5C5C5C",
-"0 	c #0C0C0C",
-"a 	c #777777",
-"b 	c #808080",
-"c 	c #7E7E7E",
-"d 	c #767676",
-"e 	c #6C6C6C",
-"f 	c #646464",
-"g 	c #373737",
-"h 	c #000000",
-"i 	c #313131",
-"j 	c #696969",
-"k 	c #606060",
-"l 	c #3D3D3D",
-"m 	c #0E0E0E",
-"n 	c #949494",
-"o 	c #707070",
-"p 	c #676767",
-"q 	c #626262",
-"r 	c #5E5E5E",
-"s 	c #5B5B5B",
-"t 	c #DADADA",
-"u 	c #B2B2B2",
-"v 	c #969696",
-"w 	c #898989",
-"x 	c #828282",
-"y 	c #1D1D1D",
-"z 	c #CFCFCF",
-"A 	c #A2A2A2",
-"B 	c #6E6E6E",
-"C 	c #565656",
-"D 	c #2E2E2E",
-"E 	c #CBCBCB",
-"F 	c #9F9F9F",
-"G 	c #272727",
-"H 	c #111111",
-"I 	c #2F2F2F",
-"J 	c #2C2C2C",
-"K 	c #9A9A9A",
-"L 	c #797979",
-"M 	c #747474",
-"N 	c #151515",
-"O 	c #BFBFBF",
-"P 	c #717171",
-"Q 	c #1A1A1A",
-"R 	c #656565",
-"S 	c #292929",
-"T 	c #7D7D7D",
-"U 	c #727272",
-"V 	c #616161",
-"W 	c #3A3A3A",
-"X 	c #9B4848",
-"Y 	c #4D4D4D",
-"Z 	c #262626",
-"` 	c #535353",
-" .	c #4B4B4B",
-"..	c #020202",
-"+.	c #C13030",
-"@.	c #4F4242",
-"#.	c #080808",
-"$.	c #464646",
-"%.	c #121212",
-"&.	c #FC0000",
-"*.	c #DE0505",
-"            . + + + + +                 ",
-"        + + @ # $ % & + + + +           ",
-"      + * = - ; > , '       + +         ",
-"    + * ) ! ~ { ] ^ / (       + +       ",
-"    + _ : < [ } | 1 2 3     + + +       ",
-"  + + 4 > 5 6 7 ^ 8 9 0   + +   + +     ",
-"  +     a b c d e f g h + +       +     ",
-"+ +     i j e j k l m + +         + +   ",
-"+ +     n o p q r s + +           + +   ",
-"+       t u v w x + + q y           +   ",
-"+       z A | c + + B s C D       + +   ",
-"+ +     E F | + + 1 8 G H I J     + +   ",
-"+ +     [ K + + L M 2 N           + +   ",
-"  +     O + + ^ d P / Q           +     ",
-"  + +   + + ^ 1 P e R S         + +     ",
-"    + + + T U 2 / p V W         +       ",
-"    + + X d j Y Z I `  ...    + +       ",
-"      + + +. at .#.    m $.%.  + +         ",
-"        + + &.+       + *.+ +           ",
-"              + + + + +                 "};
 
 typedef struct {
-    ConnContext *context;  /* The context used to fire library code */
-    GtkEntry *entry;	   /* The text entry field containing the secret */
-    gboolean responder;	   /* Whether or not this is the first side to give
-			      their secret */
+    ConnContext *context;       /* The context used to fire library code */
+    GtkEntry* question_entry;       /* The text entry field containing the user question */
+    GtkEntry *entry;	        /* The text entry field containing the secret */
+    int smp_type;               /* Whether the SMP type is based on question challenge (0) or shared secret (1) */
+    gboolean responder;	        /* Whether or not this is the first side to give
+			                       their secret */
 } SmpResponsePair;
 
 /* The response code returned by pushing the "Advanced..." button on the
@@ -625,6 +95,16 @@ typedef struct dialog_context_data {
     GtkWidget       *smp_progress_label;
 } SMPData;
 
+typedef struct {
+    GtkWidget       *one_way;
+    GtkEntry        *one_way_entry;
+    SmpResponsePair *smppair;
+    GtkWidget       *two_way;
+    GtkEntry        *two_way_entry;
+    GtkWidget       *fingerprint;
+    GtkWidget       *notebook;
+} AuthSignalData;
+
 static void close_progress_window(SMPData *smp_data)
 {
     if (smp_data->smp_progress_dialog) {
@@ -667,27 +147,28 @@ static void otrg_gtk_dialog_add_smp_data(PurpleConversation *conv)
     purple_conversation_set_data(conv, "otr-smpdata", smp_data);
 }
 
-static GtkWidget *otr_icon(GtkWidget *image, TrustLevel level)
+static GtkWidget *otr_icon(GtkWidget *image, TrustLevel level,
+	gboolean sensitivity)
 {
     GdkPixbuf *pixbuf = NULL;
-    const char **data = NULL;
+    const guint8 *data = NULL;
 
     switch(level) {
 	case TRUST_NOT_PRIVATE:
-	    data = not_private_xpm;
+	    data = not_private_pixbuf;
 	    break;
 	case TRUST_UNVERIFIED:
-	    data = unverified_xpm;
+	    data = unverified_pixbuf;
 	    break;
 	case TRUST_PRIVATE:
-	    data = private_xpm;
+	    data = private_pixbuf;
 	    break;
 	case TRUST_FINISHED:
-	    data = finished_xpm;
+	    data = finished_pixbuf;
 	    break;
     }
 
-    pixbuf = gdk_pixbuf_new_from_xpm_data(data);
+    pixbuf = gdk_pixbuf_new_from_inline(-1, data, FALSE, NULL);
     if (image) {
 	gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf);
     } else {
@@ -695,6 +176,8 @@ static GtkWidget *otr_icon(GtkWidget *image, TrustLevel level)
     }
     gdk_pixbuf_unref(pixbuf);
 
+    gtk_widget_set_sensitive (image, sensitivity);
+
     return image;
 }
 
@@ -703,8 +186,12 @@ static void message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget)
     gtk_widget_destroy(GTK_WIDGET(widget));
 }
 
-/* Forward declarations for the benefit of smp_message_response_cb */
+/* Forward declarations for the benefit of smp_message_response_cb/redraw authvbox */
 static void verify_fingerprint(GtkWindow *parent, Fingerprint *fprint);
+static void add_vrfy_fingerprint(GtkWidget *vbox, void *data);
+static struct vrfy_fingerprint_data* vrfy_fingerprint_data_new(Fingerprint *fprint);
+static void conversation_switched ( PurpleConversation *conv, void * data );
+
 static GtkWidget *create_smp_progress_dialog(GtkWindow *parent,
 	ConnContext *context);
 
@@ -743,60 +230,91 @@ static void smp_progress_response_cb(GtkDialog *dialog, gint response,
  * the entered secret as well as the current context.
  */
 static void smp_secret_response_cb(GtkDialog *dialog, gint response,
-	SmpResponsePair *smppair)
+	AuthSignalData *auth_opt_data)
 {
     ConnContext* context;
     PurpleConversation *conv;
     SMPData *smp_data;
+    SmpResponsePair *smppair;
 
+    if (!auth_opt_data) return;
+    
+    smppair = auth_opt_data->smppair;
+    
     if (!smppair) return;
 
     context = smppair->context;
-    if (response == GTK_RESPONSE_ACCEPT) {
-	GtkEntry* entry = smppair->entry;
-	char *secret;
-	size_t secret_len;
 
-	if (context == NULL || context->msgstate != OTRL_MSGSTATE_ENCRYPTED)
-		return;
+    if (response == GTK_RESPONSE_ACCEPT && smppair->entry) {
+        GtkEntry* entry = smppair->entry;
+        char *secret;
+        size_t secret_len;
 
-	secret = g_strdup(gtk_entry_get_text(entry));
+        GtkEntry* question_entry = smppair->question_entry;
+    
+        const char *user_question = NULL;
 
-	secret_len = strlen(secret);
 
-	if (smppair->responder) {
-	    otrg_plugin_continue_smp(context, (const unsigned char *)secret,
-		    secret_len);
-	} else {
-	    otrg_plugin_start_smp(context, (const unsigned char *)secret,
-		    secret_len);
-	}
-	g_free(secret);
+        if (context == NULL || context->msgstate != OTRL_MSGSTATE_ENCRYPTED) {
+            return;
+        }
+    
+        secret = g_strdup(gtk_entry_get_text(entry));
+        secret_len = strlen(secret);
+
+        if (smppair->responder) {
+            otrg_plugin_continue_smp(context, (const unsigned char *)secret,
+                secret_len);
+            
+        } else {
+            
+            if (smppair->smp_type == 0) {
+                if (!question_entry) {
+                    return;
+                }
+              
+                user_question = gtk_entry_get_text(question_entry);
+        
+                if (user_question == NULL || strlen(user_question) == 0) {
+                    return;
+                }
+            }
+
+            /* pass user question here */
+            otrg_plugin_start_smp(context, user_question,
+	           (const unsigned char *)secret, secret_len);
+
+        }
+    
+        g_free(secret);
 
-	/* launch progress bar window */
-	create_smp_progress_dialog(GTK_WINDOW(dialog), context);
+        /* launch progress bar window */
+        create_smp_progress_dialog(GTK_WINDOW(dialog), context);
     } else if (response == OTRG_RESPONSE_ADVANCED) {
-	ConnContext* context = smppair->context;
+        ConnContext* context = smppair->context;
 
-	if (context == NULL || context->msgstate != OTRL_MSGSTATE_ENCRYPTED)
-		return;
+        if (context == NULL || context->msgstate != OTRL_MSGSTATE_ENCRYPTED)
+		  return;
 
-	verify_fingerprint(GTK_WINDOW(dialog), context->active_fingerprint);
+        verify_fingerprint(GTK_WINDOW(dialog), context->active_fingerprint);
     } else {
         otrg_plugin_abort_smp(context);
     }
+    
     /* In all cases, destroy the current window */
     gtk_widget_destroy(GTK_WIDGET(dialog));
     
     /* Clean up references to this window */
     conv = otrg_plugin_context_to_conv(smppair->context, 0);
     smp_data = purple_conversation_get_data(conv, "otr-smpdata");
+    
     if (smp_data) {
-	smp_data->smp_secret_dialog = NULL;
-	smp_data->smp_secret_smppair = NULL;
+        smp_data->smp_secret_dialog = NULL;
+        smp_data->smp_secret_smppair = NULL;
     }
 
-    /* Free the smppair memory */
+    /* Free memory */
+    free(auth_opt_data);
     free(smppair);
 }
 
@@ -944,153 +462,488 @@ static void add_whatsthis_more(GtkWidget *vbox, const char *whatsthismarkup,
     gtk_widget_set_size_request(scrl, -1, 6 * (font->ascent + font->descent));
 }
 
-static GtkWidget *create_smp_dialog(const char *title,
-	const char *primary, const char *secondary, int sensitive,
-	GtkWidget **labelp, ConnContext *context, gboolean responder)
-{
-    GtkWidget *dialog;
 
-    PurpleConversation *conv = otrg_plugin_context_to_conv(context, 1);
-    SMPData *smp_data = purple_conversation_get_data(conv, "otr-smpdata");
+static void add_to_vbox_init_one_way_auth(GtkWidget *vbox, ConnContext *context,
+        AuthSignalData *auth_opt_data, char *question) {
+    GtkWidget *question_entry;
+    GtkWidget *entry;
+    GtkWidget *label;
+    GtkWidget *label2;
+    
+    char *moremarkup;
+    char *label_text;   
+    
+    SmpResponsePair* smppair = auth_opt_data->smppair;
+    
+    if (smppair->responder) {
+        label_text = g_strdup_printf(_("%s wishes to authenticate you. Your "
+          "buddy has chosen a question for you to answer.\n"), context->username);
+    } else {
+        label_text = g_strdup_printf(_("Enter a question only %s and "
+          "yourself can answer.\n"), context->username);
+    }
 
-    close_progress_window(smp_data);
-    if (!(smp_data->smp_secret_dialog)) {
-	GtkWidget *advbutton;
-	GtkWidget *buttonspacer;
-	GtkWidget *hbox;
-	GtkWidget *vbox;
-	GtkWidget *entry;
-	GtkWidget *label;
-	GtkWidget *label2;
-	GtkWidget *img = NULL;
-	char *label_text;
-	const char *icon_name = NULL;
-	SmpResponsePair* smppair;
-	char *moremarkup;
-
-	icon_name = PIDGIN_STOCK_DIALOG_INFO;
-	img = gtk_image_new_from_stock(icon_name, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
-	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+    label = gtk_label_new(NULL);
 
-	dialog = gtk_dialog_new_with_buttons(title ? title : PIDGIN_ALERT_TITLE, NULL, 0,
-				     GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
-				     GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
-	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
-		GTK_RESPONSE_ACCEPT);
+    gtk_label_set_markup(GTK_LABEL(label), label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+       
+       
+    if (smppair->responder) {
+        label_text = g_strdup_printf(_("This is the question asked by "
+		    "your buddy:"));
+    } else {
+        label_text = g_strdup_printf("Enter question here:");
+    }
+    
+    label = gtk_label_new(label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    
+
+    
+    if (smppair->responder && question) {
+        label_text = g_markup_printf_escaped("<span background=\"white\" foreground=\"black\" weight=\"bold\">%s</span>", question);
+        label = gtk_label_new(NULL);
+        gtk_label_set_markup (GTK_LABEL(label), label_text);
+        gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+        g_free(label_text);
+        gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+        gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+        smppair->question_entry = NULL;
+    } else {
+        /* Create the text view where the user enters their question */
+        question_entry = gtk_entry_new ();
+        smppair->question_entry = GTK_ENTRY(question_entry);
+        gtk_box_pack_start(GTK_BOX(vbox), question_entry, FALSE, FALSE, 0);
+    }
+    
+    if (context->active_fingerprint->trust &&
+        context->active_fingerprint->trust[0] && !(smppair->responder)) {
+        label2 = gtk_label_new(_("This buddy is already authenticated."));
+    } else {
+        label2 = NULL;
+    }
 
-	/* Create the Advanced... button, and left-justify it.  This
-	 * involves adding the button, and a blank label as a spacer, and
-	 * reordering them so that they're at the beginning. */
-	advbutton = gtk_dialog_add_button(GTK_DIALOG(dialog), _("Advanced..."),
-		OTRG_RESPONSE_ADVANCED);
-	buttonspacer = gtk_label_new("");
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
-		buttonspacer, TRUE, TRUE, 0);
-	gtk_box_reorder_child(GTK_BOX(GTK_DIALOG(dialog)->action_area),
-		advbutton, 0);
-	gtk_box_reorder_child(GTK_BOX(GTK_DIALOG(dialog)->action_area),
-		buttonspacer, 1);
-
-	gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
-	        GTK_RESPONSE_ACCEPT, sensitive);
-
-	gtk_window_set_focus_on_map(GTK_WINDOW(dialog), !responder);
-	gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog");
-
-	gtk_container_set_border_width(GTK_CONTAINER(dialog), 6);
-	gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
-	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
-	gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 12);
-	gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6);
-
-	hbox = gtk_hbox_new(FALSE, 12);
-	vbox = gtk_vbox_new(FALSE, 0);
-	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
+    
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    
+    /* Leave a blank line */
+    gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
+        FALSE, 0);
 
-	gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+    label_text = g_strdup_printf(_("Enter secret answer here "
+		"(case sensitive):"));
 
-	label_text = g_strdup_printf(
-	       "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
-	       (primary ? primary : ""),
-	       (primary ? "\n\n" : ""),
-	       (secondary ? secondary : ""));
+    label = gtk_label_new(NULL);
 
-	label = gtk_label_new(NULL);
+    gtk_label_set_markup(GTK_LABEL(label), label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
-	gtk_label_set_markup(GTK_LABEL(label), label_text);
-	gtk_label_set_selectable(GTK_LABEL(label), 1);
-	g_free(label_text);
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-       
-	/* Create the text view where the user enters their secret */
-	entry = gtk_entry_new();
-	gtk_entry_set_text(GTK_ENTRY(entry), _("Enter secret here"));
-	gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
-
-	if (context->active_fingerprint->trust &&
-		context->active_fingerprint->trust[0]) {
-	    label2 = gtk_label_new(_("This buddy is already authenticated."));
-	} else {
-	    label2 = NULL;
-	}
+    /* Create the text view where the user enters their secret */
+    entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(entry), _(""));
 
-	gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-	
-	/* Leave a blank line */
-	gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
-		FALSE, 0);
-	if (label2) {
-	    gtk_box_pack_start(GTK_BOX(vbox), label2, FALSE, FALSE, 0);
-	    gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
-		    FALSE, 0);
-	}
+    auth_opt_data->one_way_entry = GTK_ENTRY(entry);
+    gtk_entry_set_activates_default(GTK_ENTRY(entry), smppair->responder);
 
+    gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    
+    /* Leave a blank line */
+    gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
+        FALSE, 0);
+        
+    if (label2) {
+        gtk_box_pack_start(GTK_BOX(vbox), label2, FALSE, FALSE, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
+            FALSE, 0);
+    }
+    
+    if (smppair->responder && question) {
 	moremarkup = g_strdup_printf(
-		"%s\n\n%s\n\n<a href=\"%s%s\">%s</a>",
-		_("To authenticate, pick a secret known "
-		    "only to you and your buddy.  Enter this secret, then "
-		    "wait for your buddy to enter it too.  If the secrets "
-		    "don't match, then you may be talking to an imposter."),
-		_("If your buddy uses multiple IM accounts or multiple "
-		    "computers, you may have to authenticate multiple "
-		    "times.  However, as long as they use an account and "
-		    "computer that you've seen before, you don't need to "
-		    "authenticate each individual conversation."),
-		AUTHENTICATE_HELPURL, _("?lang=en"),
-		_("Click here for more information about authentication "
-		    "in OTR."));
-
-	add_whatsthis_more(vbox,
-		_("Authenticating a buddy helps ensure that the person "
-		    "you are talking to is who they claim to be."),
-		moremarkup);
-
-	g_free(moremarkup);
-	
-	gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+	    "%s\n\n%s\n\n<a href=\"%s%s\">%s</a>",
+	    _("Your buddy is attempting to determine if he or she is really "
+		"talking to you, or if it's someone pretending to be you.  "
+		"Your buddy has asked a question, indicated above.  "
+		"To authenticate to your buddy, enter the answer and "
+		"click OK."),
+	    _("If your buddy uses multiple IM accounts or multiple "
+		"computers, you may have to authenticate multiple "
+		"times.  However, as long as he or she uses an account and "
+		"computer that you've seen before, you don't need to "
+		"authenticate each individual conversation."),
+	    AUTHENTICATE_HELPURL, _("?lang=en"),
+	    _("Click here for more information about authentication "
+            "in OTR."));
+    } else {
+	moremarkup = g_strdup_printf(
+	    "%s\n\n%s\n\n<a href=\"%s%s\">%s</a>",
+	    _("To authenticate using a question, pick a question whose "
+		"answer is known only to you and your buddy.  Enter this "
+		"question and this answer, then wait for your buddy to "
+		"enter the answer too.  If the answers "
+		"don't match, then you may be talking to an imposter."),
+	    _("If your buddy uses multiple IM accounts or multiple "
+		"computers, you may have to authenticate multiple "
+		"times.  However, as long as he or she uses an account and "
+		"computer that you've seen before, you don't need to "
+		"authenticate each individual conversation."),
+	    AUTHENTICATE_HELPURL, _("?lang=en"),
+	    _("Click here for more information about authentication "
+            "in OTR."));
+    }
+
+    add_whatsthis_more(vbox,
+        _("Authenticating a buddy helps ensure that the person "
+            "you are talking to is who he or she claims to be."),
+        moremarkup);
+
+    g_free(moremarkup);
+}
 
-	smppair = malloc(sizeof(SmpResponsePair));
-	smppair->context = context;
-	smppair->entry = GTK_ENTRY(entry);
-	smppair->responder = responder;
-	g_signal_connect(G_OBJECT(dialog), "response",
-			 G_CALLBACK(smp_secret_response_cb),
-			 smppair);
+static void add_to_vbox_init_two_way_auth(GtkWidget *vbox,
+	ConnContext *context, AuthSignalData *auth_opt_data) {
+    GtkWidget *entry;
+    GtkWidget *label;
+    GtkWidget *label2;
+    
+    char *moremarkup;
+    char *label_text;   
+    
+    label_text = g_strdup_printf(_("Enter a secret known only to %s and "
+      "yourself.\n"), context->username);
 
-	gtk_widget_show_all(dialog);
-	smp_data->smp_secret_dialog = dialog;
-	smp_data->smp_secret_smppair = smppair;
+    label = gtk_label_new(NULL);
 
-	if (labelp) *labelp = label;
+    gtk_label_set_markup(GTK_LABEL(label), label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+       
+    label_text = g_strdup_printf("Enter secret here:");
+    label = gtk_label_new(label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+        
+       
+    /* Create the text view where the user enters their secret */
+    entry = gtk_entry_new();
+    gtk_entry_set_text(GTK_ENTRY(entry), _(""));
+    gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+    auth_opt_data->two_way_entry = GTK_ENTRY(entry);
+
+    if (context->active_fingerprint->trust &&
+        context->active_fingerprint->trust[0]) {
+        label2 = gtk_label_new(_("This buddy is already authenticated."));
     } else {
-	/* Set the responder field to TRUE if we were passed that value,
-	 * even if the window was already up. */
-	if (responder) {
-	    smp_data->smp_secret_smppair->responder = responder;
-	}
+        label2 = NULL;
+    }
+
+    gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    
+    /* Leave a blank line */
+    gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
+        FALSE, 0);
+        
+    if (label2) {
+        gtk_box_pack_start(GTK_BOX(vbox), label2, FALSE, FALSE, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(NULL), FALSE,
+            FALSE, 0);
+    }
+    
+    moremarkup = g_strdup_printf(
+        "%s\n\n%s\n\n<a href=\"%s%s\">%s</a>",
+        _("To authenticate, pick a secret known "
+            "only to you and your buddy.  Enter this secret, then "
+            "wait for your buddy to enter it too.  If the secrets "
+            "don't match, then you may be talking to an imposter."),
+        _("If your buddy uses multiple IM accounts or multiple "
+            "computers, you may have to authenticate multiple "
+            "times.  However, as long as he or she uses an account and "
+            "computer that you've seen before, you don't need to "
+            "authenticate each individual conversation."),
+        AUTHENTICATE_HELPURL, _("?lang=en"),
+        _("Click here for more information about authentication "
+            "in OTR."));
+
+    add_whatsthis_more(vbox,
+        _("Authenticating a buddy helps ensure that the person "
+            "you are talking to is who he or she claims to be."),
+        moremarkup);
+
+    g_free(moremarkup);
+}
+
+static void add_to_vbox_verify_fingerprint(GtkWidget *vbox, ConnContext *context, SmpResponsePair* smppair) {
+    char our_hash[45], their_hash[45];
+    GtkWidget *label;
+    char *label_text;
+    struct vrfy_fingerprint_data *vfd;
+    PurplePlugin *p;
+    char *proto_name;
+    Fingerprint *fprint = context->active_fingerprint;
+
+    if (fprint == NULL) return;
+    if (fprint->fingerprint == NULL) return;
+    context = fprint->context;
+    if (context == NULL) return;
+
+
+    vfd = vrfy_fingerprint_data_new(fprint);
+
+    strcpy(our_hash, _("[none]"));
+    otrl_privkey_fingerprint(otrg_plugin_userstate, our_hash,
+        context->accountname, context->protocol);
+
+    otrl_privkey_hash_to_human(their_hash, fprint->fingerprint);
+
+    p = purple_find_prpl(context->protocol);
+    proto_name = (p && p->info->name) ? p->info->name : _("Unknown");
+    label_text = g_strdup_printf(_("Fingerprint for you, %s (%s):\n%s\n\n"
+        "Purported fingerprint for %s:\n%s\n"), context->accountname,
+        proto_name, our_hash, context->username, their_hash);
+        
+    label = gtk_label_new(NULL);
+    
+    gtk_label_set_markup(GTK_LABEL(label), label_text);
+    gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+    g_free(label_text);
+    gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+    gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+        
+    add_vrfy_fingerprint(vbox, vrfy_fingerprint_data_new(fprint));
+}
+
+static void redraw_auth_vbox(GtkToggleButton *togglebutton, void *data) {
+    AuthSignalData *auth_data = (AuthSignalData*) data;
+
+    GtkWidget *notebook = auth_data != NULL ? auth_data->notebook : NULL;
+    
+    if (auth_data == NULL) return;
+    
+    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auth_data->one_way)) == TRUE) {
+        gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 0);
+        auth_data->smppair->entry = auth_data->one_way_entry;
+        auth_data->smppair->smp_type = 0;
+    } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auth_data->two_way)) == TRUE) {
+        gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 1);
+        auth_data->smppair->entry = auth_data->two_way_entry;
+        auth_data->smppair->smp_type = 1;
+    } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auth_data->fingerprint)) == TRUE) {
+        auth_data->smppair->entry = NULL;
+        gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 2);
+        auth_data->smppair->smp_type = -1;
+    }
+    
+}
+
+static void add_other_authentication_options(GtkWidget *dialog,
+	GtkWidget *notebook, ConnContext *context, AuthSignalData *data) {
+    GtkWidget *expander;
+    GtkWidget *ebox;
+    GtkWidget *frame;
+    GtkWidget *one_way_smp;
+    GtkWidget *two_way_smp;
+    GtkWidget *fingerprint;  
+
+    expander = gtk_expander_new_with_mnemonic(_("Other Authentication Options"));
+
+    gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->vbox), expander, FALSE, FALSE, 0);
+
+
+    frame = gtk_frame_new(NULL);
+    gtk_container_add(GTK_CONTAINER(expander), frame);
+    ebox = gtk_vbox_new(FALSE, 10);
+    gtk_container_add(GTK_CONTAINER(frame), ebox);
+
+    
+  
+   one_way_smp = gtk_radio_button_new_with_label(NULL, _("Authenticate by posing a question only your buddy will know"));
+   two_way_smp = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (one_way_smp),
+                            _("Authenticate each other using a predetermined shared secret phrase"));
+   fingerprint = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (one_way_smp),
+                            _("Authenticate by verifying your buddy's fingerprint (Advanced)"));       
+                                             
+   gtk_box_pack_start(GTK_BOX(ebox), one_way_smp, FALSE, FALSE, 0);
+   gtk_box_pack_start(GTK_BOX(ebox), two_way_smp, FALSE, FALSE, 0);
+   gtk_box_pack_start(GTK_BOX(ebox), fingerprint, FALSE, FALSE, 0);
+
+   data->notebook = notebook;
+   data->one_way = one_way_smp;
+   data->two_way = two_way_smp;
+   data->fingerprint = fingerprint;
+   
+   g_signal_connect (one_way_smp, "toggled",
+                  G_CALLBACK (redraw_auth_vbox), data);
+                  
+   g_signal_connect (two_way_smp, "toggled",
+                  G_CALLBACK (redraw_auth_vbox), data);
+                  
+   g_signal_connect (fingerprint, "toggled",
+                  G_CALLBACK (redraw_auth_vbox), data);
+                        
+}
+
+
+static GtkWidget *create_smp_dialog(const char *title,
+    const char *primary, const char *secondary, int sensitive,
+    GtkWidget **labelp, ConnContext *context, gboolean responder,
+    char *question)
+{
+    GtkWidget *dialog;
+
+    PurpleConversation *conv = otrg_plugin_context_to_conv(context, 1);
+    SMPData *smp_data = purple_conversation_get_data(conv, "otr-smpdata");
+
+    close_progress_window(smp_data);
+    
+    if (!(smp_data->smp_secret_dialog)) {
+        GtkWidget *hbox;
+        GtkWidget *vbox;
+        GtkWidget *auth_vbox;
+        GtkWidget *label;
+        GtkWidget *img = NULL;
+        char *label_text;
+        const char *icon_name = NULL;
+        SmpResponsePair* smppair;
+        GtkWidget *notebook;
+        AuthSignalData *auth_opt_data;     
+    
+        icon_name = PIDGIN_STOCK_DIALOG_INFO;
+        img = gtk_image_new_from_stock(icon_name,
+		gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
+        gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
+    
+        dialog = gtk_dialog_new_with_buttons(title ? title :
+		PIDGIN_ALERT_TITLE, NULL, 0,
+                         GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
+                         GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
+        gtk_dialog_set_default_response(GTK_DIALOG(dialog),
+		GTK_RESPONSE_ACCEPT);
+    
+        auth_vbox = gtk_vbox_new(FALSE, 0);
+        hbox = gtk_hbox_new(FALSE, 15);
+        vbox = gtk_vbox_new(FALSE, 0);
+        
+        smppair = malloc(sizeof(SmpResponsePair));
+        smppair->responder = responder;
+        smppair->context = context;
+        
+        
+        notebook = gtk_notebook_new();
+        auth_opt_data = malloc(sizeof(AuthSignalData)); 
+        auth_opt_data->smppair = smppair;
+        
+        if (!responder) {
+            add_other_authentication_options(dialog, notebook, context, auth_opt_data);
+        }
+        
+        gtk_window_set_focus_on_map(GTK_WINDOW(dialog), !responder);
+        gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog");
+    
+        gtk_container_set_border_width(GTK_CONTAINER(dialog), 6);
+        gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
+        gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+        gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), 12);
+        gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), 6);
+    
+        gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox);
+    
+        gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+    
+        label_text = g_strdup_printf(
+               "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
+               (primary ? primary : ""),
+               (primary ? "\n\n" : ""),
+               (secondary ? secondary : ""));
+    
+        label = gtk_label_new(NULL);
+    
+        gtk_label_set_markup(GTK_LABEL(label), label_text);
+        gtk_label_set_selectable(GTK_LABEL(label), FALSE);
+        g_free(label_text);
+        gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+        gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    
+        g_signal_connect(G_OBJECT(dialog), "response",
+                 G_CALLBACK(smp_secret_response_cb),
+                 auth_opt_data);
+    
+        if (!responder || (responder && question != NULL)) {
+            GtkWidget *one_way_vbox = gtk_vbox_new(FALSE, 0);
+            add_to_vbox_init_one_way_auth(one_way_vbox, context, auth_opt_data, question);
+            gtk_notebook_append_page(GTK_NOTEBOOK(notebook), one_way_vbox,
+                gtk_label_new(_("0")));
+            smppair->entry = auth_opt_data->one_way_entry;
+            smppair->smp_type = 0;
+        }
+        
+        if (!responder || (responder && question == NULL)) {
+            GtkWidget *two_way_vbox = gtk_vbox_new(FALSE, 0);
+            add_to_vbox_init_two_way_auth(two_way_vbox, context, auth_opt_data);
+            gtk_notebook_append_page(GTK_NOTEBOOK(notebook), two_way_vbox,
+                gtk_label_new(_("1")));
+                    
+            if (responder && question == NULL) {
+                smppair->entry = auth_opt_data->two_way_entry;
+                smppair->smp_type = 1;
+            }
+        }
+        
+        if (!responder) {
+            GtkWidget *fingerprint_vbox = gtk_vbox_new(FALSE, 0);
+            add_to_vbox_verify_fingerprint(fingerprint_vbox, context, smppair);
+            gtk_notebook_append_page(GTK_NOTEBOOK(notebook), fingerprint_vbox,
+                gtk_label_new(_("2")));
+        }
+        
+        gtk_notebook_set_show_tabs (GTK_NOTEBOOK(notebook), FALSE);
+        
+        gtk_notebook_set_show_border (GTK_NOTEBOOK(notebook), FALSE);
+        gtk_box_pack_start(GTK_BOX(auth_vbox), notebook, FALSE, FALSE, 0);
+        gtk_widget_show(notebook);
+    
+    
+        gtk_box_pack_start(GTK_BOX(vbox), auth_vbox, FALSE, FALSE, 0);
+        
+        gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+    
+        gtk_widget_show_all(dialog);
+        
+        gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 0);
+        
+        smp_data->smp_secret_dialog = dialog;
+        smp_data->smp_secret_smppair = smppair;
+    
+        if (labelp) *labelp = label;
+    
+    } else {
+        /* Set the responder field to TRUE if we were passed that value,
+         * even if the window was already up. */
+        if (responder) {
+            smp_data->smp_secret_smppair->responder = responder;
+        }
     }
 
     return smp_data->smp_secret_dialog;
@@ -1116,7 +969,10 @@ static GtkWidget *create_smp_progress_dialog(GtkWindow *parent,
 	    gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE));
     gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
 
-    dialog = gtk_dialog_new_with_buttons(_("Authenticating Buddy"),
+    dialog = gtk_dialog_new_with_buttons(
+	    context->smstate->received_question ?
+	    _("Authenticating to Buddy") :
+	    _("Authenticating Buddy"),
 	    parent, 0, GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
 	    GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
     gtk_dialog_set_default_response(GTK_DIALOG(dialog),
@@ -1143,7 +999,8 @@ static GtkWidget *create_smp_progress_dialog(GtkWindow *parent,
 
     label_text = g_strdup_printf(
 	       "<span weight=\"bold\" size=\"larger\">%s %s</span>\n",
-	       _("Authenticating"), context->username);
+	       context->smstate->received_question ? _("Authenticating to")
+	       : _("Authenticating"), context->username);
 
     label = gtk_label_new(NULL);
 
@@ -1174,6 +1031,7 @@ static GtkWidget *create_smp_progress_dialog(GtkWindow *parent,
 	smp_data->smp_progress_bar = bar;
 	smp_data->smp_progress_label = proglabel;
     }
+    gtk_label_set_text(GTK_LABEL(proglabel), _("Waiting for buddy..."));
 
     g_signal_connect(G_OBJECT(dialog), "response",
 		     G_CALLBACK(smp_progress_response_cb),
@@ -1336,13 +1194,19 @@ static void otrg_gtk_dialog_unknown_fingerprint(OtrlUserState us,
 
     conv = otrg_plugin_userinfo_to_conv(accountname, protocol, who, TRUE);
 
-    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM,
-	    time(NULL));
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
     g_free(buf);
 }
 
 static void otrg_gtk_dialog_clicked_connect(GtkWidget *widget, gpointer data);
 
+static void otr_refresh_otr_buttons(PurpleConversation *conv);
+static void otr_destroy_top_menu_objects(PurpleConversation *conv);
+static void otr_add_top_otr_menu(PurpleConversation *conv);
+static void otr_add_buddy_top_menus(PurpleConversation *conv);
+static void otr_check_conv_status_change( PurpleConversation *conv);
+
 static void dialog_update_label_conv(PurpleConversation *conv, TrustLevel level)
 {
     GtkWidget *label;
@@ -1368,33 +1232,54 @@ static void dialog_update_label_conv(PurpleConversation *conv, TrustLevel level)
     menusmp = purple_conversation_get_data(conv, "otr-menusmp");
 
     /* Set the button's icon, label and tooltip. */
-    otr_icon(icon, level);
+    otr_icon(icon, level, 1);
     gtk_label_set_text(GTK_LABEL(label),
 	    level == TRUST_FINISHED ? _("Finished") :
 	    level == TRUST_PRIVATE ? _("Private") :
 	    level == TRUST_UNVERIFIED ? _("Unverified") :
 	    _("Not private"));
     gtk_tooltips_set_tip(gtkconv->tooltips, button,
-	    level == TRUST_NOT_PRIVATE ? _("Start a private conversation") :
+	    (level == TRUST_NOT_PRIVATE || level == TRUST_FINISHED) ?
+		    _("Start a private conversation") :
 		    _("Refresh the private conversation"), NULL);
 
     /* Set the menu item label for the OTR Query item. */
     gtk_label_set_markup_with_mnemonic(GTK_LABEL(menuquerylabel),
-	    level == TRUST_NOT_PRIVATE ? _("Start _private conversation") :
+	    (level == TRUST_NOT_PRIVATE || level == TRUST_FINISHED) ?
+		    _("Start _private conversation") :
 		    _("Refresh _private conversation"));
 
     /* Sensitize the menu items as appropriate. */
     gtk_widget_set_sensitive(GTK_WIDGET(menuend), level != TRUST_NOT_PRIVATE);
     gtk_widget_set_sensitive(GTK_WIDGET(menuview), level != TRUST_NOT_PRIVATE);
     gtk_widget_set_sensitive(GTK_WIDGET(menuverf), level != TRUST_NOT_PRIVATE);
-    gtk_widget_set_sensitive(GTK_WIDGET(menusmp), level != TRUST_NOT_PRIVATE);
+    gtk_widget_set_sensitive(GTK_WIDGET(menusmp), level != TRUST_NOT_PRIVATE
+	    && level != TRUST_FINISHED);
 
     /* Use any non-NULL value for "private", NULL for "not private" */
     purple_conversation_set_data(conv, "otr-private",
-	    level == TRUST_NOT_PRIVATE ? NULL : conv);
+	    (level == TRUST_NOT_PRIVATE || level == TRUST_FINISHED) ?
+		    NULL : conv);
+
+    /* Use any non-NULL value for "finished", NULL for "not finished" */
+    purple_conversation_set_data(conv, "otr-finished",
+	    level == TRUST_FINISHED ? conv : NULL);
 
     /* Set the appropriate visibility */
-    gtk_widget_show_all(button);
+    /* gtk_widget_show_all(button); */
+
+    /* Update other widgets */
+    if (gtkconv != pidgin_conv_window_get_active_gtkconv(gtkconv->win)) {
+        return;
+    }
+
+    conv = gtkconv->active_conv;
+    otr_destroy_top_menu_objects(conv);
+    otr_add_top_otr_menu(conv);
+    otr_refresh_otr_buttons(conv);
+    otr_add_buddy_top_menus(conv);
+    otr_check_conv_status_change(conv);
+    
 }
 
 static void dialog_update_label(ConnContext *context)
@@ -1541,6 +1426,7 @@ static void vrfy_fingerprint_changed(GtkComboBox *combo, void *data)
 	otrg_plugin_write_fingerprints();
 	otrg_ui_update_keylist();
 	otrg_dialog_resensitize_all();
+    
     }
 }
 
@@ -1655,29 +1541,33 @@ static void otrg_gtk_dialog_verify_fingerprint(Fingerprint *fprint)
 /* Create the SMP dialog.  responder is true if this is called in
  * response to someone else's run of SMP. */
 static void otrg_gtk_dialog_socialist_millionaires(ConnContext *context,
-	gboolean responder)
+	char *question, gboolean responder)
 {
     GtkWidget *dialog;
     char *primary;
-    char *secondary;
     PurplePlugin *p;
     char *proto_name;
 
     if (context == NULL) return;
 
-    primary = g_strdup_printf(_("Authenticate %s"),
-	    context->username);
+    if (responder && question) {
+        primary = g_strdup_printf(_("Authentication from %s"),
+            context->username);
+    } else {
+        primary = g_strdup_printf(_("Authenticate %s"),
+            context->username);
+    }
+    
+    /* fprintf(stderr, "Question = ``%s''\n", question); */
 
     p = purple_find_prpl(context->protocol);
     proto_name = (p && p->info->name) ? p->info->name : _("Unknown");
-    secondary = g_strdup_printf(_("Enter a secret known only to %s and "
-		"yourself.\n"), context->username);
+    
 
     dialog = create_smp_dialog(_("Authenticate buddy"),
-	    primary, secondary, 1, NULL, context, responder);
+	    primary, NULL, 1, NULL, context, responder, question);
 
     g_free(primary);
-    g_free(secondary);
 }
 
 /* Call this to update the status of an ongoing socialist millionaires
@@ -1707,10 +1597,8 @@ static void otrg_gtk_dialog_update_smp(ConnContext *context,
 	gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label),
 		_("An error occurred during authentication."));
 	return;
-    }
-
-    /* If the counter reaches 1.0, the protocol is complete */
-    if (progress_level == 1.0) {
+    } else if (progress_level == 1.0) {
+	/* If the counter reaches 1.0, the protocol is complete */
         GtkDialog *dialog = GTK_DIALOG(smp_data->smp_progress_dialog);
 
 	gtk_dialog_set_response_sensitive(dialog, GTK_RESPONSE_ACCEPT, 1);
@@ -1718,14 +1606,24 @@ static void otrg_gtk_dialog_update_smp(ConnContext *context,
 	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
 		GTK_RESPONSE_ACCEPT);
 
-        if (context->active_fingerprint->trust &&
-		context->active_fingerprint->trust[0]) {
-	    gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label),
-		    _("Authentication successful."));
+        if (context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) {
+	    if (context->active_fingerprint->trust &&
+		    context->active_fingerprint->trust[0]) {
+		gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label),
+			_("Authentication successful."));
+	    } else {
+		gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label),
+			_("Your buddy has successfully authenticated you.  "
+			    "You may want to authenticate your buddy as "
+			    "well by asking your own question."));
+	    }
         } else {
 	    gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label),
 		    _("Authentication failed."));
 	}
+    } else {
+	/* Clear the progress label */
+	gtk_label_set_text(GTK_LABEL(smp_data->smp_progress_label), "");
     }
 }
 
@@ -1770,8 +1668,8 @@ static void otrg_gtk_dialog_connected(ConnContext *context)
 		context->protocol_version == 1 ? _("  Warning: using old "
 		    "protocol version 1.") : "");
 
-    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM,
-	time(NULL));
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
     g_free(buf);
     g_free(format_buf);
 
@@ -1789,7 +1687,9 @@ static void otrg_gtk_dialog_disconnected(ConnContext *context)
 
     buf = g_strdup_printf(_("Private conversation with %s lost."),
 	    purple_conversation_get_name(conv));
+    
     purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
     g_free(buf);
 
     otrg_ui_get_prefs(&prefs, purple_conversation_get_account(conv),
@@ -1825,8 +1725,9 @@ static void otrg_gtk_dialog_finished(const char *accountname,
     buf = g_strdup_printf(_("%s has ended his/her private conversation with "
 		"you; you should do the same."),
 	    purple_conversation_get_name(conv));
-    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM,
-	    time(NULL));
+        
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+        
     g_free(buf);
 
     dialog_update_label_conv(conv, TRUST_FINISHED);
@@ -1871,8 +1772,8 @@ static void otrg_gtk_dialog_stillconnected(ConnContext *context)
 		context->protocol_version == 1 ? _("  Warning: using old "
 		    "protocol version 1.") : "");
 
-    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM,
-	time(NULL));
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
     g_free(buf);
     g_free(format_buf);
 
@@ -1886,6 +1787,11 @@ static void otrg_gtk_dialog_clicked_connect(GtkWidget *widget, gpointer data)
     const char *format;
     char *buf;
     PurpleConversation *conv = data;
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+
+    if (gtkconv->active_conv != conv) {
+        pidgin_conv_switch_active_conversation(conv);
+    }
 
     if (purple_conversation_get_data(conv, "otr-private")) {
 	format = _("Attempting to refresh the private conversation with %s...");
@@ -1893,8 +1799,9 @@ static void otrg_gtk_dialog_clicked_connect(GtkWidget *widget, gpointer data)
 	format = _("Attempting to start a private conversation with %s...");
     }
     buf = g_strdup_printf(format, purple_conversation_get_name(conv));
-    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM,
-	    time(NULL));
+    
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
     g_free(buf);
 	
     otrg_plugin_send_default_query_conv(conv);
@@ -1922,7 +1829,7 @@ static void socialist_millionaires(GtkWidget *widget, gpointer data)
     if (context == NULL || context->msgstate != OTRL_MSGSTATE_ENCRYPTED)
 	return;
 
-    otrg_gtk_dialog_socialist_millionaires(context, FALSE);
+    otrg_gtk_dialog_socialist_millionaires(context, NULL, FALSE);
 }
 
 #if 0
@@ -1940,7 +1847,7 @@ static void verify_fingerprint(GtkWidget *widget, gpointer data)
 
 static void menu_whatsthis(GtkWidget *widget, gpointer data)
 {
-    char *uri = g_strdup_printf("%s%s", BUTTON_HELPURL, _("?lang=en"));
+    char *uri = g_strdup_printf("%s%s", LEVELS_HELPURL, _("?lang=en"));
     purple_notify_uri(otrg_plugin_handle, uri);
     g_free(uri);
 }
@@ -1972,28 +1879,468 @@ static gboolean button_pressed(GtkWidget *w, GdkEventButton *event,
     return FALSE;
 }
 
+static void otrg_gtk_dialog_new_purple_conv(PurpleConversation *conv);
+
+
+static void otr_refresh_otr_buttons(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    GList * list_iter = gtkconv->convs;
+    PurpleConversation * current_conv;
+    GtkWidget *button;
+
+    for (;list_iter;list_iter = list_iter->next) {
+
+        current_conv = list_iter->data;
+        button = purple_conversation_get_data(current_conv, "otr-button");
+
+	if (button) {
+	    if (current_conv == gtkconv->active_conv) {
+		gtk_widget_show (button);
+	    } else {
+		gtk_widget_hide (button);
+	    }
+	}
+    }
+}
+
+static void otr_destroy_top_menu_objects(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    PidginWindow *win = pidgin_conv_get_window ( gtkconv );
+    GList * menu_list = g_hash_table_lookup ( otr_win_menus, win );
+    GList * iter;
+    GList * next;
+
+    if ( menu_list != NULL ) {
+        iter = menu_list;
+        while ( iter ) {
+            if ( iter->data ) gtk_object_destroy ( GTK_OBJECT ( iter->data ) );
+            next = iter->next;
+            menu_list = g_list_remove ( menu_list, iter->data );
+            iter = next;
+        }
+    }
+    g_hash_table_replace ( otr_win_menus, win, menu_list );
+
+}
+
+static int otr_get_menu_insert_pos(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    PidginWindow *win = pidgin_conv_get_window ( gtkconv );
+    GtkWidget *menu_bar = win->menu.menubar;
+
+    GList * list_iter = gtk_container_get_children ( GTK_CONTAINER ( menu_bar ) );
+    GList * head = list_iter;
+
+    int pos = 0;
+    while ( list_iter ) {
+        pos++;
+        list_iter = list_iter->next;
+    }
+
+    if (pos != 0) pos--;
+
+    g_list_free ( head );
+
+    return pos;
+}
+
+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 finished = purple_conversation_get_data(conv, "otr-finished") ? 1 : 0;
+
+    GtkWidget * label = gtk_bin_get_child(GTK_BIN(query));
+
+    gtk_label_set_markup_with_mnemonic(GTK_LABEL(label),
+        insecure ? _("Start _private conversation") :
+        _("Refresh _private conversation"));
+
+    gtk_widget_set_sensitive(GTK_WIDGET(end), !insecure || finished);
+    gtk_widget_set_sensitive(GTK_WIDGET(smp), !insecure);
+}
+
+static void otr_build_status_submenu(PidginWindow *win,
+	PurpleConversation *conv, GtkWidget *menu, TrustLevel level) {
+    char *status = "";
+    GtkWidget *image;
+    GtkWidget *levelimage;
+    GtkWidget *buddy_name;
+    GtkWidget *buddy_status;
+    GtkWidget *menusep;
+    GdkPixbuf *pixbuf;
+
+    GList * menu_list = g_hash_table_lookup ( otr_win_menus, win );
+    
+    gchar *text = g_strdup_printf("%s (%s)", conv->name,
+	    purple_account_get_username(conv->account));
+    buddy_name = gtk_image_menu_item_new_with_label(text);
+    
+    /* Add the prpl icon in front of the menuitem label.  This is from
+     * pidgin's gtkconv.c. */
+
+    /* Create a pixmap for the protocol icon. */
+    pixbuf = pidgin_create_prpl_icon(conv->account, PIDGIN_PRPL_ICON_SMALL);
+
+    /* Now convert it to GtkImage */
+    if (pixbuf == NULL)
+	    image = gtk_image_new();
+    else
+    {
+	    image = gtk_image_new_from_pixbuf(pixbuf);
+	    g_object_unref(G_OBJECT(pixbuf));
+    }
+
+    gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( buddy_name ), image);
+    gtk_widget_show(buddy_name);
+    g_free(text);
+
+    switch(level) {
+        case TRUST_NOT_PRIVATE:
+            status = _("Not Private");
+            break;
+        case TRUST_UNVERIFIED:
+            status = _("Unverified");
+            break;
+        case TRUST_PRIVATE:
+            status = _("Private");
+            break;
+        case TRUST_FINISHED:
+            status = _("Finished");
+            break;
+        }
+
+    buddy_status = gtk_image_menu_item_new_with_label(status);
+
+    levelimage = otr_icon(NULL, level, 1);
+    
+    gtk_widget_show(buddy_status);
+    gtk_widget_show(levelimage);
+    gtk_image_menu_item_set_image ( GTK_IMAGE_MENU_ITEM ( buddy_status ), levelimage );
+
+    menusep = gtk_separator_menu_item_new();
+    
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), menusep);
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), buddy_name);
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), buddy_status);
+
+    gtk_widget_show(menusep);
+
+    menu_list = g_list_append(menu_list, buddy_name);
+    menu_list = g_list_append(menu_list, buddy_status);
+
+    g_hash_table_replace ( otr_win_menus, win, menu_list );
+
+    gtk_signal_connect(GTK_OBJECT(buddy_status), "activate",
+        GTK_SIGNAL_FUNC(menu_whatsthis), conv);
+}
+
+static void otr_build_buddy_submenu(PurpleConversation *conv, GtkWidget *menu) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    PidginWindow *win = pidgin_conv_get_window ( gtkconv );
+
+    GList * menu_list = g_hash_table_lookup ( otr_win_menus, win );
+
+    GtkWidget *buddymenuquery = gtk_menu_item_new_with_mnemonic(_("Start _private conversation"));
+    GtkWidget *buddymenuend = gtk_menu_item_new_with_mnemonic(_("_End private conversation"));
+    GtkWidget *buddymenusmp = gtk_menu_item_new_with_mnemonic(_("_Authenticate buddy"));
+
+    otr_set_menu_labels(conv, buddymenuquery, buddymenuend, buddymenusmp);
+
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), buddymenuquery);
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), buddymenuend);
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu), buddymenusmp);
+
+    gtk_widget_show(buddymenuquery);
+    gtk_widget_show(buddymenuend);
+    gtk_widget_show(buddymenusmp);
+
+    gtk_signal_connect(GTK_OBJECT(buddymenuquery), "activate",
+        GTK_SIGNAL_FUNC(otrg_gtk_dialog_clicked_connect), conv);
+    gtk_signal_connect(GTK_OBJECT(buddymenuend), "activate",
+        GTK_SIGNAL_FUNC(menu_end_private_conversation), conv);
+    gtk_signal_connect(GTK_OBJECT(buddymenusmp), "activate",
+        GTK_SIGNAL_FUNC(socialist_millionaires), conv);
+
+    menu_list = g_list_append(menu_list, buddymenuquery);
+    menu_list = g_list_append(menu_list, buddymenuend);
+    menu_list = g_list_append(menu_list, buddymenusmp);
+
+    g_hash_table_replace ( otr_win_menus, win, menu_list );
+
+}
+
+static void otr_add_top_otr_menu(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    PidginWindow *win = pidgin_conv_get_window ( gtkconv );
+    GtkWidget *menu_bar = win->menu.menubar;
+
+    GList * menu_list = g_hash_table_lookup ( otr_win_menus, win );
+
+    GtkWidget *topmenu;
+    GtkWidget *topmenuitem;
+
+    TrustLevel level = TRUST_NOT_PRIVATE;
+    ConnContext *context = otrg_plugin_conv_to_context(conv);
+
+    int pos = otr_get_menu_insert_pos(conv);
+
+    if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM) return;
+
+    topmenuitem = gtk_menu_item_new_with_label ( "OTR" );
+    topmenu = gtk_menu_new();
+        
+    if (context != NULL) {
+        level = otrg_plugin_context_to_trust(context);
+    }
+    
+    otr_build_buddy_submenu(conv, topmenu);
+    otr_build_status_submenu(win, conv, topmenu, level);
+
+    gtk_menu_item_set_submenu ( GTK_MENU_ITEM ( topmenuitem ), topmenu );
+
+    gtk_widget_show(topmenuitem);
+    gtk_widget_show(topmenu);
+
+    gtk_menu_shell_insert ( GTK_MENU_SHELL ( menu_bar ), topmenuitem, pos++ );
+
+
+    menu_list = g_list_append(menu_list, topmenuitem);
+    menu_list = g_list_append(menu_list, topmenu);
+
+    g_hash_table_replace ( otr_win_menus, win, menu_list );
+}
+
+static GList* otr_get_full_buddy_list(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+
+    GList *pres_list = NULL;
+    GList *conv_list = NULL;
+    
+    GSList *l, *buds;
+
+    /* This code is derived from pidgin's 'generating sendto menu' stuff */
+    if ( gtkconv->active_conv->type == PURPLE_CONV_TYPE_IM ) {
+        buds = purple_find_buddies ( gtkconv->active_conv->account, gtkconv->active_conv->name );
+        
+        if ( buds == NULL) {  /* buddy not on list */
+            conv_list = g_list_prepend ( conv_list, conv);
+        } else  {
+            for ( l = buds; l != NULL; l = l->next ) {
+                PurpleBlistNode *node = ( PurpleBlistNode * ) purple_buddy_get_contact ( ( PurpleBuddy * ) l->data );
+
+                for ( node = node->child; node != NULL; node = node->next ) {
+                    PurpleBuddy *buddy = ( PurpleBuddy * ) node;
+                    PurpleAccount *account;
+
+                    if ( !PURPLE_BLIST_NODE_IS_BUDDY ( node ) )
+                        continue;
+
+                    account = purple_buddy_get_account ( buddy );
+                    if ( purple_account_is_connected ( account ) ) {
+                        /* Use the PurplePresence to get unique buddies. */
+                        PurplePresence *presence = purple_buddy_get_presence ( buddy );
+                        if ( !g_list_find ( pres_list, presence ) ) {
+                            
+                            PurpleConversation * currentConv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, \
+                                purple_buddy_get_name ( buddy ), purple_buddy_get_account ( buddy ));
+                            
+                            pres_list = g_list_prepend ( pres_list, presence );
+                            
+                            if (currentConv != NULL) {
+                                conv_list = g_list_prepend ( conv_list, currentConv);    
+                            }
+                            
+                        }
+                    }
+                }
+            }
+            
+            g_slist_free ( buds );
+            g_list_free( pres_list );
+        }
+    }
+    
+    return conv_list;
+}
+
+static void otr_add_buddy_top_menus(PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION ( conv );
+    PidginWindow *win = pidgin_conv_get_window ( gtkconv );
+    
+    PurpleConversation * currentConv;
+
+    GtkWidget *menu_bar = win->menu.menubar;
+
+    GtkWidget *menu;
+    GtkWidget *menu_image;
+
+    GList *full_buddy_list = NULL;
+    GList * list_iter;
+    
+    int pos;
+    
+    full_buddy_list = otr_get_full_buddy_list(conv);
+
+    list_iter = full_buddy_list;
+
+    pos = otr_get_menu_insert_pos(conv);
+
+    for (list_iter = g_list_last ( full_buddy_list ); list_iter != NULL; list_iter = list_iter->prev) {
+        TrustLevel level;
+        ConnContext *context;
+        GList * menu_list;
+        GtkWidget * tooltip_menu;
+        gchar *tooltip_text;
+        
+        currentConv = list_iter->data;
+
+        if (currentConv == NULL) {
+            continue;       
+        }
+
+        if (purple_conversation_get_type(currentConv) != PURPLE_CONV_TYPE_IM) continue;
+
+        level = TRUST_NOT_PRIVATE;
+        context = otrg_plugin_conv_to_context(currentConv);
+        
+        if (context != NULL) {
+            level = otrg_plugin_context_to_trust(context);
+        }
+
+        menu_image = otr_icon(NULL, level, 1);
+
+        if (currentConv == gtkconv->active_conv) {
+            menu_image = otr_icon(menu_image, level, 1);
+        } else {
+            menu_image = otr_icon(menu_image, level, 0);
+        }
+        menu = gtk_menu_new();
+            
+        otr_build_buddy_submenu(currentConv, menu);
+        otr_build_status_submenu(win, currentConv, menu, level);
+        
+        tooltip_menu = tooltip_menu_new();
+        
+        gtk_widget_show ( menu_image );
+        gtk_widget_show(tooltip_menu);
+        gtk_menu_shell_insert ( GTK_MENU_SHELL ( menu_bar ), tooltip_menu, pos++ );
+        gtk_menu_item_set_submenu ( GTK_MENU_ITEM ( tooltip_menu ), menu );
+        
+        tooltip_text = g_strdup_printf("%s (%s)", currentConv->name, purple_account_get_username(currentConv->account));
+        tooltip_menu_prepend(TOOLTIP_MENU(tooltip_menu), menu_image, tooltip_text);
+        g_free(tooltip_text);
+        
+        menu_list = g_hash_table_lookup ( otr_win_menus, win );
+        menu_list = g_list_append(menu_list, tooltip_menu);
+        menu_list = g_list_append(menu_list, menu);
+        
+        g_hash_table_replace ( otr_win_menus, win, menu_list );
+        
+
+    }
+    
+    g_list_free ( full_buddy_list );
+
+}
+
+static void otr_check_conv_status_change( PurpleConversation *conv) {
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+    TrustLevel current_level = TRUST_NOT_PRIVATE;
+    ConnContext *context = otrg_plugin_conv_to_context(conv);
+    
+    int *previous_level;
+    char *buf;
+    char *status = "";
+    
+    if (context != NULL) {
+        current_level = otrg_plugin_context_to_trust(context);
+    }
+    
+    previous_level = g_hash_table_lookup ( otr_win_status, gtkconv );    
+    
+    if (!previous_level || (previous_level && *previous_level == current_level)) {
+        return;
+    }
+    
+    buf = _("The privacy status of the current conversation is now: <a href=\"%s%s\">%s</a>");
+    
+    switch(current_level) {
+        case TRUST_NOT_PRIVATE:
+            status = _("Not Private");
+            break;
+        case TRUST_UNVERIFIED:
+            status = _("Unverified");
+            break;
+        case TRUST_PRIVATE:
+            status = _("Private");
+            break;
+        case TRUST_FINISHED:
+            status = _("Finished");
+            break;
+    }
+    
+    /* The UNVERIFIED_HELPURL actually contains help info for all statuses */
+    buf = g_strdup_printf(buf, UNVERIFIED_HELPURL, _("?lang=en"), status);
+    
+    /* Write a new message indicating the level change. The timestamp image will be appended as the message
+       timestamp signal is caught, which will also update the privacy level for this gtkconv */
+    purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_SYSTEM, time(NULL));
+    
+    g_free(buf);
+}
+
+/* If the conversation switches on us */
+static void conversation_switched ( PurpleConversation *conv, void * data ) {
+    if ( conv == NULL ) return;
+
+    otrg_gtk_dialog_new_purple_conv(conv);
+
+}
+
 /* If the conversation gets destroyed on us, clean up the data we stored
  * pointing to it. */
 static void conversation_destroyed(PurpleConversation *conv, void *data)
 {
     GtkWidget *menu = purple_conversation_get_data(conv, "otr-menu");
+    PidginConversation *gtkconv;
+    PidginWindow *win;
+    GList * menu_list;
+    GList * iter;
+    
     if (menu) gtk_object_destroy(GTK_OBJECT(menu));
     g_hash_table_remove(conv->data, "otr-label");
     g_hash_table_remove(conv->data, "otr-button");
     g_hash_table_remove(conv->data, "otr-icon");
     g_hash_table_remove(conv->data, "otr-icontext");
     g_hash_table_remove(conv->data, "otr-private");
+    g_hash_table_remove(conv->data, "otr-finished");
     g_hash_table_remove(conv->data, "otr-menu");
     g_hash_table_remove(conv->data, "otr-menuquery");
     g_hash_table_remove(conv->data, "otr-menuend");
     g_hash_table_remove(conv->data, "otr-menuview");
     g_hash_table_remove(conv->data, "otr-menuverf");
     g_hash_table_remove(conv->data, "otr-menusmp");
+
     otrg_gtk_dialog_free_smp_data(conv);
+
+    gtkconv = PIDGIN_CONVERSATION ( conv );
+    win = pidgin_conv_get_window ( gtkconv );
+    menu_list = g_hash_table_lookup ( otr_win_menus, win );
+    iter = menu_list;
+
+    while ( iter ) {
+        GList * next;
+        if ( iter->data ) gtk_object_destroy ( GTK_OBJECT ( iter->data ) );
+        next = iter->next;
+        menu_list = g_list_remove ( menu_list, iter->data );
+        iter = next;
+    }
+
+    g_hash_table_remove(otr_win_menus, win);
+    g_list_free(menu_list);
 }
 
 /* Set up the per-conversation information display */
-static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
+static void otrg_gtk_dialog_new_purple_conv(PurpleConversation *conv)
 {
     PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
     ConnContext *context;
@@ -2016,8 +2363,18 @@ static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
     GtkWidget *menusmp;
     GtkWidget *whatsthis;
 
+    PurpleAccount *account;
+    const char *name;
+    OtrgUiPrefs prefs;
+
     /* Do nothing if this isn't an IM conversation */
     if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM) return;
+
+    /* Get the prefs */
+    account = purple_conversation_get_account(conv);
+    name = purple_conversation_get_name(conv);
+    otrg_ui_get_prefs(&prefs, account, name);
+
     bbox = gtkconv->lower_hbox;
 
     context = otrg_plugin_conv_to_context(conv);
@@ -2025,22 +2382,31 @@ static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
     /* See if we're already set up */
     button = purple_conversation_get_data(conv, "otr-button");
     if (button) {
-	/* Check if we've been removed from the bbox; purple does this
-	 * when the user changes her prefs for the style of buttons to
-	 * display. */
-	GList *children = gtk_container_get_children(GTK_CONTAINER(bbox));
-	if (!g_list_find(children, button)) {
-	    gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
+	if (prefs.show_otr_button) {
+	    /* Check if we've been removed from the bbox; purple does this
+	     * when the user changes her prefs for the style of buttons to
+	     * display. */
+	    GList *children = gtk_container_get_children(GTK_CONTAINER(bbox));
+	    if (!g_list_find(children, button)) {
+		gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
+	    }
+	    g_list_free(children);
+	    gtk_widget_show_all(button);
+	} else {
+	    gtk_container_remove(GTK_CONTAINER(bbox), button);
+	    gtk_widget_hide_all(button);
 	}
-	g_list_free(children);
 	dialog_update_label_conv(conv, otrg_plugin_context_to_trust(context));
 	return;
     }
 
     /* Make the button */
     button = gtk_button_new();
+
     gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
-    gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
+    if (prefs.show_otr_button) {
+	gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);
+    }
 
     bwbox = gtk_vbox_new(FALSE, 0);
     gtk_container_add(GTK_CONTAINER(button), bwbox);
@@ -2052,12 +2418,15 @@ static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
     gtk_box_pack_start(GTK_BOX(bvbox), label, FALSE, FALSE, 0);
     icontext = gtk_label_new(_("OTR:"));
     gtk_box_pack_start(GTK_BOX(iconbox), icontext, FALSE, FALSE, 0);
-    icon = otr_icon(NULL, TRUST_NOT_PRIVATE);
+    icon = otr_icon(NULL, TRUST_NOT_PRIVATE, 1);
     gtk_box_pack_start(GTK_BOX(iconbox), icon, TRUE, FALSE, 0);
 
-    gtk_widget_show_all(button);
+    if (prefs.show_otr_button) {
+	gtk_widget_show_all(button);
+    }
 
     /* Make the context menu */
+
     menu = gtk_menu_new();
     gtk_menu_set_title(GTK_MENU(menu), _("OTR Messaging"));
 
@@ -2109,6 +2478,7 @@ static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
     purple_conversation_set_data(conv, "otr-icon", icon);
     purple_conversation_set_data(conv, "otr-icontext", icontext);
     purple_conversation_set_data(conv, "otr-menu", menu);
+
     purple_conversation_set_data(conv, "otr-menuquery", menuquery);
     purple_conversation_set_data(conv, "otr-menuend", menuend);
     /*
@@ -2144,6 +2514,13 @@ static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
     otrg_gtk_dialog_add_smp_data(conv);
 }
 
+/* Set up the per-conversation information display */
+static void otrg_gtk_dialog_new_conv(PurpleConversation *conv)
+{
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+    conversation_switched (gtkconv->active_conv, NULL);
+}
+
 /* Remove the per-conversation information display */
 static void otrg_gtk_dialog_remove_conv(PurpleConversation *conv)
 {
@@ -2154,6 +2531,7 @@ static void otrg_gtk_dialog_remove_conv(PurpleConversation *conv)
 
     button = purple_conversation_get_data(conv, "otr-button");
     if (button) gtk_object_destroy(GTK_OBJECT(button));
+
     conversation_destroyed(conv, NULL);
 }
 
@@ -2176,7 +2554,7 @@ static void dialog_resensitize(PurpleConversation *conv)
     if (prefs.policy == OTRL_POLICY_NEVER) {
 	otrg_gtk_dialog_remove_conv(conv);
     } else {
-	otrg_gtk_dialog_new_conv(conv);
+        otrg_gtk_dialog_new_conv(conv);
     }
     button = purple_conversation_get_data(conv, "otr-button");
     if (!button) return;
@@ -2184,7 +2562,7 @@ static void dialog_resensitize(PurpleConversation *conv)
 	connection = purple_account_get_connection(account);
 	if (connection) {
 	    /* Set the button to "sensitive" */
-	    gtk_widget_set_sensitive(button, 1);
+	    gtk_widget_set_sensitive(button, 1);   
 	    return;
 	}
     }
@@ -2199,20 +2577,175 @@ static void otrg_gtk_dialog_resensitize_all(void)
     purple_conversation_foreach(dialog_resensitize);
 }
 
+static void foreach_free_lists(void * key, void * value, void* data) {
+    GList * menu_list = (GList *) value;
+    GList * iter = menu_list;
+
+    while ( iter ) {
+        GList * next;
+        if ( iter->data ) gtk_object_destroy ( GTK_OBJECT ( iter->data ) );
+        next = iter->next;
+        menu_list = g_list_remove ( menu_list, iter->data );
+        iter = next;
+    }
+
+    g_list_free(menu_list);
+}
+
+static char* conversation_timestamp(PurpleConversation *conv, time_t mtime,
+                                gboolean show_date) {
+
+    PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
+    TrustLevel current_level = TRUST_NOT_PRIVATE;
+    ConnContext *context = otrg_plugin_conv_to_context(conv);
+    
+    int *previous_level;
+    int id;
+    
+    
+    if (context != NULL) {
+        current_level = otrg_plugin_context_to_trust(context);
+    }
+    
+    previous_level = g_hash_table_lookup ( otr_win_status, gtkconv );    
+    
+    
+    if (previous_level && *previous_level == current_level) {
+        return NULL;
+    }
+    
+    /* We want to update this gtkconv's privacy level only if the new privacy level we 
+       received corresponds to the active conversation.  */
+    if (conv == gtkconv->active_conv) {
+        int * current_level_ptr = malloc(sizeof(int));  /* 'free' is handled by the hashtable */
+        *current_level_ptr = current_level;
+        g_hash_table_replace ( otr_win_status, gtkconv, current_level_ptr );
+    }
+    
+    if (!previous_level) {
+        return NULL;
+    }
+    
+    id = -1;
+
+    switch(current_level) {
+        case TRUST_NOT_PRIVATE:
+            id = img_id_not_private;
+            break;
+        case TRUST_UNVERIFIED:
+            id = img_id_unverified;
+            break;
+        case TRUST_PRIVATE:
+            id = img_id_private;
+            break;
+        case TRUST_FINISHED:
+            id = img_id_finished;
+            break;
+    }
+    
+
+    if (id > 0 ) {
+        char * msg = g_strdup_printf("<IMG ID=\"%d\"> ", id);
+        gtk_imhtml_append_text_with_images((GtkIMHtml*)gtkconv->imhtml, msg, 0, NULL);  
+        g_free(msg);  
+    }
+    
+    
+    return NULL;
+}
+
+static void unref_img_by_id(int *id)
+{
+    if (id && *id > 0) {
+        purple_imgstore_unref_by_id(*id);
+	*id = -1;
+    }
+}
+
+static void dialog_quitting(void)
+{
+    /* We need to do this by catching the quitting signal, because
+     * purple (mistakenly?) frees up all data structures, including
+     * the imgstore, *before* calling the unload() method of the
+     * plugins. */
+    unref_img_by_id(&img_id_not_private);
+    unref_img_by_id(&img_id_unverified);
+    unref_img_by_id(&img_id_private);
+    unref_img_by_id(&img_id_finished);
+}
+
 /* Initialize the OTR dialog subsystem */
 static void otrg_gtk_dialog_init(void)
 {
+    otr_win_menus = g_hash_table_new(g_direct_hash, g_direct_equal);
+    otr_win_status = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free);
+    
+    
+    img_id_not_private = purple_imgstore_add_with_id(
+	    g_memdup(not_private_png, sizeof(not_private_png)),
+	    sizeof(not_private_png), "");
+    
+    img_id_unverified = purple_imgstore_add_with_id(
+	    g_memdup(unverified_png, sizeof(unverified_png)),
+	    sizeof(unverified_png), "");
+    
+    img_id_private = purple_imgstore_add_with_id(
+	    g_memdup(private_png, sizeof(private_png)),
+	    sizeof(private_png), "");
+    
+    img_id_finished = purple_imgstore_add_with_id(
+	    g_memdup(finished_png, sizeof(finished_png)),
+	    sizeof(finished_png), "");
+
+    
+    purple_signal_connect(pidgin_conversations_get_handle(),
+	    "conversation-switched", otrg_plugin_handle,
+	    PURPLE_CALLBACK(conversation_switched), NULL);
+
     purple_signal_connect(purple_conversations_get_handle(),
 	    "deleting-conversation", otrg_plugin_handle,
 	    PURPLE_CALLBACK(conversation_destroyed), NULL);
+        
+    purple_signal_connect(pidgin_conversations_get_handle(),
+        "conversation-timestamp", otrg_plugin_handle,
+        PURPLE_CALLBACK(conversation_timestamp), NULL);
+
+    purple_signal_connect(purple_get_core(),
+	"quitting", otrg_plugin_handle, PURPLE_CALLBACK(dialog_quitting),
+	NULL);
 }
 
 /* Deinitialize the OTR dialog subsystem */
 static void otrg_gtk_dialog_cleanup(void)
 {
+    purple_signal_disconnect(purple_get_core(), "quitting",
+	    otrg_plugin_handle, PURPLE_CALLBACK(dialog_quitting));
+
+    purple_signal_disconnect(pidgin_conversations_get_handle(),
+	    "conversation-switched", otrg_plugin_handle,
+	    PURPLE_CALLBACK(conversation_switched));
+
+    purple_signal_disconnect(pidgin_conversations_get_handle(),
+        "conversation-timestamp", otrg_plugin_handle,
+        PURPLE_CALLBACK(conversation_timestamp));
+
     purple_signal_disconnect(purple_conversations_get_handle(),
 	    "deleting-conversation", otrg_plugin_handle,
 	    PURPLE_CALLBACK(conversation_destroyed));
+
+    /* If we're quitting, the imgstore will already have been destroyed
+     * by purple, but we should have already called dialog_quitting(),
+     * so the img_id_* should be -1, and all should be OK. */
+    unref_img_by_id(&img_id_not_private);
+    unref_img_by_id(&img_id_unverified);
+    unref_img_by_id(&img_id_private);
+    unref_img_by_id(&img_id_finished);
+    
+    g_hash_table_foreach(otr_win_menus, foreach_free_lists, NULL);
+
+    g_hash_table_destroy(otr_win_menus);
+    
+    g_hash_table_destroy(otr_win_status);
 }
 
 static const OtrgDialogUiOps gtk_dialog_ui_ops = {
diff --git a/gtk-dialog.h b/gtk-dialog.h
index 2a1098c..50253fa 100644
--- a/gtk-dialog.h
+++ b/gtk-dialog.h
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
diff --git a/gtk-ui.c b/gtk-ui.c
index 37f1b8e..3ddeb0e 100644
--- a/gtk-ui.c
+++ b/gtk-ui.c
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -47,13 +48,17 @@
 #include "ui.h"
 #include "otr-plugin.h"
 
-struct otroptionsdata {
+struct otrsettingsdata {
     GtkWidget *enablebox;
     GtkWidget *automaticbox;
     GtkWidget *onlyprivatebox;
     GtkWidget *avoidloggingotrbox;
 };
 
+struct otroptionsdata {
+    GtkWidget *showotrbutton;
+};
+
 static struct {
     GtkWidget *accountmenu;
     GtkWidget *fprint_label;
@@ -66,6 +71,7 @@ static struct {
     GtkWidget *disconnect_button;
     GtkWidget *forget_button;
     GtkWidget *verify_button;
+    struct otrsettingsdata os;
     struct otroptionsdata oo;
 } ui_layout;
 
@@ -222,9 +228,9 @@ static void ui_destroyed(GtkObject *object)
     ui_layout.disconnect_button = NULL;
     ui_layout.forget_button = NULL;
     ui_layout.verify_button = NULL;
-    ui_layout.oo.enablebox = NULL;
-    ui_layout.oo.automaticbox = NULL;
-    ui_layout.oo.onlyprivatebox = NULL;
+    ui_layout.os.enablebox = NULL;
+    ui_layout.os.automaticbox = NULL;
+    ui_layout.os.onlyprivatebox = NULL;
 }
 
 static void clist_selected(GtkWidget *widget, gint row, gint column,
@@ -368,41 +374,42 @@ static void verify_fingerprint(GtkWidget *widget, gpointer data)
     otrg_dialog_verify_fingerprint(fingerprint);
 }
 
-static void otroptions_clicked_cb(GtkButton *button, struct otroptionsdata *oo)
+static void otrsettings_clicked_cb(GtkButton *button,
+	struct otrsettingsdata *os)
 {
-    gtk_widget_set_sensitive(oo->enablebox, TRUE);
+    gtk_widget_set_sensitive(os->enablebox, TRUE);
     if (gtk_toggle_button_get_active(
-		GTK_TOGGLE_BUTTON(oo->enablebox))) {
-	gtk_widget_set_sensitive(oo->automaticbox, TRUE);
+		GTK_TOGGLE_BUTTON(os->enablebox))) {
+	gtk_widget_set_sensitive(os->automaticbox, TRUE);
 	if (gtk_toggle_button_get_active(
-		    GTK_TOGGLE_BUTTON(oo->automaticbox))) {
-	    gtk_widget_set_sensitive(oo->onlyprivatebox, TRUE);
+		    GTK_TOGGLE_BUTTON(os->automaticbox))) {
+	    gtk_widget_set_sensitive(os->onlyprivatebox, TRUE);
 	} else {
-	    gtk_widget_set_sensitive(oo->onlyprivatebox, FALSE);
+	    gtk_widget_set_sensitive(os->onlyprivatebox, FALSE);
 	}
-	gtk_widget_set_sensitive(oo->avoidloggingotrbox, TRUE);
+	gtk_widget_set_sensitive(os->avoidloggingotrbox, TRUE);
     } else {
-	gtk_widget_set_sensitive(oo->automaticbox, FALSE);
-	gtk_widget_set_sensitive(oo->onlyprivatebox, FALSE);
-	gtk_widget_set_sensitive(oo->avoidloggingotrbox, FALSE);
+	gtk_widget_set_sensitive(os->automaticbox, FALSE);
+	gtk_widget_set_sensitive(os->onlyprivatebox, FALSE);
+	gtk_widget_set_sensitive(os->avoidloggingotrbox, FALSE);
     }
 }
 
-static void create_otroption_buttons(struct otroptionsdata *oo,
+static void create_otrsettings_buttons(struct otrsettingsdata *os,
 	GtkWidget *vbox)
 {
     GtkWidget *tempbox1, *tempbox2;
 
-    oo->enablebox = gtk_check_button_new_with_label(_("Enable private "
+    os->enablebox = gtk_check_button_new_with_label(_("Enable private "
 	    "messaging"));
-    oo->automaticbox = gtk_check_button_new_with_label(_("Automatically "
+    os->automaticbox = gtk_check_button_new_with_label(_("Automatically "
 	    "initiate private messaging"));
-    oo->onlyprivatebox = gtk_check_button_new_with_label(_("Require private "
+    os->onlyprivatebox = gtk_check_button_new_with_label(_("Require private "
 	    "messaging"));
-    oo->avoidloggingotrbox = gtk_check_button_new_with_label(
+    os->avoidloggingotrbox = gtk_check_button_new_with_label(
 	    _("Don't log OTR conversations"));
 
-    gtk_box_pack_start(GTK_BOX(vbox), oo->enablebox,
+    gtk_box_pack_start(GTK_BOX(vbox), os->enablebox,
 	    FALSE, FALSE, 0);
     tempbox1 = gtk_hbox_new(FALSE, 0);
     gtk_box_pack_start(GTK_BOX(vbox), tempbox1,
@@ -410,25 +417,44 @@ static void create_otroption_buttons(struct otroptionsdata *oo,
     tempbox2 = gtk_vbox_new(FALSE, 0);
     gtk_box_pack_start(GTK_BOX(tempbox1), tempbox2, FALSE, FALSE, 5);
 
-    gtk_box_pack_start(GTK_BOX(tempbox2), oo->automaticbox,
+    gtk_box_pack_start(GTK_BOX(tempbox2), os->automaticbox,
 	    FALSE, FALSE, 0);
     tempbox1 = gtk_hbox_new(FALSE, 0);
     gtk_box_pack_start(GTK_BOX(tempbox2), tempbox1, FALSE, FALSE, 0);
     tempbox2 = gtk_vbox_new(FALSE, 0);
     gtk_box_pack_start(GTK_BOX(tempbox1), tempbox2, FALSE, FALSE, 5);
 
-    gtk_box_pack_start(GTK_BOX(tempbox2), oo->onlyprivatebox,
+    gtk_box_pack_start(GTK_BOX(tempbox2), os->onlyprivatebox,
 	    FALSE, FALSE, 0);
 
-    gtk_box_pack_start(GTK_BOX(vbox), oo->avoidloggingotrbox, FALSE, FALSE, 5);
+    gtk_box_pack_start(GTK_BOX(vbox), os->avoidloggingotrbox, FALSE, FALSE, 5);
 
-    g_signal_connect(G_OBJECT(oo->enablebox), "clicked",
-		     G_CALLBACK(otroptions_clicked_cb), oo);
-    g_signal_connect(G_OBJECT(oo->automaticbox), "clicked",
-		     G_CALLBACK(otroptions_clicked_cb), oo);
-    g_signal_connect(G_OBJECT(oo->onlyprivatebox), "clicked",
-		     G_CALLBACK(otroptions_clicked_cb), oo);
-    g_signal_connect(G_OBJECT(oo->avoidloggingotrbox), "clicked",
+    g_signal_connect(G_OBJECT(os->enablebox), "clicked",
+		     G_CALLBACK(otrsettings_clicked_cb), os);
+    g_signal_connect(G_OBJECT(os->automaticbox), "clicked",
+		     G_CALLBACK(otrsettings_clicked_cb), os);
+    g_signal_connect(G_OBJECT(os->onlyprivatebox), "clicked",
+		     G_CALLBACK(otrsettings_clicked_cb), os);
+    g_signal_connect(G_OBJECT(os->avoidloggingotrbox), "clicked",
+		     G_CALLBACK(otrsettings_clicked_cb), os);
+}
+
+static void otroptions_clicked_cb(GtkButton *button,
+	struct otroptionsdata *oo)
+{
+    /* This doesn't really do anything useful right now, but is here for
+     * future expansion purposes. */
+    gtk_widget_set_sensitive(oo->showotrbutton, TRUE);
+}
+
+static void create_otroptions_buttons(struct otroptionsdata *oo,
+	GtkWidget *vbox)
+{
+    oo->showotrbutton = gtk_check_button_new_with_label(_("Show OTR button"));
+
+    gtk_box_pack_start(GTK_BOX(vbox), oo->showotrbutton, FALSE, FALSE, 0);
+
+    g_signal_connect(G_OBJECT(oo->showotrbutton), "clicked",
 		     G_CALLBACK(otroptions_clicked_cb), oo);
 }
 
@@ -498,7 +524,7 @@ static void otrg_gtk_ui_buddy_prefs_save(PurpleBuddy *buddy,
     purple_blist_node_set_bool(node, "OTR/avoidloggingotr", avoidloggingotr);
 }
 
-static void load_otroptions(struct otroptionsdata *oo)
+static void load_otrsettings(struct otrsettingsdata *os)
 {
     gboolean otrenabled;
     gboolean otrautomatic;
@@ -508,16 +534,51 @@ static void load_otroptions(struct otroptionsdata *oo)
     otrg_gtk_ui_global_prefs_load(&otrenabled, &otrautomatic, &otronlyprivate,
 	    &otravoidloggingotr);
 
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->enablebox),
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->enablebox),
 	    otrenabled);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->automaticbox),
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->automaticbox),
 	    otrautomatic);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->onlyprivatebox),
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->onlyprivatebox),
 	    otronlyprivate);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->avoidloggingotrbox),
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(os->avoidloggingotrbox),
 	    otravoidloggingotr);
 
-    otroptions_clicked_cb(GTK_BUTTON(oo->enablebox), oo);
+    otrsettings_clicked_cb(GTK_BUTTON(os->enablebox), os);
+}
+
+/* Load the global OTR UI options */
+static void otrg_gtk_ui_global_options_load(gboolean *showotrbuttonp)
+{
+    if (purple_prefs_exists("/OTR/showotrbutton")) {
+	*showotrbuttonp = purple_prefs_get_bool("/OTR/showotrbutton");
+    } else {
+	*showotrbuttonp = FALSE;
+    }
+}
+
+/* Save the global OTR UI options */
+static void otrg_gtk_ui_global_options_save(gboolean showotrbutton)
+{
+    if (! purple_prefs_exists("/OTR")) {
+	purple_prefs_add_none("/OTR");
+    }
+    if (! purple_prefs_exists("/OTR/showotrbutton")) {
+	purple_prefs_add_bool("/OTR/showotrbutton", showotrbutton);
+    }
+    purple_prefs_set_bool("/OTR/showotrbutton", showotrbutton);
+}
+
+
+static void load_otroptions(struct otroptionsdata *oo)
+{
+    gboolean showotrbutton;
+
+    otrg_gtk_ui_global_options_load(&showotrbutton);
+
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(oo->showotrbutton),
+	    showotrbutton);
+
+    otroptions_clicked_cb(GTK_BUTTON(oo->showotrbutton), oo);
 }
 
 /* Create the privkeys UI, and pack it into the vbox */
@@ -571,46 +632,77 @@ static void make_privkeys_ui(GtkWidget *vbox)
 	    FALSE, FALSE, 0);
 }
 
-/* Save the global OTR options whenever they're clicked */
-static void otroptions_save_cb(GtkButton *button, struct otroptionsdata *oo)
+/* Save the global OTR settings whenever they're clicked */
+static void otrsettings_save_cb(GtkButton *button, struct otrsettingsdata *os)
 {
     otrg_gtk_ui_global_prefs_save(
 	    gtk_toggle_button_get_active(
-		GTK_TOGGLE_BUTTON(oo->enablebox)),
+		GTK_TOGGLE_BUTTON(os->enablebox)),
 	    gtk_toggle_button_get_active(
-		GTK_TOGGLE_BUTTON(oo->automaticbox)),
+		GTK_TOGGLE_BUTTON(os->automaticbox)),
 	    gtk_toggle_button_get_active(
-		GTK_TOGGLE_BUTTON(oo->onlyprivatebox)),
+		GTK_TOGGLE_BUTTON(os->onlyprivatebox)),
 	    gtk_toggle_button_get_active(
-		GTK_TOGGLE_BUTTON(oo->avoidloggingotrbox)));
+		GTK_TOGGLE_BUTTON(os->avoidloggingotrbox)));
 
     otrg_dialog_resensitize_all();
 }
 
+/* Save the global OTR UI options whenever they're clicked */
+static void otroptions_save_cb(GtkButton *button, struct otroptionsdata *oo)
+{
+    otrg_gtk_ui_global_options_save(
+	    gtk_toggle_button_get_active(
+		GTK_TOGGLE_BUTTON(oo->showotrbutton)));
+
+    otrg_dialog_resensitize_all();
+}
+
+/* Make the settings UI, and pack it into the vbox */
+static void make_settings_ui(GtkWidget *vbox)
+{
+    GtkWidget *fbox;
+    GtkWidget *frame;
+
+    frame = gtk_frame_new(_("Default OTR Settings"));
+    gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+
+    fbox = gtk_vbox_new(FALSE, 0);
+    gtk_container_set_border_width(GTK_CONTAINER(fbox), 10);
+    gtk_container_add(GTK_CONTAINER(frame), fbox);
+
+    create_otrsettings_buttons(&(ui_layout.os), fbox);
+
+    load_otrsettings(&(ui_layout.os));
+
+    g_signal_connect(G_OBJECT(ui_layout.os.enablebox), "clicked",
+		     G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
+    g_signal_connect(G_OBJECT(ui_layout.os.automaticbox), "clicked",
+		     G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
+    g_signal_connect(G_OBJECT(ui_layout.os.onlyprivatebox), "clicked",
+		     G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
+    g_signal_connect(G_OBJECT(ui_layout.os.avoidloggingotrbox), "clicked",
+		     G_CALLBACK(otrsettings_save_cb), &(ui_layout.os));
+}
+
 /* Make the options UI, and pack it into the vbox */
 static void make_options_ui(GtkWidget *vbox)
 {
     GtkWidget *fbox;
     GtkWidget *frame;
 
-    frame = gtk_frame_new(_("Default OTR Settings"));
+    frame = gtk_frame_new(_("OTR UI Options"));
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
     fbox = gtk_vbox_new(FALSE, 0);
     gtk_container_set_border_width(GTK_CONTAINER(fbox), 10);
     gtk_container_add(GTK_CONTAINER(frame), fbox);
 
-    create_otroption_buttons(&(ui_layout.oo), fbox);
+    create_otroptions_buttons(&(ui_layout.oo), fbox);
 
     load_otroptions(&(ui_layout.oo));
 
-    g_signal_connect(G_OBJECT(ui_layout.oo.enablebox), "clicked",
-		     G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
-    g_signal_connect(G_OBJECT(ui_layout.oo.automaticbox), "clicked",
-		     G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
-    g_signal_connect(G_OBJECT(ui_layout.oo.onlyprivatebox), "clicked",
-		     G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
-    g_signal_connect(G_OBJECT(ui_layout.oo.avoidloggingotrbox), "clicked",
+    g_signal_connect(G_OBJECT(ui_layout.oo.showotrbutton), "clicked",
 		     G_CALLBACK(otroptions_save_cb), &(ui_layout.oo));
 }
 
@@ -725,6 +817,8 @@ GtkWidget* otrg_gtk_ui_make_widget(PurplePlugin *plugin)
 
     make_privkeys_ui(configbox);
 
+    make_settings_ui(configbox);
+
     make_options_ui(configbox);
 
     /*
@@ -748,7 +842,7 @@ struct cbdata {
     GtkWidget *dialog;
     PurpleBuddy *buddy;
     GtkWidget *defaultbox;
-    struct otroptionsdata oo;
+    struct otrsettingsdata os;
 };
 
 static void default_clicked_cb(GtkButton *button, struct cbdata *data)
@@ -756,12 +850,12 @@ static void default_clicked_cb(GtkButton *button, struct cbdata *data)
     gboolean defaultset =
 	gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(data->defaultbox));
     if (defaultset) {
-	gtk_widget_set_sensitive(data->oo.enablebox, FALSE);
-	gtk_widget_set_sensitive(data->oo.automaticbox, FALSE);
-	gtk_widget_set_sensitive(data->oo.onlyprivatebox, FALSE);
-	gtk_widget_set_sensitive(data->oo.avoidloggingotrbox, FALSE);
+	gtk_widget_set_sensitive(data->os.enablebox, FALSE);
+	gtk_widget_set_sensitive(data->os.automaticbox, FALSE);
+	gtk_widget_set_sensitive(data->os.onlyprivatebox, FALSE);
+	gtk_widget_set_sensitive(data->os.avoidloggingotrbox, FALSE);
     } else {
-	otroptions_clicked_cb(button, &(data->oo));
+	otrsettings_clicked_cb(button, &(data->os));
     }
 }
 
@@ -777,17 +871,17 @@ static void load_buddyprefs(struct cbdata *data)
 
     if (usedefault) {
 	/* Load the global defaults */
-	load_otroptions(&(data->oo));
+	load_otrsettings(&(data->os));
     } else {
 	/* We've got buddy-specific prefs */
 	gtk_toggle_button_set_active(
-		GTK_TOGGLE_BUTTON(data->oo.enablebox), enabled);
+		GTK_TOGGLE_BUTTON(data->os.enablebox), enabled);
 	gtk_toggle_button_set_active(
-		GTK_TOGGLE_BUTTON(data->oo.automaticbox), automatic);
+		GTK_TOGGLE_BUTTON(data->os.automaticbox), automatic);
 	gtk_toggle_button_set_active(
-		GTK_TOGGLE_BUTTON(data->oo.onlyprivatebox), onlyprivate);
+		GTK_TOGGLE_BUTTON(data->os.onlyprivatebox), onlyprivate);
 	gtk_toggle_button_set_active(
-		GTK_TOGGLE_BUTTON(data->oo.avoidloggingotrbox),
+		GTK_TOGGLE_BUTTON(data->os.avoidloggingotrbox),
 		avoidloggingotr);
     }
 
@@ -802,7 +896,7 @@ static void config_buddy_destroy_cb(GtkWidget *w, struct cbdata *data)
 static void config_buddy_clicked_cb(GtkButton *button, struct cbdata *data)
 {
     gboolean enabled = gtk_toggle_button_get_active(
-			     GTK_TOGGLE_BUTTON(data->oo.enablebox));
+			     GTK_TOGGLE_BUTTON(data->os.enablebox));
     
     /* Apply the changes */
     otrg_gtk_ui_buddy_prefs_save(data->buddy,
@@ -810,11 +904,11 @@ static void config_buddy_clicked_cb(GtkButton *button, struct cbdata *data)
 	     GTK_TOGGLE_BUTTON(data->defaultbox)),
 	 enabled,
 	 gtk_toggle_button_get_active(
-	     GTK_TOGGLE_BUTTON(data->oo.automaticbox)),
+	     GTK_TOGGLE_BUTTON(data->os.automaticbox)),
 	 gtk_toggle_button_get_active(
-	     GTK_TOGGLE_BUTTON(data->oo.onlyprivatebox)),
+	     GTK_TOGGLE_BUTTON(data->os.onlyprivatebox)),
 	 gtk_toggle_button_get_active(
-	     GTK_TOGGLE_BUTTON(data->oo.avoidloggingotrbox)));
+	     GTK_TOGGLE_BUTTON(data->os.avoidloggingotrbox)));
 
     otrg_dialog_resensitize_all();
 }
@@ -840,7 +934,7 @@ static void otrg_gtk_ui_config_buddy(PurpleBuddy *buddy)
 					 GTK_STOCK_OK, GTK_RESPONSE_OK,
 					 NULL);
     gtk_window_set_accept_focus(GTK_WINDOW(dialog), FALSE);
-    gtk_window_set_role(GTK_WINDOW(dialog), "otr_options");
+    gtk_window_set_role(GTK_WINDOW(dialog), "otr_settings");
 
     gtk_container_set_border_width(GTK_CONTAINER(dialog), 6);
     gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
@@ -879,19 +973,19 @@ static void otrg_gtk_ui_config_buddy(PurpleBuddy *buddy)
     gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), gtk_hseparator_new(),
 	    FALSE, FALSE, 5);
 
-    create_otroption_buttons(&(data->oo), GTK_DIALOG(dialog)->vbox);
+    create_otrsettings_buttons(&(data->os), GTK_DIALOG(dialog)->vbox);
 
     g_signal_connect(G_OBJECT(data->defaultbox), "clicked",
 		     G_CALLBACK(default_clicked_cb), data);
     g_signal_connect(G_OBJECT(data->defaultbox), "clicked",
 		     G_CALLBACK(config_buddy_clicked_cb), data);
-    g_signal_connect(G_OBJECT(data->oo.enablebox), "clicked",
+    g_signal_connect(G_OBJECT(data->os.enablebox), "clicked",
 		     G_CALLBACK(config_buddy_clicked_cb), data);
-    g_signal_connect(G_OBJECT(data->oo.automaticbox), "clicked",
+    g_signal_connect(G_OBJECT(data->os.automaticbox), "clicked",
 		     G_CALLBACK(config_buddy_clicked_cb), data);
-    g_signal_connect(G_OBJECT(data->oo.onlyprivatebox), "clicked",
+    g_signal_connect(G_OBJECT(data->os.onlyprivatebox), "clicked",
 		     G_CALLBACK(config_buddy_clicked_cb), data);
-    g_signal_connect(G_OBJECT(data->oo.avoidloggingotrbox), "clicked",
+    g_signal_connect(G_OBJECT(data->os.avoidloggingotrbox), "clicked",
 		     G_CALLBACK(config_buddy_clicked_cb), data);
 
     /* Set the inital states of the buttons */
@@ -916,10 +1010,12 @@ static void otrg_gtk_ui_get_prefs(OtrgUiPrefs *prefsp, PurpleAccount *account,
 
     prefsp->policy = OTRL_POLICY_DEFAULT;
     prefsp->avoid_logging_otr = FALSE;
+    prefsp->show_otr_button = FALSE;
     
     /* Get the default policy */
     otrg_gtk_ui_global_prefs_load(&otrenabled, &otrautomatic, &otronlyprivate,
 	    &otravoidloggingotr);
+    otrg_gtk_ui_global_options_load(&(prefsp->show_otr_button));
 
     if (otrenabled) {
 	if (otrautomatic) {
diff --git a/gtk-ui.h b/gtk-ui.h
index 64d4452..4811211 100644
--- a/gtk-ui.h
+++ b/gtk-ui.h
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
diff --git a/otr-icons.h b/otr-icons.h
new file mode 100644
index 0000000..64a83cf
--- /dev/null
+++ b/otr-icons.h
@@ -0,0 +1,508 @@
+/*
+ *  Off-the-Record Messaging plugin for pidgin
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
+ *                           <otr at cypherpunks.ca>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* The new OTR icons from <cyrus_xiii at yahoo.com>; the pixbuf inline
+ * representations are generated by:
+ * gdk-pixbuf-csource --raw --name=foo foo.png   */
+
+/* The pixbufs are used to generate the menu and button icons; the pngs
+ * are used to generate the inline images in the conversation window. */
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+#ifdef __SUNPRO_C
+#pragma align 4 (not_private_pixbuf)
+#endif
+#ifdef __GNUC__
+static const guint8 not_private_pixbuf[] __attribute__ ((__aligned__ (4))) = 
+#else
+static const guint8 not_private_pixbuf[] = 
+#endif
+{ ""
+  /* Pixbuf magic (0x47646b50) */
+  "GdkP"
+  /* length: header (24) + pixel_data (1024) */
+  "\0\0\4\30"
+  /* pixdata_type (0x1010002) */
+  "\1\1\0\2"
+  /* rowstride (64) */
+  "\0\0\0@"
+  /* width (16) */
+  "\0\0\0\20"
+  /* height (16) */
+  "\0\0\0\20"
+  /* pixel_data: */
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\220\220\220\1|||m}}}\335zzz\366|||\265"
+  "yyy\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0qqq\1\200\200\200\252\250\250\250\377\313\313\313\377\316\316"
+  "\316\377\265\265\265\377\213\213\213\377rrrK\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0{{{n\250\250\250\377\330\330"
+  "\330\377\326\326\326\377\312\312\312\377\300\300\300\377\274\274\274"
+  "\377\201\201\201\347}}}\335zzz\366|||\265yyy\25\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0|||\335\310\310\310\377\320\320\320\377\322\322\322\377\311"
+  "\311\311\377\273\273\273\377\221\221\221\377\250\250\250\377\313\313"
+  "\313\377\316\316\316\377\265\265\265\377\213\213\213\377rrrK\0\0\0\0"
+  "\220\220\220\1|||m|||\376|||\377\220\220\220\377\276\276\276\377\277"
+  "\277\277\377\235\235\235\377\250\250\250\377\330\330\330\377\326\326"
+  "\326\377\312\312\312\377\300\300\300\377\275\275\275\377\207\207\207"
+  "\325qqq\1\200\200\200\252\250\250\250\377\313\313\313\377\316\316\316"
+  "\377\265\265\265\377\213\213\213\377\240\240\240\377\202\202\202\377"
+  "\310\310\310\377\320\320\320\377\322\322\322\377\311\311\311\377\274"
+  "\274\274\377\264\264\264\377\240\240\240\375{{{n\250\250\250\377\330"
+  "\330\330\377\326\326\326\377\312\312\312\377\300\300\300\377\275\275"
+  "\275\377\214\214\214\377zzz\377\311\311\311\377\303\303\303\377\305\305"
+  "\305\377\277\277\277\377\267\267\267\377\255\255\255\377\242\242\242"
+  "\377|||\335\310\310\310\377\320\320\320\377\322\322\322\377\311\311\311"
+  "\377\274\274\274\377\264\264\264\377\237\237\237\377\177\177\177\377"
+  "\261\261\261\377\271\271\271\377\267\267\267\377\264\264\264\377\252"
+  "\252\252\377\260\260\260\377\224\224\224\354zzz\367\311\311\311\377\303"
+  "\303\303\377\305\305\305\377\277\277\277\377\267\267\267\377\255\255"
+  "\255\377\242\242\242\377\226\226\226\377\207\207\207\377\270\270\270"
+  "\377\256\256\256\377\250\250\250\377\256\256\256\377\251\251\251\377"
+  "sss\264|||\266\261\261\261\377\271\271\271\377\267\267\267\377\264\264"
+  "\264\377\252\252\252\377\260\260\260\377\223\223\223\377ooo\377www\377"
+  "\230\230\230\377\236\236\236\377\237\237\237\377\232\232\232\377\223"
+  "\223\223\377ZZZ\306yyy\25\207\207\207\377\270\270\270\377\256\256\256"
+  "\377\250\250\250\377\256\256\256\377\251\251\251\377\177\177\177\377"
+  "MMM\377\262\262\262\377\271\271\271\377\275\275\275\377\276\276\276\377"
+  "\251\251\251\377\245\245\245\377\205\205\205\364CCCfwww\377\230\230\230"
+  "\377\236\236\236\377\237\237\237\377\232\232\232\377\223\223\223\377"
+  "\\\\\\\377AAA\377\261\261\261\377\234\234\234\377\232\232\232\377\223"
+  "\223\223\377\214\214\214\377\221\221\221\377\217\217\217\374DDD\345\262"
+  "\262\262\377\271\271\271\377\275\275\275\377\276\276\276\377\251\251"
+  "\251\377\245\245\245\377\205\205\205\364AAA\270\214\214\214\377\242\242"
+  "\242\377\235\235\235\377\235\235\235\377\235\235\235\377\246\246\246"
+  "\377sss\361BBB\372\261\261\261\377\234\234\234\377\232\232\232\377\223"
+  "\223\223\377\214\214\214\377\221\221\221\377\217\217\217\374888GLLL\266"
+  "bbb\377ccc\377ccc\377ccc\377aaa\364@@@qEEE\244\214\214\214\377\242\242"
+  "\242\377\235\235\235\377\235\235\235\377\235\235\235\377\246\246\246"
+  "\377sss\3618883\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0>>>\12LLL\266bbb\377ccc\377ccc\377ccc\377aaa\364@@@q\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
+
+static const char not_private_png[] =
+    "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52"
+    "\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff"
+    "\x61\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00"
+    "\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93"
+    "\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7"
+    "\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xd8\x01"
+    "\x1f\x17\x24\x0d\x91\x93\x72\x75\x00\x00\x02\x6f\x49\x44\x41\x54"
+    "\x38\xcb\x7d\x92\x3d\x4f\xdb\x50\x18\x85\xcf\xbd\xfe\xc0\xb1\x55"
+    "\x8c\x9c\x34\xb4\x5d\x02\x4a\x25\x22\x22\xa2\x08\x58\x10\xbf\x00"
+    "\xd4\xa5\x43\xa6\x0e\xed\xd4\xa9\x5f\x41\xdd\x58\xba\xb1\x51\xf8"
+    "\x19\x74\xac\xe8\x4c\x16\xa4\x28\x52\x16\x06\x4b\x08\x70\x90\x40"
+    "\xb2\xd5\xba\x03\xb1\x71\xee\x95\x7d\xaf\xbb\xb5\x14\x25\x3c\xdb"
+    "\xbb\x9c\xe7\x1c\xe9\x25\xb8\xc7\xde\xde\x1e\x09\xc3\xf0\x1d\x21"
+    "\xe4\x93\x10\xe2\x29\xa5\xf4\x48\x08\xf1\x66\x67\x67\xe7\x17\xc6"
+    "\x40\xee\x1e\xed\x76\x9b\xd8\xb6\x7d\x50\xab\xd5\x5a\xd5\x6a\x15"
+    "\x8a\xa2\xc0\xf7\x7d\xb8\xae\x0b\xdf\xf7\x5f\xec\xee\xee\xfe\x78"
+    "\x30\x60\x7b\x7b\xfb\xc3\xd2\xd2\xd2\x7e\xb3\xd9\x84\x94\x12\x71"
+    "\x1c\x23\x49\x12\x64\x59\x86\xe3\xe3\xe3\x20\xcb\xb2\xe4\x7e\x2b"
+    "\xf5\xbf\x34\x42\x3e\xce\xcd\xcd\x81\x31\x06\x4a\x29\xf2\x3c\x47"
+    "\x9a\xa6\x70\x5d\x17\x0b\x0b\x0b\x4f\xee\xb4\xda\x74\x5d\xf7\xe7"
+    "\xd6\xd6\xd6\x0b\x72\x77\x37\x80\x7d\x00\xa4\x54\x2a\xa1\xd1\x68"
+    "\x80\x10\x02\xcf\xf3\x60\x59\x16\xee\xb7\x12\x42\xa0\xd7\xeb\xb9"
+    "\x4a\xbb\xdd\x26\x00\x0e\x16\x17\x17\x3f\xaf\xad\xad\x91\x7a\xbd"
+    "\x0e\x5d\xd7\x71\x72\x72\x82\x34\x4d\x71\x7d\x7d\x8d\x95\x95\x15"
+    "\x00\xf8\xdb\x88\x31\x06\xc6\x18\x14\x45\x29\x52\xd3\x34\xdf\xd7"
+    "\x6a\xb5\x56\xb3\xd9\x84\x65\x59\xc8\xb2\x0c\x96\x65\x61\x79\x79"
+    "\x19\x61\x18\x82\x31\x06\x42\x08\xa2\x28\x42\x14\x45\x48\x92\x04"
+    "\x69\x9a\x82\x73\x0e\x4a\x29\x55\xc7\xed\xce\xb2\x0c\x8c\x31\x14"
+    "\x8b\x45\x44\x51\x84\x20\x08\x60\x18\x06\xa4\x94\x10\x42\x20\x49"
+    "\x12\xe8\xba\x8e\xe1\x70\xf8\x9b\x4a\x29\x9f\x4d\x32\x28\x8a\x82"
+    "\xd9\xd9\x59\xb8\xae\x8b\x3c\xcf\x31\x1a\x8d\x10\xc7\x31\x54\x55"
+    "\x05\xe7\x1c\x83\xc1\xa0\xab\x52\x4a\x8f\x82\x20\xd8\x18\x67\xb8"
+    "\xb9\xb9\xc1\xf9\xf9\x39\x0c\xc3\xc0\xe5\xe5\x25\x74\x5d\x07\x21"
+    "\x04\xc3\xe1\x10\x9c\x73\xf8\xbe\xef\x50\x21\xc4\xeb\x49\x86\x30"
+    "\x0c\xe1\x79\x1e\xd6\xd7\xd7\x31\x3f\x3f\x8f\x4a\xa5\x82\x4a\xa5"
+    "\x02\xdb\xb6\xe1\x38\x0e\xea\xf5\x7a\x43\xed\xf5\x7a\x2f\x57\x57"
+    "\x57\xc7\x1a\x2e\x2e\x2e\x10\xc7\x31\xf2\x3c\xc7\xd5\xd5\x15\xa4"
+    "\x94\xe0\x9c\x83\x73\x0e\x4d\xd3\x60\x9a\xa6\xa1\x54\xab\xd5\xef"
+    "\xad\x56\xeb\x51\xa9\x54\x82\xe3\x38\x98\x99\x99\x81\x10\x02\x53"
+    "\x53\x53\xd0\x34\xed\xd6\xf3\xbc\xa3\x62\xb1\xf8\x7c\x7a\x7a\x1a"
+    "\x79\x9e\x43\xd3\x34\x14\x0a\x05\xd8\xb6\x8d\xd3\xd3\xd3\x58\x95"
+    "\x52\x3e\x7e\xc8\x30\x1a\x8d\xbe\x76\x3a\x1d\x59\x2e\x97\x37\x08"
+    "\xf9\xf7\xf9\x52\xca\xdb\xc1\x60\xf0\x45\x55\x14\xe5\xdb\xd9\xd9"
+    "\xd9\xab\x72\xb9\x8c\x34\x4d\x61\x9a\x26\x4c\xd3\x44\xa1\x50\x40"
+    "\xbf\xdf\xbf\x05\x10\x1e\x1e\x1e\x6e\x62\x02\x2a\xe7\xfc\x6d\xa7"
+    "\xd3\x71\x26\x19\xba\xdd\x6e\x1f\x0f\xf0\x07\x80\x70\x86\xf9\xad"
+    "\x8e\x2a\x07\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82";
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+#ifdef __SUNPRO_C
+#pragma align 4 (unverified_pixbuf)
+#endif
+#ifdef __GNUC__
+static const guint8 unverified_pixbuf[] __attribute__ ((__aligned__ (4))) = 
+#else
+static const guint8 unverified_pixbuf[] = 
+#endif
+{ ""
+  /* Pixbuf magic (0x47646b50) */
+  "GdkP"
+  /* length: header (24) + pixel_data (1024) */
+  "\0\0\4\30"
+  /* pixdata_type (0x1010002) */
+  "\1\1\0\2"
+  /* rowstride (64) */
+  "\0\0\0@"
+  /* width (16) */
+  "\0\0\0\20"
+  /* height (16) */
+  "\0\0\0\20"
+  /* pixel_data: */
+  "\0\0\0\0\0\0\0\0yyy\25|||\231}}}\335yyy\373|||\335{{{\231yyy\25\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0yyy@|||\357"
+  "\245\245\245\371\303\303\303\377\313\313\313\377\274\274\274\377\237"
+  "\237\237\371{{{\357yyy@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0yyy\25{{{\357\302\302\302\377\326\326\326\377\321\321\321\377\312\312"
+  "\312\377\305\305\305\377\304\304\304\377\262\262\262\377zzz\357yyy\25"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0{{{\231\245\245\245\371\324\324"
+  "\324\377\324\324\324\377\327\327\327\377\316\316\316\377\304\304\304"
+  "\377\272\272\272\377\276\276\276\377\232\232\232\371zzz\231\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0|||\335\300\300\300\377\314\314\314\377"
+  "\321\321\321\377\322\322\322\377\314\314\314\377\303\303\303\377\271"
+  "\271\271\377\264\264\264\377\205pp\377\244\0\0\377;\0\0\\\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0yyy\373\307\307\307\377\303\303\303\377\307\307\307"
+  "\377\310\310\310\377\304\304\304\377\276\276\276\377\266\266\266\377"
+  "\256\256\256\377\244\0\0\377\244\0\0\377\244\0\0\377\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0|||\335\270\270\270\377\276\276\276\377\275\275\275\377"
+  "\276\276\276\377\273\273\273\377\266\266\266\377\257\257\257\377\203"
+  "mm\377\244\0\0\377\244\0\0\377\244\0\0\377;\0\0\\\0\0\0\0\0\0\0\0\0\0"
+  "\0\0{{{\231\234\234\234\371\276\276\276\377\263\263\263\377\264\264\264"
+  "\377\262\262\262\377\255\255\255\377\250\250\250\377\244\0\0\377\244"
+  "\0\0\377\377\377\377\377\244\0\0\377\244\0\0\377\0\0\0\0\0\0\0\0\0\0"
+  "\0\0yyy\25xxx\371\255\255\255\377\270\270\270\377\256\256\256\377\250"
+  "\250\250\377\251\251\251\377\205pp\377\244\0\0\377\345\273\273\377\300"
+  "\300\300\377\337\252\252\377\244\0\0\377;\0\0\\\0\0\0\0\0\0\0\0AAA\77"
+  "\\\\\\\367\200\200\200\377\230\230\230\377\253\253\253\377\262\262\262"
+  "\377\252\252\252\377\244\0\0\377\244\0\0\377\377\377\377\377SSS\377\377"
+  "\377\377\377\244\0\0\377\244\0\0\377\0\0\0\0\0\0\0\0FFF\276\225\225\225"
+  "\376\310\310\310\377\243\243\243\377\210\210\210\377{{{\377lVV\377\244"
+  "\0\0\377\304[[\377\377\377\377\377)))\377\377\377\377\377\304[[\377\244"
+  "\0\0\377;\0\0\\\0\0\0\10CCC\360\254\254\254\377\251\251\251\377\277\277"
+  "\277\377\317\317\317\377\331\331\331\377\244\0\0\377\244\0\0\377\377"
+  "\377\377\377\377\377\377\377\314\314\314\377\377\377\377\377\377\377"
+  "\377\377\244\0\0\377\244\0\0\377\0\0\0\33BBB\372\256\256\256\377\235"
+  "\235\235\377\234\234\234\377\232\232\232\377t__\377\244\0\0\377\317{"
+  "{\377\377\377\377\377\377\377\377\377)))\377\377\377\377\377\377\377"
+  "\377\377\304[[\377\244\0\0\377;\0\0oEEE\324\226\226\226\377\247\247\247"
+  "\377\220\220\220\377\215\215\215\377\244\0\0\377\244\0\0\377\377\377"
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
+  "\377\377\377\377\377\377\377\377\377\244\0\0\377\244\0\0\377AAA6GGG\365"
+  "\235\235\235\377\263\263\263\377\270\270\270\377\244\0\0\377\244\0\0"
+  "\377\244\0\0\377\244\0\0\377\244\0\0\377\244\0\0\377\244\0\0\377\244"
+  "\0\0\377\244\0\0\377\244\0\0\377\244\0\0\377\0\0\0\0CCC\\@@@\332AAA\374"
+  "AAA\377>))\377\244\0\0\377\244\0\0\377\244\0\0\377\244\0\0\377\244\0"
+  "\0\377\244\0\0\377\244\0\0\377\244\0\0\377\244\0\0\377;\0\0\\"};
+
+static const char unverified_png[] =
+    "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52"
+    "\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff"
+    "\x61\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00"
+    "\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93"
+    "\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7"
+    "\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xd8\x01"
+    "\x1f\x17\x26\x0b\x4a\xc6\xb5\xc2\x00\x00\x02\x55\x49\x44\x41\x54"
+    "\x38\xcb\x8d\x92\xbd\x4b\x5b\x51\x18\x87\x9f\x73\xaf\xf7\x26\x44"
+    "\xa1\x7e\xa6\x42\x4a\x6a\x8b\x54\xd4\xa5\x20\x14\xc4\xa1\x0d\x51"
+    "\xcc\x1a\x90\x2c\x9a\x55\x70\x76\x0a\x96\x76\x11\xb3\x0a\x0e\xfd"
+    "\x03\x8a\x8b\x04\xba\x16\x14\xac\x05\x21\x52\xdc\xda\x08\x12\xa1"
+    "\xa8\x83\x62\x51\x2f\xc2\xfd\xcc\x39\xa7\x8b\x95\xa6\xa6\xb4\xbf"
+    "\xed\x1d\x7e\xcf\xfb\xbc\x87\x23\xb8\x4d\xa9\x54\xea\x33\x4d\x73"
+    "\x59\x08\x31\xd9\x68\x34\xd2\xa6\x69\x1e\x6b\xad\xb7\x94\x52\xaf"
+    "\xcb\xe5\xf2\x05\x7f\x89\xb8\x2d\xbf\x32\x4d\xf3\xc3\xf0\xf0\x70"
+    "\x22\x9d\x4e\xdb\xf1\x78\x1c\xc7\x71\x38\x39\x39\x09\xeb\xf5\xba"
+    "\xab\x94\xca\x97\xcb\xe5\x4f\x2d\x01\xa5\x52\xa9\xcf\x30\x8c\xc3"
+    "\xe9\xe9\xe9\xce\xde\xde\x5e\xa2\x28\x22\x08\x02\xa2\x28\x42\x6b"
+    "\xcd\xe5\xe5\x25\xd5\x6a\xf5\x5a\x6b\xfd\xac\x95\x89\x61\x18\xc6"
+    "\xf2\xc8\xc8\x48\xa2\xbb\xbb\x1b\xa5\x14\xb6\x6d\xd3\xd6\xd6\x86"
+    "\xd6\x1a\xd7\x75\xe9\xe8\xe8\x60\x60\x60\x20\x21\x84\x58\x6e\x65"
+    "\x60\x08\x21\x26\x53\xa9\x94\xed\xfb\x3e\x52\x4a\xa2\x28\x42\x29"
+    "\x85\xd6\xfa\x0e\x72\x51\xab\xd9\x23\x2b\x2b\xf3\x13\x30\x77\x0f"
+    "\x20\xa5\x4c\xc7\x62\x31\x3c\xcf\xc3\x75\x5d\x5c\xd7\xc5\xf7\x7d"
+    "\xa2\x28\x42\x4a\x49\x18\x86\x3c\x5e\x5d\x05\x60\x01\xde\xdf\x03"
+    "\x98\xa6\x79\xec\x38\x0e\x51\x14\xdd\x01\x3c\xcf\xc3\xf7\x7d\x82"
+    "\x20\xe0\xdb\xf6\x76\x53\xe1\x4f\x0b\x43\x6b\xbd\x75\x7a\x7a\x1a"
+    "\x02\x4d\x00\xcf\xf3\x08\x82\x80\x27\x6b\x6b\x00\xcc\x6a\xdd\xd2"
+    "\xc2\x50\x4a\xbd\xae\xd7\xeb\x5c\x5d\x5d\x61\x59\x16\x61\x18\xe2"
+    "\xba\x2e\x8d\x46\x83\xa3\x6a\x15\x80\xcc\xe6\x26\x3b\x3b\x3b\x4c"
+    "\x6c\x6c\xdc\xb3\x10\x99\x4c\xe6\x65\x2a\x95\xfa\x38\x38\x38\x18"
+    "\xef\xef\xef\xa7\xa7\xa7\x87\x58\x2c\x86\xef\xfb\x84\x85\xc2\xdd"
+    "\xf6\x99\x99\x19\x2a\x95\x0a\xeb\x42\x00\x30\x77\xfb\x87\x0c\xcb"
+    "\xb2\xde\x8e\x8f\x8f\xc7\x72\xb9\x1c\xed\xed\xed\x1c\x1d\x1d\xb1"
+    "\xb7\xb7\xc7\xe7\x4a\x05\x80\x81\xd9\x59\x00\x6a\xb5\x5a\xd3\x7c"
+    "\x6b\x11\x17\xd9\x6c\xf6\x7a\x61\x61\xe1\x81\x94\x92\x64\x32\x49"
+    "\x67\x67\x27\x89\x44\x82\x2f\x43\x43\x4d\xb7\xef\xef\xef\x33\x36"
+    "\x36\x06\xf0\xbb\xc5\xa3\x36\xad\x75\xc2\x30\x0c\x1c\xc7\xe1\xe6"
+    "\xe6\x06\xa5\x14\x87\xbb\xbb\x3c\x07\x46\x97\x96\xee\x1e\xab\x58"
+    "\x2c\x36\x59\x7c\x5f\x5f\x67\x02\x66\xc4\xd4\xd4\xd4\xd7\x7c\x3e"
+    "\x3f\xda\xd5\xd5\xc5\xf9\xf9\x39\x52\x4a\x1e\x2e\x2e\x36\x6d\x6f"
+    "\x95\x5f\x16\x22\x93\xc9\xbc\xb0\x6d\x7b\xbb\x50\x28\x24\x92\xc9"
+    "\x24\x96\x65\xf1\x23\x97\xe3\x7f\x23\x00\xb2\xd9\xec\x9c\x94\xf2"
+    "\x8d\x10\xe2\x29\x60\xca\xb3\x33\xe6\x0f\x0e\xfe\x59\x7e\x07\xc5"
+    "\x9f\xbe\xe0\x26\xd8\x54\xc1\xc5\x45\x00\x00\x00\x00\x49\x45\x4e"
+    "\x44\xae\x42\x60\x82";
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+#ifdef __SUNPRO_C
+#pragma align 4 (private_pixbuf)
+#endif
+#ifdef __GNUC__
+static const guint8 private_pixbuf[] __attribute__ ((__aligned__ (4))) = 
+#else
+static const guint8 private_pixbuf[] = 
+#endif
+{ ""
+  /* Pixbuf magic (0x47646b50) */
+  "GdkP"
+  /* length: header (24) + pixel_data (1024) */
+  "\0\0\4\30"
+  /* pixdata_type (0x1010002) */
+  "\1\1\0\2"
+  /* rowstride (64) */
+  "\0\0\0@"
+  /* width (16) */
+  "\0\0\0\20"
+  /* height (16) */
+  "\0\0\0\20"
+  /* pixel_data: */
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\262s\15\25\264v\21\231\265w"
+  "\22\335\262s\16\373\265v\21\335\264u\17\231\262s\15\25\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\262s\15@\264v\21\357"
+  "\321\240T\371\345\277\204\377\353\310\217\377\343\270v\377\317\232F\371"
+  "\264u\20\357\262s\15@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\262s\15\25\264u\21\357\344\276\202\377\361\323\244\377\357\316\232\377"
+  "\355\306\212\377\354\300}\377\354\300|\377\336\255`\377\263t\17\357\262"
+  "s\15\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264u\20\231\321\240R"
+  "\371\361\320\240\377\361\321\241\377\362\324\250\377\357\312\222\377"
+  "\354\300|\377\350\265f\377\351\271n\377\315\224:\371\264t\16\231\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\265v\22\335\344\274~\377\356\310"
+  "\216\377\360\315\230\377\360\317\234\377\356\310\215\377\353\276y\377"
+  "\350\264d\377\346\257X\377\337\253X\377\264u\16\335\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\262s\16\373\352\303\206\377\353\277z\377\355\303"
+  "\203\377\355\304\205\377\354\300|\377\351\271m\377\347\260[\377\344\250"
+  "J\377\345\261`\377\262s\15\373\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\265v\20\335\341\264m\377\351\271n\377\351\270l\377\351\271n\377\351"
+  "\266h\377\347\261\\\377\345\251M\377\343\246F\377\335\246O\377\264u\16"
+  "\335\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264u\16\231\315\227\77\371"
+  "\351\271n\377\346\255U\377\346\256V\377\345\254R\377\344\247H\377\342"
+  "\241<\377\345\253Q\377\313\2212\371\264t\16\231\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\262s\15\25\260r\22\371\335\250U\377\347\263`\377\343"
+  "\250J\377\342\242>\377\342\243\77\377\344\252N\377\334\243I\377\261r"
+  "\20\367\262s\15\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\5f\77~RZ"
+  "\367\266z\32\377\314\2237\377\335\246N\377\343\255W\377\335\245L\377"
+  "\314\2226\377\266y\32\377xMT\370\\5f$\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0a:j\276\253\214\252\376\326\304\305\377\307\237b\377\273\203"
+  "*\377\263u\20\377\272\202*\377\305\234`\377\325\302\304\377\236\177\241"
+  "\373`9i\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0_7h\360\300\244\275"
+  "\377\300\240\273\377\316\271\313\377\331\313\325\377\340\326\334\377"
+  "\323\277\317\377\275\233\272\377\261\210\255\377\267\233\266\377b:k\320"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0]6g\372\302\246\277\377\270\223"
+  "\264\377\270\221\262\377\266\217\262\377\263\212\257\377\256\202\252"
+  "\377\255\177\250\377\260\205\254\377\275\242\273\377a:j\334\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0a9j\324\254\215\253\377\277\236\273\377"
+  "\260\204\253\377\255\200\251\377\255\177\250\377\255\177\250\377\256"
+  "\201\251\377\274\231\267\377\264\226\262\377a9j\335\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\\5f6b<k\365\263\224\261\377\306\254\302\377\312"
+  "\261\306\377\312\261\306\377\312\261\306\377\310\257\305\377\266\230"
+  "\264\377jEr\365\\5fP\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "^7h\\a9j\330\\5f\374\\5f\377\\5f\377\\5f\377\\5f\375a9j\330^7hr\0\0\0"
+  "\0\0\0\0\0\0\0\0\0"};
+
+static const char private_png[] =
+    "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52"
+    "\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff"
+    "\x61\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00"
+    "\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93"
+    "\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7"
+    "\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xd8\x01"
+    "\x1f\x17\x26\x33\x62\xc4\x0d\x5c\x00\x00\x02\x74\x49\x44\x41\x54"
+    "\x38\xcb\x75\x93\x3f\x68\x53\x51\x14\xc6\xbf\x7b\xef\xcb\xcb\x9f"
+    "\x97\x54\x4d\x9b\xd6\x96\x26\x2d\x45\x8a\xb4\x15\x4a\x17\xc1\x49"
+    "\x31\x08\x15\x2c\x76\x53\x10\x07\x27\x1d\x25\x6b\xc0\xa5\xab\xce"
+    "\xd2\xd1\xb1\x0e\x81\x0e\x05\xa1\x60\x70\xb0\xea\x54\x14\x97\x26"
+    "\x2d\x98\x56\x93\xbc\xc6\xa6\xcd\x9f\xf7\x5e\xde\x7b\xf7\x5c\xa7"
+    "\xda\x14\x9f\x67\x3c\x9c\xef\xc7\xf7\x9d\xc3\x61\x08\xa8\xf5\x5c"
+    "\x22\xc5\x85\xb6\xc2\x18\xcb\x4a\xdf\xcf\x08\x21\x2a\x4a\xd1\x26"
+    "\x11\xe5\x97\x5e\xb6\x0f\xfb\x67\x59\x80\xf8\x26\x17\x5a\x21\x3d"
+    "\x73\x3b\x36\x34\x31\xaf\xeb\x51\x03\xce\x71\x15\x8d\xca\xb6\xfb"
+    "\xb3\xf4\xc5\x22\x92\xcb\x4b\x2f\xdb\xc5\x40\xc0\x7a\x2e\x91\xe2"
+    "\x5c\xdb\x99\x5f\x7c\x7e\x31\x91\x9a\x02\x79\x16\xc8\x39\x86\x72"
+    "\xdb\x00\x14\x5a\xbf\x0f\xf0\x7d\xab\x70\xac\x14\x4d\x9f\x3a\xe1"
+    "\xfd\x00\xce\xc5\x4a\x7a\xf6\x56\x2c\x91\xcc\x00\x24\x21\xf4\x01"
+    "\x70\x2d\x02\x40\xc1\xef\x9a\x30\xe2\x03\x18\x9b\x9c\x8d\x71\xc6"
+    "\x56\xfe\x6a\xce\xe5\x61\x3c\x3b\x38\x3e\xa7\x4b\xe7\x08\xca\xb7"
+    "\x41\x5e\x07\x8a\x3c\x28\x92\x80\x22\x48\xcb\x44\x72\x24\xa3\x83"
+    "\x21\x7b\xaa\xd1\xfa\x01\x52\xfa\x19\x3d\x1c\x81\xb4\x1b\x50\x5e"
+    "\x14\x60\xfc\x0c\xe4\xdb\xa0\x5e\x0b\x7a\x74\x18\x44\x2a\x13\x08"
+    "\x10\x82\x57\xec\x93\xea\x54\x24\xc4\x40\xbd\x16\xc0\x38\x20\x5d"
+    "\x90\xd7\x01\xf5\x5a\x50\xe4\xa3\xd7\x6d\x82\x73\x56\x09\x8c\xa0"
+    "\x14\x6d\x36\xf6\xbf\xba\x00\x20\xbb\x75\xc8\x6e\x0d\xbe\x65\x42"
+    "\x5a\x0d\x48\xa7\x09\x1e\x32\x70\x74\xb8\xef\x42\x61\x33\x10\x40"
+    "\xa4\xf2\xfb\xa5\x6f\xe8\x34\xab\x60\xba\x01\xe9\x76\x20\xad\x06"
+    "\xc8\xb7\xc1\xa3\x49\xd8\x8e\x83\x5f\x3f\xf6\x88\x94\xca\x07\x46"
+    "\x58\xfb\xf0\x70\x66\x2a\xdd\x21\x3d\x52\xc4\xf0\x68\x1a\x97\x06"
+    "\x47\xa0\x1b\xa3\x70\x9d\x2e\x9a\xb5\x1a\xcc\xea\x01\xb6\x4a\x59"
+    "\x76\x50\x4b\x5e\x00\x56\xff\x3d\x63\x28\xa4\xbd\xb8\x76\xe3\x7e"
+    "\x78\xf2\xee\x5b\x78\xf1\x59\xec\xed\x96\xb1\xfd\xe9\x1d\x76\x77"
+    "\xf7\xd0\x8b\xcd\x60\x62\x71\x0d\xd3\x0b\xf7\x84\xa6\x89\x60\x07"
+    "\x24\x69\x21\x75\x79\x90\x99\x65\x0b\x03\x63\xcf\x90\x9c\xcb\x21"
+    "\x6c\x84\xd1\xae\xb7\x61\x96\x0f\x51\xfe\x58\xc7\xe8\x78\x4a\xe3"
+    "\x8c\xcf\x07\x03\x94\x8a\x71\xce\x61\xb5\x6d\x38\x27\x55\x10\x01"
+    "\xd2\x93\xf0\x1c\x0f\x4a\x12\x84\xae\x41\x0f\x87\xa0\xa0\xe2\x81"
+    "\x4b\xd4\x84\xd8\x31\xab\x0d\x84\x8d\x30\x9c\x76\x0f\xf6\x89\x0d"
+    "\xb7\xdb\x83\x92\x04\xc6\x19\xe2\x43\x06\xec\x8e\x0d\xa8\xb3\x17"
+    "\x38\xe7\xc0\xf3\xfd\x27\x1b\x85\xe2\xfb\xe5\x07\x77\x62\xc3\x57"
+    "\x47\xa0\x85\xb4\xfe\x0b\xe1\xa8\xde\xc4\x46\xa1\x68\x79\xbe\x9f"
+    "\xfb\xef\x37\x3e\xbe\xfe\xf4\x91\xe0\x3c\xef\xf9\xfe\x15\x00\xa2"
+    "\x3f\x61\x48\xd3\x4a\x92\x68\xf5\xcd\xe7\xd7\xaf\x4e\x9b\x7f\x00"
+    "\x07\xd5\x38\xa8\xb2\x4d\x13\xc5\x00\x00\x00\x00\x49\x45\x4e\x44"
+    "\xae\x42\x60\x82";
+
+/* GdkPixbuf RGBA C-Source image dump */
+
+#ifdef __SUNPRO_C
+#pragma align 4 (finished_pixbuf)
+#endif
+#ifdef __GNUC__
+static const guint8 finished_pixbuf[] __attribute__ ((__aligned__ (4))) = 
+#else
+static const guint8 finished_pixbuf[] = 
+#endif
+{ ""
+  /* Pixbuf magic (0x47646b50) */
+  "GdkP"
+  /* length: header (24) + pixel_data (1024) */
+  "\0\0\4\30"
+  /* pixdata_type (0x1010002) */
+  "\1\1\0\2"
+  /* rowstride (64) */
+  "\0\0\0@"
+  /* width (16) */
+  "\0\0\0\20"
+  /* height (16) */
+  "\0\0\0\20"
+  /* pixel_data: */
+  "\0\0\0\0\0\0\0\0yyy\25|||\231}}}\335yyy\373|||\335{{{\231yyy\25\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0yyy@|||\357"
+  "\245\245\245\371\303\303\303\377\313\313\313\377\274\274\274\377\237"
+  "\237\237\371{{{\357yyy@\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0yyy\25{{{\357\302\302\302\377\326\326\326\377\321\321\321\377\312\312"
+  "\312\377\305\305\305\377\304\304\304\377\262\262\262\377zzz\357yyy\25"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0{{{\231\245\245\245\371\324\324"
+  "\324\377\324\324\324\377\327\327\327\377\316\316\316\377\304\304\304"
+  "\377\272\272\272\377\276\276\276\377\232\232\232\371zzz\231\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0|||\335\300\300\300\377\314\314\314\377"
+  "\321\321\321\377\322\322\322\377\314\314\314\377\303\303\303\377\271"
+  "\271\271\377\264\264\264\377\260\260\260\377{{{\335\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0\0\0\0\0yyy\373\307\307\307\377\303\303\303\377\307\307"
+  "\307\377\310\310\310\377\304\304\304\377\276\276\276\377\266\266\266"
+  "\377\256\256\256\377\266\266\266\377yyy\373\0\0\0\0\0\0\0\0\0\0\0\0\0"
+  "\0\0\0\0\0\0\0|||\335\270\270\270\377\276\276\276\377\275\275\275\377"
+  "\276\276\276\377\273\273\273\377\266\266\266\377\257\257\257\377r``\377"
+  "\200\12\12\377\235\40\37\377\235\0\0\376\235\0\0\376)\0\0p\0\0\0\0\0"
+  "\0\0\0{{{\231\234\234\234\371\276\276\276\377\263\263\263\377\264\264"
+  "\264\377\262\262\262\377\255\255\255\377}OO\377\257\27\27\377\335[[\377"
+  "\353xx\377\353xx\377\333ZZ\377\257\31\31\377W\0\0\206\0\0\0\0yyy\25x"
+  "xx\371\255\255\255\377\270\270\270\377\256\256\256\377\250\250\250\377"
+  "p^^\377\247\20\22\377\355yy\377\354ff\377\351PP\377\347OO\377\351``\377"
+  "\350tt\377\253\25\24\377Y0.\236AAA\77\\\\\\\367\200\200\200\377\230\230"
+  "\230\377\253\253\253\377\262\262\262\377\222\27\"\377\333XX\377\354d"
+  "d\377\350KK\377\346II\377\345GG\377\342EE\377\344ZZ\377\326UU\377\236"
+  "\36\34\377FFF\276\225\225\225\376\310\310\310\377\243\243\243\377\210"
+  "\210\210\377{{{\377\240\3\5\377\351vv\377\361\354\353\377\361\361\360"
+  "\377\362\362\360\377\361\361\360\377\361\361\357\377\362\362\360\377"
+  "\342tt\377\243\6\5\377CCC\360\254\254\254\377\251\251\251\377\277\277"
+  "\277\377\317\317\317\377\331\331\331\377\251\13\13\377\350{{\377\361"
+  "\355\354\377\362\362\360\377\360\360\356\377\356\356\354\377\356\356"
+  "\354\377\357\357\355\377\335bb\377\243\6\5\377BBB\372\256\256\256\377"
+  "\235\235\235\377\234\234\234\377\232\232\232\377\225\225\225\377\236"
+  "\36\35\377\325KK\377\342II\377\327\20\20\377\325\13\13\377\323\10\10"
+  "\377\321\6\6\377\325##\377\31355\377\200\0\0\305EEE\324\226\226\226\377"
+  "\247\247\247\377\220\220\220\377\215\215\215\377\214\214\214\377`NN\377"
+  "\255\24\24\377\336LL\377\330((\377\322\15\15\377\320\13\13\377\323!!"
+  "\377\327EE\377\243\12\12\364)\0\0\224AAA6GGG\365\235\235\235\377\263"
+  "\263\263\377\270\270\270\377\270\270\270\377\270\270\270\377\204VV\377"
+  "\254\22\22\377\31466\377\327HH\377\326HH\377\31255\377\243\12\12\364"
+  "W\0\0\206\0\0\0\0\0\0\0\0CCC\\EEE\330AAA\374AAA\377AAA\377AAA\377AAA"
+  "\3757##\351\235\40\37\377\235\0\0\376\235\0\0\376~\0\0\357)\0\0p\0\0"
+  "\0\0\0\0\0\0"};
+
+static const char finished_png[] =
+    "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52"
+    "\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff"
+    "\x61\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00"
+    "\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93"
+    "\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0d\xd7\x00\x00\x0d\xd7"
+    "\x01\x42\x28\x9b\x78\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xd8\x01"
+    "\x1f\x17\x26\x1a\x20\x76\x95\x30\x00\x00\x02\xf4\x49\x44\x41\x54"
+    "\x38\xcb\x75\x92\xcf\x6b\x5c\x55\x18\x86\x9f\x73\xcf\xdc\x99\x9b"
+    "\xcb\x58\xcd\x98\x4c\xa6\x4c\x72\x27\x84\x74\x42\x62\x2a\xc6\x10"
+    "\x48\xe8\x44\xc5\x44\x23\x74\x25\xb8\x6b\x5d\xda\x3f\xa0\x45\x61"
+    "\xa0\x20\x4a\x60\x36\x82\xc1\xa5\xe0\xa2\x4b\xeb\x42\x2d\x59\x49"
+    "\x85\x54\xa4\x4d\xc0\xd2\xa0\x04\x4b\x66\x02\x4e\x02\x25\x90\x38"
+    "\x64\x3a\x93\x3b\x3f\xce\xb9\xe7\xb8\x68\x0d\x2e\xc6\x77\xff\x3d"
+    "\xef\x0b\xdf\x23\x78\x9e\x62\xb1\x38\x28\xa5\x5c\x15\x42\x2c\x6b"
+    "\xad\x03\x29\xe5\xbe\xb5\xf6\xae\x31\xe6\x66\xa9\x54\x3a\xe2\x7f"
+    "\x22\x9e\x1f\xbf\x25\xa5\xfc\x7e\x72\x72\xd2\x0f\x82\x20\xee\x79"
+    "\x1e\xf5\x7a\x9d\x83\x83\x83\x6e\xa5\x52\x09\x8d\x31\xef\x97\x4a"
+    "\xa5\x8d\x9e\x80\x62\xb1\x38\xe8\x38\xce\xee\xca\xca\xca\x4b\x03"
+    "\x03\x03\x28\xa5\xe8\x74\x3a\x28\xa5\xb0\xd6\x52\xab\xd5\xd8\xdc"
+    "\xdc\x3c\xb1\xd6\xe6\x7b\x2d\x71\x1c\xc7\x59\x9d\x9a\x9a\xf2\x53"
+    "\xa9\x14\xc6\x18\xe2\xf1\x38\xb1\x58\x0c\x6b\x2d\x61\x18\x92\x4c"
+    "\x26\x19\x1d\x1d\xf5\x85\x10\xab\xbd\x16\x38\x42\x88\xe5\x6c\x36"
+    "\x1b\x6f\xb7\xdb\x44\x51\x84\x52\x0a\x63\x0c\xd6\xda\x33\x48\x3a"
+    "\x9d\x8e\x0b\x21\x96\x7b\x01\x62\x51\x14\x05\x89\x44\x82\x56\xab"
+    "\x85\x52\x0a\x21\x04\x5a\x6b\x94\x52\x44\x51\x44\xb7\xdb\xc5\xf3"
+    "\x3c\x8c\x31\x41\x4f\x80\x94\x72\xbf\x5e\xaf\x8f\xc5\xe3\x71\xba"
+    "\xdd\x2e\x42\x88\xb3\x25\x9d\x4e\x87\x5f\xef\xdc\xe1\xdc\xed\xdb"
+    "\x8c\xa7\x07\x63\xdf\x80\x01\xf8\x02\xae\xff\x09\x6b\x00\x72\x71"
+    "\x71\xf1\x15\x29\xe5\xc5\xfe\xfe\x7e\x19\x86\xe1\x59\x7b\xa7\xd3"
+    "\xe1\xd1\xad\x5b\xcc\x6f\x6c\xf0\xee\xe5\xcb\xbc\x7a\xe9\x12\x13"
+    "\x85\x82\x18\x0a\x02\x71\xf1\xf8\xf8\x3d\x9a\xcd\xc4\x0e\xfc\x2c"
+    "\x0b\x85\xc2\x56\xad\x56\xbb\x9e\x4a\xa5\xa4\xe7\x79\xb4\xdb\x6d"
+    "\xda\xed\x36\xf7\xd7\xd7\x99\xf9\xe9\x2e\x6f\x5f\xfb\x88\x84\xd6"
+    "\x98\x6a\x95\xe8\xe8\x08\x2f\x99\x64\x78\x7e\x9e\x64\x79\x77\x31"
+    "\x96\x1f\xcf\x49\xd7\x75\xe7\x80\x2b\x5a\xeb\x98\xd6\x1a\xcf\xf3"
+    "\xe8\xeb\xeb\x43\x7c\xf9\x35\x6f\xbe\xf3\x06\x9e\xd6\xe8\x27\x4f"
+    "\x30\x5a\x63\x95\x42\x3d\x7d\x8a\x35\x86\x17\x83\x80\x44\xa5\x3c"
+    "\x13\x73\x5d\xf7\xd3\x85\x85\x85\xc4\xec\xec\x2c\xe5\x72\x99\xbd"
+    "\xbd\x3d\x1a\x8d\x06\x17\x8e\x0f\x38\x17\x7c\x80\xfb\xc9\xc7\xb8"
+    "\xae\x8b\x10\x60\x2d\x80\x45\x08\x81\xf9\x7c\x15\xf7\xc7\x1f\x88"
+    "\x45\x51\xf4\xfa\xd0\xd0\x90\xa8\x56\xab\x0c\x0f\x0f\x33\x3d\x3d"
+    "\x8d\xef\xfb\x6c\xaf\xad\x61\x5d\x17\x84\x40\x08\x30\xc6\x60\x8c"
+    "\x79\x66\x9f\x10\xa8\x5a\xed\xd9\x17\xac\xb5\xbe\xe3\x38\xd4\xeb"
+    "\x75\x1a\x8d\x06\xc6\x18\x94\x52\xf4\xbd\x9c\xe2\xef\xed\x6d\x5e"
+    "\xb8\xfa\x21\xa7\x0f\x1e\x60\x94\xc2\x44\x11\xc6\x18\x62\x23\x23"
+    "\x84\xa9\x14\x7b\x5d\x75\xdf\x91\x52\xee\x1e\x1e\x1e\xe2\xfb\x3e"
+    "\xcd\x66\x93\x46\xa3\x41\xab\xd5\xe2\x97\xd7\x66\x78\xbc\xb5\x85"
+    "\x96\x12\x91\xc9\x10\x39\x0e\x91\x94\x38\xd9\x2c\xce\xd8\x18\x8f"
+    "\x77\x76\x4e\xbf\x85\x47\x32\x97\xcb\xfd\x56\xa9\x54\xae\xe4\xf3"
+    "\x79\x77\x64\x64\x84\x4c\x26\x43\x3a\x9d\x66\x7a\x6e\x8e\xdf\x4f"
+    "\x4e\x50\xf7\xee\xe1\x9f\x3f\x8f\x37\x31\x81\xcc\xe5\x08\x85\xe0"
+    "\x8f\x87\x0f\x4f\xd7\xc3\xf0\xab\x0d\xb8\x21\x00\x96\x96\x96\xae"
+    "\x3a\x8e\x73\x53\x6b\x3d\x0e\xc8\xff\x88\x66\xc2\xfd\xfd\xe3\x6b"
+    "\x91\x4e\xf3\x57\xd5\x02\x54\xa1\xfe\x1d\x7c\xf6\xaf\x48\xff\x00"
+    "\x4c\x71\x67\x27\xb5\xdd\x3f\xef\x00\x00\x00\x00\x49\x45\x4e\x44"
+    "\xae\x42\x60\x82";
diff --git a/otr-plugin.c b/otr-plugin.c
index 95e5106..4f7173c 100644
--- a/otr-plugin.c
+++ b/otr-plugin.c
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -365,12 +366,13 @@ void otrg_plugin_abort_smp(ConnContext *context)
 }
 
 /* Start the Socialist Millionaires' Protocol over the current connection,
- * using the given initial secret. */
-void otrg_plugin_start_smp(ConnContext *context,
+ * using the given initial secret, and optionally a question to pass to
+ * the buddy. */
+void otrg_plugin_start_smp(ConnContext *context, const char *question,
 	const unsigned char *secret, size_t secretlen)
 {
-    otrl_message_initiate_smp(otrg_plugin_userstate, &ui_ops, NULL,
-	    context, secret, secretlen);
+    otrl_message_initiate_smp_q(otrg_plugin_userstate, &ui_ops, NULL,
+	    context, question, secret, secretlen);
 }
 
 /* Continue the Socialist Millionaires' Protocol over the current connection,
@@ -467,50 +469,70 @@ static gboolean process_receiving_im(PurpleAccount *account, char **who,
     if (context) {
 	nextMsg = context->smstate->nextExpected;
 
-	tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1);
-	if (tlv) {
-	    if (nextMsg != OTRL_SMP_EXPECT1)
-		otrg_plugin_abort_smp(context);
-	    else {
-		otrg_dialog_socialist_millionaires(context);
+	if (context->smstate->sm_prog_state == OTRL_SMP_PROG_CHEATED) {
+	    otrg_plugin_abort_smp(context);
+	    otrg_dialog_update_smp(context, 0.0);
+	    context->smstate->nextExpected = OTRL_SMP_EXPECT1;
+	    context->smstate->sm_prog_state = OTRL_SMP_PROG_OK;
+	} else {
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1Q);
+	    if (tlv) {
+		if (nextMsg != OTRL_SMP_EXPECT1)
+		    otrg_plugin_abort_smp(context);
+		else {
+		    char *question = (char *)tlv->data;
+		    char *eoq = memchr(question, '\0', tlv->len);
+		    if (eoq) {
+			otrg_dialog_socialist_millionaires_q(context,
+				question);
+		    }
+		}
 	    }
-	}
-	tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP2);
-	if (tlv) {
-	    if (nextMsg != OTRL_SMP_EXPECT2)
-		otrg_plugin_abort_smp(context);
-	    else {
-		otrg_dialog_update_smp(context, 0.6);
-		context->smstate->nextExpected = OTRL_SMP_EXPECT4;
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP1);
+	    if (tlv) {
+		if (nextMsg != OTRL_SMP_EXPECT1)
+		    otrg_plugin_abort_smp(context);
+		else {
+		    otrg_dialog_socialist_millionaires(context);
+		}
 	    }
-	}
-	tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP3);
-	if (tlv) {
-	    if (nextMsg != OTRL_SMP_EXPECT3)
-		otrg_plugin_abort_smp(context);
-	    else {
-		otrg_dialog_update_smp(context, 1.0);
-		context->smstate->nextExpected = OTRL_SMP_EXPECT1;
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP2);
+	    if (tlv) {
+		if (nextMsg != OTRL_SMP_EXPECT2)
+		    otrg_plugin_abort_smp(context);
+		else {
+		    otrg_dialog_update_smp(context, 0.6);
+		    context->smstate->nextExpected = OTRL_SMP_EXPECT4;
+		}
 	    }
-	}
-	tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP4);
-	if (tlv) {
-	    if (nextMsg != OTRL_SMP_EXPECT4)
-		otrg_plugin_abort_smp(context);
-	    else {
-		otrg_dialog_update_smp(context, 1.0);
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP3);
+	    if (tlv) {
+		if (nextMsg != OTRL_SMP_EXPECT3)
+		    otrg_plugin_abort_smp(context);
+		else {
+		    otrg_dialog_update_smp(context, 1.0);
+		    context->smstate->nextExpected = OTRL_SMP_EXPECT1;
+		}
+	    }
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP4);
+	    if (tlv) {
+		if (nextMsg != OTRL_SMP_EXPECT4)
+		    otrg_plugin_abort_smp(context);
+		else {
+		    otrg_dialog_update_smp(context, 1.0);
+		    context->smstate->nextExpected = OTRL_SMP_EXPECT1;
+		}
+	    }
+	    tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP_ABORT);
+	    if (tlv) {
+		otrg_dialog_update_smp(context, 0.0);
 		context->smstate->nextExpected = OTRL_SMP_EXPECT1;
 	    }
 	}
-	tlv = otrl_tlv_find(tlvs, OTRL_TLV_SMP_ABORT);
-	if (tlv) {
-	    otrg_dialog_update_smp(context, 0.0);
-	    context->smstate->nextExpected = OTRL_SMP_EXPECT1;
-	}
-	
-	otrl_tlv_free(tlvs);
     }
 
+    otrl_tlv_free(tlvs);
+
     free(username);
 
     /* If we're supposed to ignore this incoming message (because it's a
@@ -926,7 +948,8 @@ static PurplePluginInfo info =
 	NULL,                                             /* summary        */
 	NULL,                                             /* description    */
 	                                                  /* author         */
-	"Ian Goldberg, Chris Alexander, Nikita Borisov\n"
+	"Ian Goldberg, Rob Smits,\n"
+	    "\t\t\tChris Alexander, Nikita Borisov\n"
 	    "\t\t\t<otr at cypherpunks.ca>",
 	"http://otr.cypherpunks.ca/",                     /* homepage       */
 
diff --git a/otr-plugin.h b/otr-plugin.h
index db10632..fbbd3f1 100644
--- a/otr-plugin.h
+++ b/otr-plugin.h
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -45,9 +46,10 @@ void otrg_plugin_inject_message(PurpleAccount *account, const char *recipient,
 void otrg_plugin_create_privkey(const char *accountname,
 	const char *protocol);
 
-/* Start or continue the Socialist Millionaires' Protocol over the current
- * connection, using the given initial secret. */
-void otrg_plugin_start_smp(ConnContext *context,
+/* Start the Socialist Millionaires' Protocol over the current connection,
+ * using the given initial secret, and optionally a question to pass to
+ * the buddy. */
+void otrg_plugin_start_smp(ConnContext *context, const char *question,
 	const unsigned char *secret, size_t secretlen);
 void otrg_plugin_continue_smp(ConnContext *context,
 	const unsigned char *secret, size_t secretlen);
diff --git a/po/ar.po b/po/ar.po
new file mode 100644
index 0000000..cb08e7d
--- /dev/null
+++ b/po/ar.po
@@ -0,0 +1,500 @@
+# translation of pidgin-otr.po to Arabic
+# Arabic translations for pidgin-otr package.
+# Copyright (C) 2007 THE pidgin-otr'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the pidgin-otr package.
+#
+# Automatically generated, 2007.
+# Khaled Hosny <khaledhosny at eglug.org>, 2007.
+# Ahmad Gharbeia <gharbeia at gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: pidgin-otr\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-11-18 16:56+0200\n"
+"PO-Revision-Date: 2008-02-13 18:14+0200\n"
+"Last-Translator: Ahmad Gharbeia أحمد غربية <gharbeia at gmail.com>\n"
+"Language-Team: Arabic <doc at arabeyes.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
+
+#: ../gtk-dialog.c:916
+#: ../gtk-dialog.c:2103
+msgid "_What's this?"
+msgstr "_ما هذا؟"
+
+#: ../gtk-dialog.c:927
+msgid "_More..."
+msgstr "_المزيد..."
+
+#. Create the Advanced... button, and left-justify it.  This
+#. * involves adding the button, and a blank label as a spacer, and
+#. * reordering them so that they're at the beginning.
+#: ../gtk-dialog.c:984
+msgid "Advanced..."
+msgstr "متقدم..."
+
+#: ../gtk-dialog.c:1029
+msgid "Enter secret here"
+msgstr "أدخل السر هنا"
+
+#: ../gtk-dialog.c:1034
+msgid "This buddy is already authenticated."
+msgstr "هذا الصديق مُستوثَق بالفعل."
+
+#: ../gtk-dialog.c:1053
+msgid "To authenticate, pick a secret known only to you and your buddy.  Enter this secret, then wait for your buddy to enter it too.  If the secrets don't match, then you may be talking to an imposter."
+msgstr "لأجل الاستيثاق اختر سرا لا يعرفه إلاك و صديقك. أدخل هذا السر ثم انتظر أن يُدخله الصديق كذلك. إذا لم يتطابق السران فلربما كنت تحادث مُنتحلا."
+
+#: ../gtk-dialog.c:1057
+msgid "If your buddy uses multiple IM accounts or multiple computers, you may have to authenticate multiple times.  However, as long as they use an account and computer that you've seen before, you don't need to authenticate each individual conversation."
+msgstr "إن كان صديقك يستخدم حسابات تراسل فوري متعددة أو حواسيب مختلفة فربما تحتاجان للاستيثاق أكثر من مرّة. لكن إن كان صديقك يستخدم حاسوبا و حسابا سبق تعرُّفهما فلن تحتاج لاستيثاق كل محادثة على حدة."
+
+#: ../gtk-dialog.c:1062
+#: ../gtk-dialog.c:1330
+#: ../gtk-dialog.c:1334
+#: ../gtk-dialog.c:1431
+#: ../gtk-dialog.c:1598
+#: ../gtk-dialog.c:1758
+#: ../gtk-dialog.c:1858
+#: ../gtk-dialog.c:1943
+msgid "?lang=en"
+msgstr "?lang=ar"
+
+#: ../gtk-dialog.c:1063
+msgid "Click here for more information about authentication in OTR."
+msgstr "انقر هنا لمزيد من المعلومات عن الاستيثاق في OTR."
+
+#: ../gtk-dialog.c:1067
+msgid "Authenticating a buddy helps ensure that the person you are talking to is who they claim to be."
+msgstr "الاستيثاق من الصديق يُساعد على التأكد من أن الشخص الذي تُحدثه هو من يزعم أن يكونه."
+
+#: ../gtk-dialog.c:1119
+msgid "Authenticating Buddy"
+msgstr "يجري الاستيثاق من الصديق"
+
+#: ../gtk-dialog.c:1146
+msgid "Authenticating"
+msgstr "يجري الاستيثاق"
+
+#: ../gtk-dialog.c:1209
+msgid "Generating private key"
+msgstr "يجري توليد المفتاح السري"
+
+#: ../gtk-dialog.c:1210
+msgid "Please wait"
+msgstr "من فضلك انتظر"
+
+#: ../gtk-dialog.c:1218
+#: ../gtk-dialog.c:1635
+#: ../gtk-dialog.c:1672
+#: ../gtk-ui.c:175
+#: ../otr-plugin.c:115
+#: ../otr-plugin.c:212
+#: ../ui.c:110
+msgid "Unknown"
+msgstr "مجهول"
+
+#. Create the Please Wait... dialog
+#: ../gtk-dialog.c:1221
+#, c-format
+msgid "Generating private key for %s (%s)..."
+msgstr "يجري توليد مفتاح سري لأجل %s (%s)..."
+
+#: ../gtk-dialog.c:1266
+#, c-format
+msgid "%s Done."
+msgstr "%s تم."
+
+#: ../gtk-dialog.c:1328
+#, c-format
+msgid "%s is contacting you from an unrecognized computer.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "يتصل بك %s من حاسوب لم يُتعرّف عليه. ينبغي لك <a href=\"%s%s\">الاستيثاق</a> من هذا الصديق."
+
+#: ../gtk-dialog.c:1332
+#, c-format
+msgid "%s has not been authenticated yet.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "لم يُستوثق من %s بعد. يجب عليك <a href=\"%s%s\">الاستيثاق</a> من هذا الصديق."
+
+#: ../gtk-dialog.c:1373
+#: ../gtk-ui.c:76
+msgid "Finished"
+msgstr "تم"
+
+#: ../gtk-dialog.c:1374
+#: ../gtk-ui.c:75
+msgid "Private"
+msgstr "خاصة"
+
+#: ../gtk-dialog.c:1375
+#: ../gtk-ui.c:74
+msgid "Unverified"
+msgstr "غير محقّق"
+
+#: ../gtk-dialog.c:1376
+#: ../gtk-ui.c:73
+msgid "Not private"
+msgstr "ليست خاصة"
+
+#: ../gtk-dialog.c:1378
+msgid "Start a private conversation"
+msgstr "ابدأ محادثة خاصة"
+
+#: ../gtk-dialog.c:1379
+msgid "Refresh the private conversation"
+msgstr "أنعش المحادثة الخاصة"
+
+#: ../gtk-dialog.c:1383
+msgid "Start _private conversation"
+msgstr "ابدأ محادثة _خاصة"
+
+#: ../gtk-dialog.c:1384
+msgid "Refresh _private conversation"
+msgstr "أنعش المحادثة ال_خاصة"
+
+#: ../gtk-dialog.c:1563
+msgid "I have not"
+msgstr "لم أتحقق"
+
+#: ../gtk-dialog.c:1564
+msgid "I have"
+msgstr "تحققتُ"
+
+#: ../gtk-dialog.c:1566
+msgid " verified that this is in fact the correct"
+msgstr "من أن هذا صحيح حقا"
+
+#: ../gtk-dialog.c:1575
+#, c-format
+msgid "fingerprint for %s."
+msgstr "بصمة %s."
+
+#: ../gtk-dialog.c:1587
+msgid "To verify the fingerprint, contact your buddy via some <i>other</i> authenticated channel, such as the telephone or GPG-signed email.  Each of you should tell your fingerprint to the other."
+msgstr "لتتحقق من البصمة اتصل بصديقك عبر قناة <i>أخرى</i> مستوثقة، كالهاتف أو بريد موقع رقميا، بحيث يُخبر كل منكما الآخر ببصمته."
+
+#: ../gtk-dialog.c:1591
+msgid "If everything matches up, you should indicate in the above dialog that you <b>have</b> verified the fingerprint."
+msgstr "إذا تطابق كل شيء عليك أن توضح في الحوار السابق أنك <b>تحققت</b> من البصمة."
+
+#: ../gtk-dialog.c:1593
+msgid "If your buddy has more than one IM account, or uses more than one computer, he may have multiple fingerprints."
+msgstr "إن كان لصديقك أكثر من حساب تراسل فوري أو يستخدم أكثر من حاسوب فقد تكون له أكثر من بصمة."
+
+#: ../gtk-dialog.c:1595
+msgid "However, the only way an imposter could duplicate one of your buddy's fingerprints is by stealing information from her/his computer."
+msgstr "مع هذا فالطريقة الوحيدة التي يمكن بها لمنتحل تزييف بصمة أحد أصدقائك هي السطو على معلومات معينة من حاسوبه."
+
+#: ../gtk-dialog.c:1599
+msgid "Click here for more information about fingerprints."
+msgstr "انقر هنا لمزيد من المعلومات عن البصمات."
+
+#: ../gtk-dialog.c:1602
+msgid "A <b>fingerprint</b> is a unique identifier that you should use to authenticate your buddy."
+msgstr "<b>البصمة</b> هي مُعرف فريد يتعين عليك استخدامه للاستيثاق من أصدقائك."
+
+#: ../gtk-dialog.c:1624
+#, c-format
+msgid "Verify fingerprint for %s"
+msgstr "تحقق من بصمة %s"
+
+#: ../gtk-dialog.c:1628
+msgid "[none]"
+msgstr "[لاشيء]"
+
+#: ../gtk-dialog.c:1636
+#, c-format
+msgid ""
+"Fingerprint for you, %s (%s):\n"
+"%s\n"
+"\n"
+"Purported fingerprint for %s:\n"
+"%s\n"
+msgstr ""
+"بصمتك، %s (%s):\n"
+"%s\n"
+"\n"
+"بصمة %s المزعومة:\n"
+"%s\n"
+
+#: ../gtk-dialog.c:1641
+#: ../gtk-ui.c:681
+msgid "Verify fingerprint"
+msgstr "تحقق من البصمة"
+
+#: ../gtk-dialog.c:1668
+#, c-format
+msgid "Authenticate %s"
+msgstr "استوثق من %s"
+
+#: ../gtk-dialog.c:1673
+#, c-format
+msgid "Enter a secret known only to %s and yourself.\n"
+msgstr "أدخل سرا لا يعرفه سواك و %s.\n"
+
+#: ../gtk-dialog.c:1676
+msgid "Authenticate buddy"
+msgstr "استوثق من الصديق"
+
+#: ../gtk-dialog.c:1708
+msgid "An error occurred during authentication."
+msgstr "حدث عطل أثناء الاستيثاق."
+
+#: ../gtk-dialog.c:1724
+msgid "Authentication successful."
+msgstr "نجح الاستيثاق."
+
+#: ../gtk-dialog.c:1727
+msgid "Authentication failed."
+msgstr "فشل الاستيثاق."
+
+#: ../gtk-dialog.c:1752
+#, c-format
+msgid "Private conversation with %s started.%s"
+msgstr "بدأت محادثة خاصة مع %s. %s "
+
+#: ../gtk-dialog.c:1756
+#, c-format
+msgid "<a href=\"%s%s\">Unverified</a> conversation with %%s started.%%s"
+msgstr "بدأت محادثة <a href=\"%s%s\">غير مستوثقة</a> مع %%s .%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1764
+#, c-format
+msgid "Not private conversation with %s started.%s"
+msgstr "بدأت محادثة غير خاصة مع %s. %s "
+
+#: ../gtk-dialog.c:1770
+#: ../gtk-dialog.c:1871
+msgid "  Warning: using old protocol version 1."
+msgstr "  تحذير: تستخدم بروتوكولا قديما من الإصدارة 1."
+
+#: ../gtk-dialog.c:1790
+#, c-format
+msgid "Private conversation with %s lost."
+msgstr "انقطعت المحادثة الخاصة مع %s."
+
+#: ../gtk-dialog.c:1825
+#, c-format
+msgid "%s has ended his/her private conversation with you; you should do the same."
+msgstr "أنهى %s من طرفه المحادثة الخاصة معك. عليك فعل الشيء ذاته."
+
+#: ../gtk-dialog.c:1850
+#, c-format
+msgid "Successfully refreshed the private conversation with %s.%s"
+msgstr "تم إنعاش المحادثة الخاصة مع %s بنجاح.%s"
+
+#: ../gtk-dialog.c:1855
+#, c-format
+msgid "Successfully refreshed the <a href=\"%s%s\">unverified</a> conversation with %%s.%%s"
+msgstr "تم إنعاش المحادثة <a href=\"%s%s\">غير المستوثقة</a> مع %%s بنجاح.%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1864
+#, c-format
+msgid "Successfully refreshed the not private conversation with %s.%s"
+msgstr "تم إنعاش المحادثة غير الخاصة مع %s بنجاح.%s"
+
+#: ../gtk-dialog.c:1891
+#, c-format
+msgid "Attempting to refresh the private conversation with %s..."
+msgstr "تجري محاولة تنشيط المحادثة الخاصة مع %s..."
+
+#: ../gtk-dialog.c:1893
+#, c-format
+msgid "Attempting to start a private conversation with %s..."
+msgstr "تجري محاولة بدء محادثة خاصة مع %s..."
+
+#: ../gtk-dialog.c:2053
+msgid "OTR:"
+msgstr "OTR:"
+
+#: ../gtk-dialog.c:2062
+msgid "OTR Messaging"
+msgstr "تراسل OTR"
+
+#: ../gtk-dialog.c:2068
+msgid "_End private conversation"
+msgstr "ا_نهِ المحادثة الخاصة"
+
+#.
+#. * Don't show the Verify fingerprint menu option any more.  You can
+#. * still get to the dialog through Authenticate connection ->
+#. * Advanced...
+#. *
+#. menuverf = gtk_menu_item_new_with_mnemonic(_("_Verify fingerprint"));
+#. gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuverf);
+#. gtk_widget_show(menuverf);
+#.
+#: ../gtk-dialog.c:2086
+msgid "_Authenticate buddy"
+msgstr "ا_ستوثق من الصديق"
+
+#: ../gtk-ui.c:96
+#, c-format
+msgid "Fingerprint: %.80s"
+msgstr "البصمة: %.80s "
+
+#: ../gtk-ui.c:100
+#, c-format
+msgid "No key present"
+msgstr "لا توجد مفاتيح"
+
+#: ../gtk-ui.c:105
+#, c-format
+msgid "No account available"
+msgstr "لا توجد حسابات"
+
+#: ../gtk-ui.c:165
+msgid "Unused"
+msgstr "غير مستخدم"
+
+#: ../gtk-ui.c:171
+msgid "Yes"
+msgstr "نعم"
+
+#: ../gtk-ui.c:171
+msgid "No"
+msgstr "لا"
+
+#: ../gtk-ui.c:396
+msgid "Enable private messaging"
+msgstr "فعِّل التراسل الخاص"
+
+#: ../gtk-ui.c:398
+msgid "Automatically initiate private messaging"
+msgstr "ابدأ التراسل الخاص تلقائيا"
+
+#: ../gtk-ui.c:400
+msgid "Require private messaging"
+msgstr "اشترط التراسل الخاص"
+
+#: ../gtk-ui.c:403
+msgid "Don't log OTR conversations"
+msgstr "لا تُسجِّل محادثات OTR"
+
+#: ../gtk-ui.c:531
+msgid "My private keys"
+msgstr "مفاتيحي السريّة"
+
+#: ../gtk-ui.c:540
+msgid "Key for account:"
+msgstr "مفتاح الحساب:"
+
+#: ../gtk-ui.c:565
+msgid "Generate"
+msgstr "ولِّد"
+
+#: ../gtk-ui.c:596
+msgid "Default OTR Settings"
+msgstr "اعدادات OTR المبدئية"
+
+#: ../gtk-ui.c:625
+msgid "Screenname"
+msgstr "اسم الشاشة"
+
+#: ../gtk-ui.c:626
+msgid "Status"
+msgstr "الحالة"
+
+#: ../gtk-ui.c:627
+msgid "Verified"
+msgstr "محققة"
+
+#: ../gtk-ui.c:628
+msgid "Fingerprint"
+msgstr "البصمة"
+
+#: ../gtk-ui.c:629
+msgid "Account"
+msgstr "الحساب"
+
+#: ../gtk-ui.c:665
+msgid "Start private connection"
+msgstr "ابدأ محادثة خاصة"
+
+#: ../gtk-ui.c:673
+msgid "End private connection"
+msgstr "انهِ المحادثة الخاصة"
+
+#: ../gtk-ui.c:689
+msgid "Forget fingerprint"
+msgstr "انس البصمة"
+
+#: ../gtk-ui.c:738
+msgid "Config"
+msgstr "اضبط"
+
+#: ../gtk-ui.c:740
+msgid "Known fingerprints"
+msgstr "البصمات المعروفة"
+
+#: ../gtk-ui.c:838
+#: ../otr-plugin.c:584
+msgid "OTR Settings"
+msgstr "تضبيطات OTR"
+
+#. Set the title
+#: ../gtk-ui.c:856
+#, c-format
+msgid "OTR Settings for %s"
+msgstr "تضبيطات OTR لأجل %s"
+
+#. Make the cascaded checkboxes
+#: ../gtk-ui.c:873
+msgid "Use default OTR settings for this buddy"
+msgstr "استخدم تضبيطات OTR المبدئية لهذا الصديق"
+
+#: ../otr-plugin.c:113
+#, c-format
+msgid "You are not currently connected to account %s (%s)."
+msgstr "لست حاليا متصلا بالحساب %s (%s)."
+
+#: ../otr-plugin.c:117
+msgid "Not connected"
+msgstr "غير متّصل"
+
+#: ../otr-plugin.c:161
+#, c-format
+msgid "Out of memory building filenames!\n"
+msgstr "نفدت الذاكرة أثناء بناء أسماء الملفات!\n"
+
+#: ../otr-plugin.c:167
+#, c-format
+msgid "Could not write private key file\n"
+msgstr "تعذّرت كتابة ملف المفتاح السري\n"
+
+#: ../otr-plugin.c:210
+#, c-format
+msgid "Unknown account %s (%s)."
+msgstr "حساب مجهول %s (%s)."
+
+#: ../otr-plugin.c:214
+msgid "Unknown account"
+msgstr "حساب مجهول"
+
+#: ../otr-plugin.c:960
+msgid "Off-the-Record Messaging"
+msgstr "التراسل الخاص Off-the-record Messaging"
+
+#: ../otr-plugin.c:961
+msgid "Provides private and secure conversations"
+msgstr "يتيح إقامة محادثات خاصة و مؤمَّنة"
+
+#: ../otr-plugin.c:962
+msgid "Preserves the privacy of IM communications by providing encryption, authentication, deniability, and perfect forward secrecy."
+msgstr "يحفظ خصوصية اتصالات التراسل الفوري باستخدام التعمية و الاستيثاق و الإنكار و الأمن اللاحق."
+
+#: ../ui.c:108
+#, c-format
+msgid "Account %s (%s) could not be found"
+msgstr "لم يُعثر على الحساب %s (%s)"
+
+#: ../ui.c:112
+msgid "Account not found"
+msgstr "لم يُعثر على الحساب"
+
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..798231a
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,495 @@
+# Off-the-Record Messaging plugin for pidgin.
+# Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+# This file is distributed under the same license as the pidgin-otr package.
+# Ian Goldberg <otr at cypherpunks.ca>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: pidgin-otr 3.1.0.de\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-03-20 01:43+0100\n"
+"PO-Revision-Date: 2008-03-20 13:20+0100\n"
+"Last-Translator: Thorsten Mühlfelder <thenktor at gmx.de>\n"
+"Language-Team: Joel Reardon <jreardon at cs.uwaterloo.ca>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../gtk-dialog.c:913
+#: ../gtk-dialog.c:2095
+msgid "_What's this?"
+msgstr "_Was ist das?"
+
+#: ../gtk-dialog.c:924
+msgid "_More..."
+msgstr "_Mehr..."
+
+#. Create the Advanced... button, and left-justify it.  This
+#. * involves adding the button, and a blank label as a spacer, and
+#. * reordering them so that they're at the beginning.
+#: ../gtk-dialog.c:980
+msgid "Advanced..."
+msgstr "Fortgeschritten..."
+
+#: ../gtk-dialog.c:1025
+msgid "Enter secret here"
+msgstr "Gib das Geheimwort hier ein"
+
+#: ../gtk-dialog.c:1030
+msgid "This buddy is already authenticated."
+msgstr "Dieser Kontakt ist bereits authentifiziert."
+
+#: ../gtk-dialog.c:1049
+msgid "To authenticate, pick a secret known only to you and your buddy.  Enter this secret, then wait for your buddy to enter it too.  If the secrets don't match, then you may be talking to an imposter."
+msgstr "Benutze zur Authentifizierung ein Gehimwort, das nur du und dein Kontakt kennt. Gib dieses Geheimwort ein und warte dann, bis dein Kontakt es auch eingegeben hat. Falls die Geheimworte nicht übereinstimmen, könnte es sein, dass du mit einem Hochstapler redest."
+
+#: ../gtk-dialog.c:1053
+msgid "If your buddy uses multiple IM accounts or multiple computers, you may have to authenticate multiple times.  However, as long as they use an account and computer that you've seen before, you don't need to authenticate each individual conversation."
+msgstr "Falls dein Kontakt mehrere IM Accounts oder mehrere Computer benutzt, könnte es nötig sein, dass du dich öfter authentifizieren musst. Falls er jedoch einen Account oder Computer nutzt, den du bereits kontaktiert hast, ist es nicht nötig, jede einzelne Konversation zu authentifizieren."
+
+#: ../gtk-dialog.c:1058
+#: ../gtk-dialog.c:1322
+#: ../gtk-dialog.c:1326
+#: ../gtk-dialog.c:1423
+#: ../gtk-dialog.c:1590
+#: ../gtk-dialog.c:1750
+#: ../gtk-dialog.c:1850
+#: ../gtk-dialog.c:1935
+msgid "?lang=en"
+msgstr "?lang=de"
+
+#: ../gtk-dialog.c:1059
+msgid "Click here for more information about authentication in OTR."
+msgstr "Klicke hier für weitere Informationen über die Authentifizierung bei OTR."
+
+#: ../gtk-dialog.c:1063
+msgid "Authenticating a buddy helps ensure that the person you are talking to is who they claim to be."
+msgstr "Einen Kontakt zu authentifizieren, hilft dabei sicher zu gehen, dass die Person mit der du redest auch die ist, die sie vorgibt."
+
+#: ../gtk-dialog.c:1113
+msgid "Authenticating Buddy"
+msgstr "Authentifiziere Konakt"
+
+#: ../gtk-dialog.c:1140
+msgid "Authenticating"
+msgstr "Authentifiziere"
+
+#: ../gtk-dialog.c:1201
+msgid "Generating private key"
+msgstr "Erzeuge privaten Schlüssel"
+
+#: ../gtk-dialog.c:1202
+msgid "Please wait"
+msgstr "Bitte warten"
+
+#: ../gtk-dialog.c:1210
+#: ../gtk-dialog.c:1627
+#: ../gtk-dialog.c:1664
+#: ../gtk-ui.c:175
+#: ../otr-plugin.c:115
+#: ../otr-plugin.c:212
+#: ../ui.c:110
+msgid "Unknown"
+msgstr "Unbekannt"
+
+#. Create the Please Wait... dialog
+#: ../gtk-dialog.c:1213
+#, c-format
+msgid "Generating private key for %s (%s)..."
+msgstr "Erzeuge privaten Schlüssel für %s (%s)..."
+
+#: ../gtk-dialog.c:1258
+#, c-format
+msgid "%s Done."
+msgstr "%s Erledigt."
+
+#: ../gtk-dialog.c:1320
+#, c-format
+msgid "%s is contacting you from an unrecognized computer.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "%s kontaktiert dich von einem unbekannten Computer. Du solltest diesen Kontakt <a href=\"%s%s\">authentifizieren</a>."
+
+#: ../gtk-dialog.c:1324
+#, c-format
+msgid "%s has not been authenticated yet.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "%s ist noch nicht authentifiziert. Du solltest diesen Kontakt <a href=\"%s%s\">authentifizieren</a>."
+
+#: ../gtk-dialog.c:1365
+#: ../gtk-ui.c:76
+msgid "Finished"
+msgstr "Fertig"
+
+#: ../gtk-dialog.c:1366
+#: ../gtk-ui.c:75
+msgid "Private"
+msgstr "Privat"
+
+#: ../gtk-dialog.c:1367
+#: ../gtk-ui.c:74
+msgid "Unverified"
+msgstr "Nicht verifiziert"
+
+#: ../gtk-dialog.c:1368
+#: ../gtk-ui.c:73
+msgid "Not private"
+msgstr "Nicht privat"
+
+#: ../gtk-dialog.c:1370
+msgid "Start a private conversation"
+msgstr "Starte eine private Konversation"
+
+#: ../gtk-dialog.c:1371
+msgid "Refresh the private conversation"
+msgstr "Erneuere die Private Konversation"
+
+#: ../gtk-dialog.c:1375
+msgid "Start _private conversation"
+msgstr "Starte _private Konversation"
+
+#: ../gtk-dialog.c:1376
+msgid "Refresh _private conversation"
+msgstr "Erneuere _private Konversation"
+
+#: ../gtk-dialog.c:1555
+msgid "I have not"
+msgstr "Ich habe nicht"
+
+#: ../gtk-dialog.c:1556
+msgid "I have"
+msgstr "Ich habe"
+
+#: ../gtk-dialog.c:1558
+msgid " verified that this is in fact the correct"
+msgstr " verifiziert, dass dies wirklich der richtige"
+
+#: ../gtk-dialog.c:1567
+#, c-format
+msgid "fingerprint for %s."
+msgstr "Fingerabdruck für %s ist."
+
+#: ../gtk-dialog.c:1579
+msgid "To verify the fingerprint, contact your buddy via some <i>other</i> authenticated channel, such as the telephone or GPG-signed email.  Each of you should tell your fingerprint to the other."
+msgstr "Um den Fingerabdruck zu verifizieren, kontaktiere deinen Kontakt über einen <i>anderen</i> sicheren Kanal, wie z.B. Telefon oder GPG-signierte E-Mail. Jeder von euch sollte seinen Fingerabdruck dem anderen mitteilen."
+
+#: ../gtk-dialog.c:1583
+msgid "If everything matches up, you should indicate in the above dialog that you <b>have</b> verified the fingerprint."
+msgstr "Falls alles übereinstimmt, solltest du oben im Dialog bestätigen, dass due den Fingerabdruckt verifiziert <b>hast</b>."
+
+#: ../gtk-dialog.c:1585
+msgid "If your buddy has more than one IM account, or uses more than one computer, he may have multiple fingerprints."
+msgstr "Falls dein Kontakt mehr als einen IM Account oder mehr als einen Computer hat, könnte er mehrere Fingerabdrücke haben."
+
+#: ../gtk-dialog.c:1587
+msgid "However, the only way an imposter could duplicate one of your buddy's fingerprints is by stealing information from her/his computer."
+msgstr "Die einzige Möglichkeit für einen Hochstapler, einen Fingerabdruck deines Kontaktes zu kopieren, ist den Fingerabdruck von seinem/ihren Computer zu stehlen."
+
+#: ../gtk-dialog.c:1591
+msgid "Click here for more information about fingerprints."
+msgstr "Klicke hier für weitere Informationen über Fingerabdrücke."
+
+#: ../gtk-dialog.c:1594
+msgid "A <b>fingerprint</b> is a unique identifier that you should use to authenticate your buddy."
+msgstr "Ein <b>Fingerabdruck</b> ist eine eindeutige Identifikation, die du nutzen solltest, um deinen Kontakt zu authentifizieren."
+
+#: ../gtk-dialog.c:1616
+#, c-format
+msgid "Verify fingerprint for %s"
+msgstr "Verifiziere Fingerabdruck für %s"
+
+#: ../gtk-dialog.c:1620
+msgid "[none]"
+msgstr "[kein]"
+
+#: ../gtk-dialog.c:1628
+#, c-format
+msgid ""
+"Fingerprint for you, %s (%s):\n"
+"%s\n"
+"\n"
+"Purported fingerprint for %s:\n"
+"%s\n"
+msgstr ""
+"Fingerabdruck für dich, %s (%s):\n"
+"%s\n"
+"\n"
+"Behaupteter Fingerabdruck für %s:\n"
+"%s\n"
+
+#: ../gtk-dialog.c:1633
+#: ../gtk-ui.c:681
+msgid "Verify fingerprint"
+msgstr "Verifiziere Fingerabdruck"
+
+#: ../gtk-dialog.c:1660
+#, c-format
+msgid "Authenticate %s"
+msgstr "Authentifiziere %s"
+
+#: ../gtk-dialog.c:1665
+#, c-format
+msgid "Enter a secret known only to %s and yourself.\n"
+msgstr "Gib ein Geheimwort ein, das nur %s und dir selbst bekannt ist.\n"
+
+#: ../gtk-dialog.c:1668
+msgid "Authenticate buddy"
+msgstr "Authentifiziere Kontakt"
+
+#: ../gtk-dialog.c:1700
+msgid "An error occurred during authentication."
+msgstr "Während der Authentifizierung trat ein Fehler auf."
+
+#: ../gtk-dialog.c:1716
+msgid "Authentication successful."
+msgstr "Authentifizierung erfolgreich."
+
+#: ../gtk-dialog.c:1719
+msgid "Authentication failed."
+msgstr "Authentifizierung fehlgeschlagen."
+
+#: ../gtk-dialog.c:1744
+#, c-format
+msgid "Private conversation with %s started.%s"
+msgstr "Private Konversation mit %s gestartet.%s"
+
+#: ../gtk-dialog.c:1748
+#, c-format
+msgid "<a href=\"%s%s\">Unverified</a> conversation with %%s started.%%s"
+msgstr "<a href=\"%s%s\">Nicht verifizierte</a> Konversation mit %%s gestartet.%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1756
+#, c-format
+msgid "Not private conversation with %s started.%s"
+msgstr "Nicht private Konversation mit %s gestartet.%s"
+
+#: ../gtk-dialog.c:1762
+#: ../gtk-dialog.c:1863
+msgid "  Warning: using old protocol version 1."
+msgstr "  Warnung: Nutze alte Protokollversion 1."
+
+#: ../gtk-dialog.c:1782
+#, c-format
+msgid "Private conversation with %s lost."
+msgstr "Private Konversation mit %s ging verloren."
+
+#: ../gtk-dialog.c:1817
+#, c-format
+msgid "%s has ended his/her private conversation with you; you should do the same."
+msgstr "%s hat die private Konversation mit dir beendet; du solltest das Gleiche tun."
+
+#: ../gtk-dialog.c:1842
+#, c-format
+msgid "Successfully refreshed the private conversation with %s.%s"
+msgstr "Die private Konversation mit %s wurde erfolgreich erneuert.%s"
+
+#: ../gtk-dialog.c:1847
+#, c-format
+msgid "Successfully refreshed the <a href=\"%s%s\">unverified</a> conversation with %%s.%%s"
+msgstr "Die <a href=\"%s%s\">nicht verifizierte</a> Konversation mit %%s wurde erfolgreich erneuert.%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1856
+#, c-format
+msgid "Successfully refreshed the not private conversation with %s.%s"
+msgstr "Die nicht private Konversation mit %s wurde erfolgreich erneuert.%s"
+
+#: ../gtk-dialog.c:1883
+#, c-format
+msgid "Attempting to refresh the private conversation with %s..."
+msgstr "Versuche die private Konversation mit %s zu erneuern..."
+
+#: ../gtk-dialog.c:1885
+#, c-format
+msgid "Attempting to start a private conversation with %s..."
+msgstr "Versuche eine private Konversation mit %s zu starten..."
+
+#: ../gtk-dialog.c:2045
+msgid "OTR:"
+msgstr "OTR:"
+
+#: ../gtk-dialog.c:2054
+msgid "OTR Messaging"
+msgstr "OTR Nachrichtenübertragung"
+
+#: ../gtk-dialog.c:2060
+msgid "_End private conversation"
+msgstr "_Beende private Konversation"
+
+#.
+#. * Don't show the Verify fingerprint menu option any more.  You can
+#. * still get to the dialog through Authenticate connection ->
+#. * Advanced...
+#. *
+#. menuverf = gtk_menu_item_new_with_mnemonic(_("_Verify fingerprint"));
+#. gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuverf);
+#. gtk_widget_show(menuverf);
+#.
+#: ../gtk-dialog.c:2078
+msgid "_Authenticate buddy"
+msgstr "_Authentifiziere Kontakt"
+
+#: ../gtk-ui.c:96
+#, c-format
+msgid "Fingerprint: %.80s"
+msgstr "Fingerabdruck: %.80s"
+
+#: ../gtk-ui.c:100
+#, c-format
+msgid "No key present"
+msgstr "Kein Schlüssel vorhanden"
+
+#: ../gtk-ui.c:105
+#, c-format
+msgid "No account available"
+msgstr "Kein Account verfügbar"
+
+#: ../gtk-ui.c:165
+msgid "Unused"
+msgstr "Unbenutzt"
+
+#: ../gtk-ui.c:171
+msgid "Yes"
+msgstr "Ja"
+
+#: ../gtk-ui.c:171
+msgid "No"
+msgstr "Nein"
+
+#: ../gtk-ui.c:396
+msgid "Enable private messaging"
+msgstr "Schalte private Nachrichtenübertragung ein"
+
+#: ../gtk-ui.c:398
+msgid "Automatically initiate private messaging"
+msgstr "Private Nachrichtenübertragung automatisch starten"
+
+#: ../gtk-ui.c:400
+msgid "Require private messaging"
+msgstr "Nur private Nachrichtenübertragung erlauben"
+
+#: ../gtk-ui.c:403
+msgid "Don't log OTR conversations"
+msgstr "OTR Konversationen nicht mitloggen"
+
+#: ../gtk-ui.c:531
+msgid "My private keys"
+msgstr "Meine privaten Schlüssel"
+
+#: ../gtk-ui.c:540
+msgid "Key for account:"
+msgstr "Schlüssel für Account:"
+
+#: ../gtk-ui.c:565
+msgid "Generate"
+msgstr "Erzeugen"
+
+#: ../gtk-ui.c:596
+msgid "Default OTR Settings"
+msgstr "Standard OTR Einstellungen"
+
+#: ../gtk-ui.c:625
+msgid "Screenname"
+msgstr "Nutzername"
+
+#: ../gtk-ui.c:626
+msgid "Status"
+msgstr "Status"
+
+#: ../gtk-ui.c:627
+msgid "Verified"
+msgstr "Verifiziert"
+
+#: ../gtk-ui.c:628
+msgid "Fingerprint"
+msgstr "Fingerabdruck"
+
+#: ../gtk-ui.c:629
+msgid "Account"
+msgstr "Account"
+
+#: ../gtk-ui.c:665
+msgid "Start private connection"
+msgstr "Starte private Verbindung"
+
+#: ../gtk-ui.c:673
+msgid "End private connection"
+msgstr "Beende private Verbindung"
+
+#: ../gtk-ui.c:689
+msgid "Forget fingerprint"
+msgstr "Verwerfe Fingerabdruck"
+
+#: ../gtk-ui.c:738
+msgid "Config"
+msgstr "Konfiguration"
+
+#: ../gtk-ui.c:740
+msgid "Known fingerprints"
+msgstr "Bekannte Fingerabdrücke"
+
+#: ../gtk-ui.c:838
+#: ../otr-plugin.c:577
+msgid "OTR Settings"
+msgstr "OTR Einstellungen"
+
+#. Set the title
+#: ../gtk-ui.c:856
+#, c-format
+msgid "OTR Settings for %s"
+msgstr "OTR Einstellungen für %s"
+
+#. Make the cascaded checkboxes
+#: ../gtk-ui.c:873
+msgid "Use default OTR settings for this buddy"
+msgstr "Benutze Standard OTR Einstellungen für diesen Kontakt"
+
+#: ../otr-plugin.c:113
+#, c-format
+msgid "You are not currently connected to account %s (%s)."
+msgstr "Du bist momentan nicht mit Account %s verbunden (%s)."
+
+#: ../otr-plugin.c:117
+msgid "Not connected"
+msgstr "Nicht verbunden"
+
+#: ../otr-plugin.c:161
+#, c-format
+msgid "Out of memory building filenames!\n"
+msgstr "Kein Speicher mehr verfügbar beim Dateinamen erzeugen!\n"
+
+#: ../otr-plugin.c:167
+#, c-format
+msgid "Could not write private key file\n"
+msgstr "Konnte private Schlüsseldatei nicht schreiben\n"
+
+#: ../otr-plugin.c:210
+#, c-format
+msgid "Unknown account %s (%s)."
+msgstr "Unbekannter Account %s (%s)."
+
+#: ../otr-plugin.c:214
+msgid "Unknown account"
+msgstr "Unbekannter Account"
+
+#: ../otr-plugin.c:953
+msgid "Off-the-Record Messaging"
+msgstr "Off-the-Record (Sichere Nachrichtenübertragung)"
+
+#: ../otr-plugin.c:954
+msgid "Provides private and secure conversations"
+msgstr "Stellt private und sichere Konversationen zur Verfügung"
+
+#: ../otr-plugin.c:955
+msgid "Preserves the privacy of IM communications by providing encryption, authentication, deniability, and perfect forward secrecy."
+msgstr "Sichert die Intimsphäre bei IM Konversationen, indem es Verschlüsselung, Authentifizierung, Abstreitbarkeit (Deniability) und Folgenlosigkeit (Perfect Forward Secrecy) nutzt."
+
+#: ../ui.c:108
+#, c-format
+msgid "Account %s (%s) could not be found"
+msgstr "Account %s (%s) konnte nicht gefunden werden"
+
+#: ../ui.c:112
+msgid "Account not found"
+msgstr "Account nicht gefunden"
+
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..e6edbe0
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,495 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: OTR for Pidgin\n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: 2008-04-11 20:07+0300\n"
+"Last-Translator: Sergei Smirnov <moscow at hro.org>\n"
+"Language-Team: Human Rights Network <moscow at hro.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Russian\n"
+"X-Poedit-Country: RUSSIAN FEDERATION\n"
+
+#: ../gtk-dialog.c:913
+#: ../gtk-dialog.c:2095
+msgid "_What's this?"
+msgstr "_Что это?"
+
+#: ../gtk-dialog.c:924
+msgid "_More..."
+msgstr "_Больше..."
+
+#. Create the Advanced... button, and left-justify it.  This
+#. * involves adding the button, and a blank label as a spacer, and
+#. * reordering them so that they're at the beginning.
+#: ../gtk-dialog.c:980
+msgid "Advanced..."
+msgstr "Дополнительно..."
+
+#: ../gtk-dialog.c:1025
+msgid "Enter secret here"
+msgstr "Введите секретное слово (код)"
+
+#: ../gtk-dialog.c:1030
+msgid "This buddy is already authenticated."
+msgstr "Этот контакт уже идентифицирован."
+
+#: ../gtk-dialog.c:1049
+msgid "To authenticate, pick a secret known only to you and your buddy.  Enter this secret, then wait for your buddy to enter it too.  If the secrets don't match, then you may be talking to an imposter."
+msgstr "Чтобы идентифицировать собеседника, используйте секретный ключ, известный только вам и вашему собеседнику. Введите ключ и дождитесь, когда его введет собеседник. Если ключи не совпадают, возможно, на линии обманщик."
+
+#: ../gtk-dialog.c:1053
+msgid "If your buddy uses multiple IM accounts or multiple computers, you may have to authenticate multiple times.  However, as long as they use an account and computer that you've seen before, you don't need to authenticate each individual conversation."
+msgstr "Если ваш собеседник использует несколько аккаунтов или один аккаунт на нескольких компьютерах, следует идентифицировать его несколько раз. Если он использует один аккаунт на одном компьютере, вам не нужно идентифицировать его для каждого разговора."
+
+#: ../gtk-dialog.c:1058
+#: ../gtk-dialog.c:1322
+#: ../gtk-dialog.c:1326
+#: ../gtk-dialog.c:1423
+#: ../gtk-dialog.c:1590
+#: ../gtk-dialog.c:1750
+#: ../gtk-dialog.c:1850
+#: ../gtk-dialog.c:1935
+msgid "?lang=en"
+msgstr "?lang=ru"
+
+#: ../gtk-dialog.c:1059
+msgid "Click here for more information about authentication in OTR."
+msgstr "Дополнительно об идентификации в OTR."
+
+#: ../gtk-dialog.c:1063
+msgid "Authenticating a buddy helps ensure that the person you are talking to is who they claim to be."
+msgstr "Хотите быть уверены, что этот контакт - тот, за кого он себя выдает? Идентифицируйте его."
+
+#: ../gtk-dialog.c:1113
+msgid "Authenticating Buddy"
+msgstr "Идентификация контакта"
+
+#: ../gtk-dialog.c:1140
+msgid "Authenticating"
+msgstr "Идентификация"
+
+#: ../gtk-dialog.c:1201
+msgid "Generating private key"
+msgstr "Создание закрытого ключа"
+
+#: ../gtk-dialog.c:1202
+msgid "Please wait"
+msgstr "Подождите, пожалуйста"
+
+#: ../gtk-dialog.c:1210
+#: ../gtk-dialog.c:1627
+#: ../gtk-dialog.c:1664
+#: ../gtk-ui.c:175
+#: ../otr-plugin.c:115
+#: ../otr-plugin.c:212
+#: ../ui.c:110
+msgid "Unknown"
+msgstr "Неизвестно"
+
+#. Create the Please Wait... dialog
+#: ../gtk-dialog.c:1213
+#, c-format
+msgid "Generating private key for %s (%s)..."
+msgstr "Создание закрытого ключа для %s (%s)..."
+
+#: ../gtk-dialog.c:1258
+#, c-format
+msgid "%s Done."
+msgstr "%s Готово."
+
+#: ../gtk-dialog.c:1320
+#, c-format
+msgid "%s is contacting you from an unrecognized computer.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "%s общается с вами с неопознанного компьютера. Следует <a href=\"%s%s\">идентифицировать</a> этот контакт."
+
+#: ../gtk-dialog.c:1324
+#, c-format
+msgid "%s has not been authenticated yet.  You should <a href=\"%s%s\">authenticate</a> this buddy."
+msgstr "Идентификация %s пока не пройдена. Вам следует <a href=\"%s%s\">подтвердить личность</a> этого контакта."
+
+#: ../gtk-dialog.c:1365
+#: ../gtk-ui.c:76
+msgid "Finished"
+msgstr "Завершено"
+
+#: ../gtk-dialog.c:1366
+#: ../gtk-ui.c:75
+msgid "Private"
+msgstr "Защищено"
+
+#: ../gtk-dialog.c:1367
+#: ../gtk-ui.c:74
+msgid "Unverified"
+msgstr "Не идентиф."
+
+#: ../gtk-dialog.c:1368
+#: ../gtk-ui.c:73
+msgid "Not private"
+msgstr "Не защищено"
+
+#: ../gtk-dialog.c:1370
+msgid "Start a private conversation"
+msgstr "Начать защищенный разговор"
+
+#: ../gtk-dialog.c:1371
+msgid "Refresh the private conversation"
+msgstr "Обновить защищенный разговор"
+
+#: ../gtk-dialog.c:1375
+msgid "Start _private conversation"
+msgstr "Начать _защищенный разговор"
+
+#: ../gtk-dialog.c:1376
+msgid "Refresh _private conversation"
+msgstr "Обновить _защищенный разговор"
+
+#: ../gtk-dialog.c:1555
+msgid "I have not"
+msgstr "Нет"
+
+#: ../gtk-dialog.c:1556
+msgid "I have"
+msgstr "Есть"
+
+#: ../gtk-dialog.c:1558
+msgid " verified that this is in fact the correct"
+msgstr " проверить что это правильно"
+
+#: ../gtk-dialog.c:1567
+#, c-format
+msgid "fingerprint for %s."
+msgstr "отпечаток для %s."
+
+#: ../gtk-dialog.c:1579
+msgid "To verify the fingerprint, contact your buddy via some <i>other</i> authenticated channel, such as the telephone or GPG-signed email.  Each of you should tell your fingerprint to the other."
+msgstr "Для проверки отпечатка свяжитесь с его владельцем так, чтобы его личность не оставляла сомнений (например, по телефону или с помощью письма, зашифрованного GPG). Каждому из вас следует сообщить другому свой отпечаток."
+
+#: ../gtk-dialog.c:1583
+msgid "If everything matches up, you should indicate in the above dialog that you <b>have</b> verified the fingerprint."
+msgstr "Если все совпадает, следует отметить в диалоге сверху что вы <b>проверили</b> отпечаток."
+
+#: ../gtk-dialog.c:1585
+msgid "If your buddy has more than one IM account, or uses more than one computer, he may have multiple fingerprints."
+msgstr "Если ваш собеседник использует более одного аккаунта или более одного компьютера, у него может быть несколько отпечатков."
+
+#: ../gtk-dialog.c:1587
+msgid "However, the only way an imposter could duplicate one of your buddy's fingerprints is by stealing information from her/his computer."
+msgstr "Есть только один путь, которым злоумышленник может получить дубликат отпечатков  вашего собеседника: украсть информацию с его компьютера."
+
+#: ../gtk-dialog.c:1591
+msgid "Click here for more information about fingerprints."
+msgstr "Дополнительная информация об отпечатках."
+
+#: ../gtk-dialog.c:1594
+msgid "A <b>fingerprint</b> is a unique identifier that you should use to authenticate your buddy."
+msgstr "<b>Отпечаток</b> - уникальный код, который нужен, чтобы идентифицировать собеседника."
+
+#: ../gtk-dialog.c:1616
+#, c-format
+msgid "Verify fingerprint for %s"
+msgstr "Проверить отпечаток для %s"
+
+#: ../gtk-dialog.c:1620
+msgid "[none]"
+msgstr "[нет]"
+
+#: ../gtk-dialog.c:1628
+#, c-format
+msgid ""
+"Fingerprint for you, %s (%s):\n"
+"%s\n"
+"\n"
+"Purported fingerprint for %s:\n"
+"%s\n"
+msgstr ""
+"Отпечаток для вас, %s (%s):\n"
+"%s\n"
+"\n"
+"Предполагаемый отпечаток для %s:\n"
+"%s\n"
+
+#: ../gtk-dialog.c:1633
+#: ../gtk-ui.c:681
+msgid "Verify fingerprint"
+msgstr "Проверить отпечаток"
+
+#: ../gtk-dialog.c:1660
+#, c-format
+msgid "Authenticate %s"
+msgstr "Идентифицировать %s"
+
+#: ../gtk-dialog.c:1665
+#, c-format
+msgid "Enter a secret known only to %s and yourself.\n"
+msgstr "Введите секретный код, который знаете только вы и %s.\n"
+
+#: ../gtk-dialog.c:1668
+msgid "Authenticate buddy"
+msgstr "Идентифицировать контакт"
+
+#: ../gtk-dialog.c:1700
+msgid "An error occurred during authentication."
+msgstr "Ошибка идентификации."
+
+#: ../gtk-dialog.c:1716
+msgid "Authentication successful."
+msgstr "Идентификация прошла успешно."
+
+#: ../gtk-dialog.c:1719
+msgid "Authentication failed."
+msgstr "Ошибка идентификации."
+
+#: ../gtk-dialog.c:1744
+#, c-format
+msgid "Private conversation with %s started.%s"
+msgstr "Начать защищенный разговор с %s.%s"
+
+#: ../gtk-dialog.c:1748
+#, c-format
+msgid "<a href=\"%s%s\">Unverified</a> conversation with %%s started.%%s"
+msgstr "<a href=\"%s%s\">Непроверенный</a> разговор с  %%s started.%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1756
+#, c-format
+msgid "Not private conversation with %s started.%s"
+msgstr "Начат незащищенный разговор с %s.%s"
+
+#: ../gtk-dialog.c:1762
+#: ../gtk-dialog.c:1863
+msgid "  Warning: using old protocol version 1."
+msgstr "  Внимание: устаревший протокол версии 1."
+
+#: ../gtk-dialog.c:1782
+#, c-format
+msgid "Private conversation with %s lost."
+msgstr "Защищенный разговор с %s окончен."
+
+#: ../gtk-dialog.c:1817
+#, c-format
+msgid "%s has ended his/her private conversation with you; you should do the same."
+msgstr "%s завершил(а) защищенный разговор; сделайте то же и вы."
+
+#: ../gtk-dialog.c:1842
+#, c-format
+msgid "Successfully refreshed the private conversation with %s.%s"
+msgstr "Защищенный разговор с %s удачно обновлен.%s"
+
+#: ../gtk-dialog.c:1847
+#, c-format
+msgid "Successfully refreshed the <a href=\"%s%s\">unverified</a> conversation with %%s.%%s"
+msgstr "<a href=\"%s%s\">Непроверенный</a> разговор с  %%s удачно обновлен.%%s"
+
+#. This last case should never happen, since we know
+#. * we're in ENCRYPTED.
+#: ../gtk-dialog.c:1856
+#, c-format
+msgid "Successfully refreshed the not private conversation with %s.%s"
+msgstr "Незащищенный разговор с %s удачно обновлен.%s"
+
+#: ../gtk-dialog.c:1883
+#, c-format
+msgid "Attempting to refresh the private conversation with %s..."
+msgstr "Пытаемся обновить защищенный разговор с %s..."
+
+#: ../gtk-dialog.c:1885
+#, c-format
+msgid "Attempting to start a private conversation with %s..."
+msgstr "Пытаемся начать защищенный разговор с %s..."
+
+#: ../gtk-dialog.c:2045
+msgid "OTR:"
+msgstr "OTR:"
+
+#: ../gtk-dialog.c:2054
+msgid "OTR Messaging"
+msgstr "Сообщения OTR"
+
+#: ../gtk-dialog.c:2060
+msgid "_End private conversation"
+msgstr "_Завершить защищенный разговор"
+
+#.
+#. * Don't show the Verify fingerprint menu option any more.  You can
+#. * still get to the dialog through Authenticate connection ->
+#. * Advanced...
+#. *
+#. menuverf = gtk_menu_item_new_with_mnemonic(_("_Verify fingerprint"));
+#. gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuverf);
+#. gtk_widget_show(menuverf);
+#.
+#: ../gtk-dialog.c:2078
+msgid "_Authenticate buddy"
+msgstr "_Идентифицированный контакт"
+
+#: ../gtk-ui.c:96
+#, c-format
+msgid "Fingerprint: %.80s"
+msgstr "Отпечаток: %.80s"
+
+#: ../gtk-ui.c:100
+#, c-format
+msgid "No key present"
+msgstr "Нет ключа"
+
+#: ../gtk-ui.c:105
+#, c-format
+msgid "No account available"
+msgstr "Нет аккаунта"
+
+#: ../gtk-ui.c:165
+msgid "Unused"
+msgstr "Не использовано"
+
+#: ../gtk-ui.c:171
+msgid "Yes"
+msgstr "Да"
+
+#: ../gtk-ui.c:171
+msgid "No"
+msgstr "Нет"
+
+#: ../gtk-ui.c:396
+msgid "Enable private messaging"
+msgstr "Включить защиту разговоров"
+
+#: ../gtk-ui.c:398
+msgid "Automatically initiate private messaging"
+msgstr "Автоматически начинать защищенный разговор"
+
+#: ../gtk-ui.c:400
+msgid "Require private messaging"
+msgstr "Только защищенный разговор"
+
+#: ../gtk-ui.c:403
+msgid "Don't log OTR conversations"
+msgstr "Не записывать разговоры OTR в журнал"
+
+#: ../gtk-ui.c:531
+msgid "My private keys"
+msgstr " Мои закрытые ключи"
+
+#: ../gtk-ui.c:540
+msgid "Key for account:"
+msgstr "Ключ для аккаунта:"
+
+#: ../gtk-ui.c:565
+msgid "Generate"
+msgstr "Создать"
+
+#: ../gtk-ui.c:596
+msgid "Default OTR Settings"
+msgstr "Установки OTR по умолчанию"
+
+#: ../gtk-ui.c:625
+msgid "Screenname"
+msgstr "Имя на экране"
+
+#: ../gtk-ui.c:626
+msgid "Status"
+msgstr "Статус"
+
+#: ../gtk-ui.c:627
+msgid "Verified"
+msgstr "Проверено"
+
+#: ../gtk-ui.c:628
+msgid "Fingerprint"
+msgstr "Отпечаток"
+
+#: ../gtk-ui.c:629
+msgid "Account"
+msgstr "Аккаунт"
+
+#: ../gtk-ui.c:665
+msgid "Start private connection"
+msgstr "Начать защищенный разговор"
+
+#: ../gtk-ui.c:673
+msgid "End private connection"
+msgstr "Завершить защищенный разговор"
+
+#: ../gtk-ui.c:689
+msgid "Forget fingerprint"
+msgstr "Забыть отпечаток"
+
+#: ../gtk-ui.c:738
+msgid "Config"
+msgstr "Конфигурация"
+
+#: ../gtk-ui.c:740
+msgid "Known fingerprints"
+msgstr "Известные отпечатки"
+
+#: ../gtk-ui.c:838
+#: ../otr-plugin.c:577
+msgid "OTR Settings"
+msgstr "Настройки OTR"
+
+#. Set the title
+#: ../gtk-ui.c:856
+#, c-format
+msgid "OTR Settings for %s"
+msgstr "Настройки OTR для %s"
+
+#. Make the cascaded checkboxes
+#: ../gtk-ui.c:873
+msgid "Use default OTR settings for this buddy"
+msgstr "Использовать настройки по умолчанию"
+
+#: ../otr-plugin.c:113
+#, c-format
+msgid "You are not currently connected to account %s (%s)."
+msgstr "Нет связи с аккаунтом %s (%s)."
+
+#: ../otr-plugin.c:117
+msgid "Not connected"
+msgstr "Нет соединения"
+
+#: ../otr-plugin.c:161
+#, c-format
+msgid "Out of memory building filenames!\n"
+msgstr "Построение списка файлов заняло слишком много памяти!\n"
+
+#: ../otr-plugin.c:167
+#, c-format
+msgid "Could not write private key file\n"
+msgstr "Ошибка записи закрытого ключа в файл\n"
+
+#: ../otr-plugin.c:210
+#, c-format
+msgid "Unknown account %s (%s)."
+msgstr "Неизвестный аккаунт %s (%s)."
+
+#: ../otr-plugin.c:214
+msgid "Unknown account"
+msgstr "Неизвестный аккаунт"
+
+#: ../otr-plugin.c:953
+msgid "Off-the-Record Messaging"
+msgstr "Off-the-Record (OTR)"
+
+#: ../otr-plugin.c:954
+msgid "Provides private and secure conversations"
+msgstr "Защищенные приватные коммуникации"
+
+#: ../otr-plugin.c:962
+msgid ""
+"Preserves the privacy of IM communications by providing encryption, "
+"authentication, deniability, and perfect forward secrecy."
+msgstr ""
+"Обеспечивает конфиденциальность сообщений путем шифрования, "
+"идентификации собеседника, правдоподобного опровержения и системы perfect forward secrecy (PFS)."
+
+#: ../ui.c:108
+#, c-format
+msgid "Account %s (%s) could not be found"
+msgstr "Аккаунт %s (%s) не обнаружен"
+
+#: ../ui.c:112
+msgid "Account not found"
+msgstr "Аккаунт не обнаружен"
+
diff --git a/tooltipmenu.c b/tooltipmenu.c
new file mode 100644
index 0000000..fb5f901
--- /dev/null
+++ b/tooltipmenu.c
@@ -0,0 +1,252 @@
+/*
+ *  Off-the-Record Messaging plugin for pidgin
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
+ *                           <otr at cypherpunks.ca>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* This file is based on a copy of gtkkmenutray.c  */
+
+
+/*
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+#include "debug.h"
+
+#include "tooltipmenu.h"
+
+#include <gtk/gtkeventbox.h>
+#include <gtk/gtkiconfactory.h>
+#include <gtk/gtkversion.h>
+
+/******************************************************************************
+ * Enums
+ *****************************************************************************/
+enum {
+        PROP_ZERO = 0,
+        PROP_BOX
+};
+
+/******************************************************************************
+ * Globals
+ *****************************************************************************/
+static GObjectClass *parent_class = NULL;
+
+/******************************************************************************
+ * Internal Stuff
+ *****************************************************************************/
+
+/******************************************************************************
+ * Item Stuff
+ *****************************************************************************/
+/*static void
+tooltip_menu_select(GtkItem *item) {
+
+}
+
+static void
+tooltip_menu_deselect(GtkItem *item) {
+
+}*/
+
+/******************************************************************************
+ * Widget Stuff
+ *****************************************************************************/
+
+/******************************************************************************
+ * Object Stuff
+ *****************************************************************************/
+static void
+tooltip_menu_get_property(GObject *obj, guint param_id, GValue *value,
+                                                                GParamSpec *pspec)
+{
+        TooltipMenu *tooltip_menu = TOOLTIP_MENU(obj);
+
+        switch(param_id) {
+                case PROP_BOX:
+                        g_value_set_object(value, tooltip_menu_get_box(tooltip_menu));
+                        break;
+                default:
+                        G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
+                        break;
+        }
+}
+
+static void
+tooltip_menu_finalize(GObject *obj) {
+#if 0
+        /* This _might_ be leaking, but I have a sneaking suspicion that the widget is
+         * getting destroyed in GtkContainer's finalize function.  But if were are
+         * leaking here, be sure to figure out why this causes a crash.
+         *      -- Gary
+         */
+        TooltipMenu *tray = TOOLTIP_MENU(obj);
+
+        if(GTK_IS_WIDGET(tray->tray))
+                gtk_widget_destroy(GTK_WIDGET(tray->tray));
+#endif
+
+        G_OBJECT_CLASS(parent_class)->finalize(obj);
+}
+
+static void
+tooltip_menu_class_init(TooltipMenuClass *klass) {
+        GObjectClass *object_class = G_OBJECT_CLASS(klass);
+        GParamSpec *pspec;
+
+        parent_class = g_type_class_peek_parent(klass);
+
+        object_class->finalize = tooltip_menu_finalize;
+        object_class->get_property = tooltip_menu_get_property;
+
+        pspec = g_param_spec_object("box", "The box",
+		"The box",
+		GTK_TYPE_BOX,
+		G_PARAM_READABLE);
+        g_object_class_install_property(object_class, PROP_BOX, pspec);
+}
+
+static void
+tooltip_menu_init(TooltipMenu *tooltip_menu) {
+        GtkWidget *widget = GTK_WIDGET(tooltip_menu);
+        gtk_menu_item_set_right_justified(GTK_MENU_ITEM(tooltip_menu), TRUE);
+
+        if(!GTK_IS_WIDGET(tooltip_menu->tray))
+                tooltip_menu->tray = gtk_hbox_new(FALSE, 0);
+
+        tooltip_menu->tooltips = gtk_tooltips_new();
+
+        gtk_widget_set_size_request(widget, -1, -1);
+
+        gtk_container_add(GTK_CONTAINER(tooltip_menu), tooltip_menu->tray);
+
+        gtk_widget_show(tooltip_menu->tray);
+}
+
+/******************************************************************************
+ * API
+ *****************************************************************************/
+GType
+tooltip_menu_get_gtype(void) {
+        static GType type = 0;
+
+        if(type == 0) {
+                static const GTypeInfo info = {
+                        sizeof(TooltipMenuClass),
+                        NULL,
+                        NULL,
+                        (GClassInitFunc)tooltip_menu_class_init,
+                        NULL,
+                        NULL,
+                        sizeof(TooltipMenu),
+                        0,
+                        (GInstanceInitFunc)tooltip_menu_init,
+                        NULL
+                };
+
+                type = g_type_register_static(GTK_TYPE_MENU_ITEM,
+                                                                          "TooltipMenu",
+                                                                          &info, 0);
+        }
+
+        return type;
+}
+
+GtkWidget *
+tooltip_menu_new() {
+        return g_object_new(TYPE_TOOLTIP_MENU, NULL);
+}
+
+GtkWidget *
+tooltip_menu_get_box(TooltipMenu *tooltip_menu) {
+        g_return_val_if_fail(IS_TOOLTIP_MENU(tooltip_menu), NULL);
+        return tooltip_menu->tray;
+}
+
+static void
+tooltip_menu_add(TooltipMenu *tooltip_menu, GtkWidget *widget,
+                                           const char *tooltip, gboolean prepend)
+{
+        g_return_if_fail(IS_TOOLTIP_MENU(tooltip_menu));
+        g_return_if_fail(GTK_IS_WIDGET(widget));
+
+        if (GTK_WIDGET_NO_WINDOW(widget))
+        {
+                GtkWidget *event;
+
+                event = gtk_event_box_new();
+                gtk_container_add(GTK_CONTAINER(event), widget);
+                gtk_widget_show(event);
+                widget = event;
+        }
+
+        tooltip_menu_set_tooltip(tooltip_menu, widget, tooltip);
+
+        if (prepend)
+                gtk_box_pack_start(GTK_BOX(tooltip_menu->tray), widget, FALSE, FALSE, 0);
+        else
+                gtk_box_pack_end(GTK_BOX(tooltip_menu->tray), widget, FALSE, FALSE, 0);
+}
+
+void
+tooltip_menu_append(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip)
+{
+        tooltip_menu_add(tooltip_menu, widget, tooltip, FALSE);
+}
+
+void
+tooltip_menu_prepend(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip)
+{
+        tooltip_menu_add(tooltip_menu, widget, tooltip, TRUE);
+}
+
+void
+tooltip_menu_set_tooltip(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip)
+{
+        if (!tooltip_menu->tooltips)
+                return;
+
+        /* Should we check whether widget is a child of tooltip_menu? */
+
+        /*
+         * If the widget does not have it's own window, then it
+         * must have automatically been added to an event box
+         * when it was added to the menu tray.  If this is the
+         * case, we want to set the tooltip on the widget's parent,
+         * not on the widget itself.
+         */
+        if (GTK_WIDGET_NO_WINDOW(widget))
+                widget = widget->parent;
+
+        gtk_tooltips_set_tip(tooltip_menu->tooltips, widget, tooltip, NULL);
+}
+
diff --git a/tooltipmenu.h b/tooltipmenu.h
new file mode 100644
index 0000000..28beec1
--- /dev/null
+++ b/tooltipmenu.h
@@ -0,0 +1,123 @@
+/*
+ *  Off-the-Record Messaging plugin for pidgin
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
+ *                           <otr at cypherpunks.ca>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of version 2 of the GNU General Public License as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* This file is based on a copy of gtkkmenutray.h  */
+
+/* Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+#ifndef TOOLTIP_MENU_H
+#define TOOLTIP_MENU_H
+
+#include <gtk/gtkhbox.h>
+#include <gtk/gtkmenuitem.h>
+#include <gtk/gtktooltips.h>
+
+#define TYPE_TOOLTIP_MENU                           (tooltip_menu_get_gtype())
+#define TOOLTIP_MENU(obj)                           (GTK_CHECK_CAST((obj), TYPE_TOOLTIP_MENU, TooltipMenu))
+#define TOOLTIP_MENU_CLASS(klass)           (GTK_CHECK_CLASS_CAST((klass), TYPE_TOOLTIP_MENU, TooltipMenuClass))
+#define IS_TOOLTIP_MENU(obj)                        (GTK_CHECK_TYPE((obj), TYPE_TOOLTIP_MENU))
+#define IS_TOOLTIP_MENU_CLASS(klass)        (GTK_CHECK_CLASS_TYPE((klass), TYPE_TOOLTIP_MENU))
+#define TOOLTIP_MENU_GET_CLASS(obj) (GTK_CHECK_GET_CLASS((obj), TYPE_TOOLTIP_MENU, TooltipMenuClass))
+
+typedef struct _TooltipMenu                          TooltipMenu;
+typedef struct _TooltipMenuClass             TooltipMenuClass;
+
+struct _TooltipMenu {
+        GtkMenuItem gparent;                                    /**< The parent instance */
+        GtkWidget *tray;                                                /**< The tray */
+        GtkTooltips *tooltips;                                  /**< Tooltips */
+};
+
+struct _TooltipMenuClass {
+        GtkMenuItemClass gparent;                               /**< The parent class */
+};
+
+G_BEGIN_DECLS
+
+/**
+ * Registers the TooltipMenu class if necessary and returns the
+ * type ID assigned to it.
+ *
+ * @return The TooltipMenu type ID
+ */
+GType tooltip_menu_get_gtype(void);
+
+/**
+ * Creates a new TooltipMenu
+ *
+ * @return A new TooltipMenu
+ */
+GtkWidget *tooltip_menu_new(void);
+
+/**
+ * Gets the box for the TooltipMenu
+ *
+ * @param tooltip_menu The TooltipMenu
+ *
+ * @return The box that this menu tray is using
+ */
+GtkWidget *tooltip_menu_get_box(TooltipMenu *tooltip_menu);
+
+/**
+ * Appends a widget into the tray
+ *
+ * @param tooltip_menu The tray
+ * @param widget    The widget
+ * @param tooltip   The tooltip for this widget (widget requires its own X-window)
+ */
+void tooltip_menu_append(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip);
+
+/**
+ * Prepends a widget into the tray
+ *
+ * @param tooltip_menu The tray
+ * @param widget    The widget
+ * @param tooltip   The tooltip for this widget (widget requires its own X-window)
+ */
+void tooltip_menu_prepend(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip);
+
+/**
+ * Set the tooltip for a widget
+ *
+ * @param tooltip_menu The tray
+ * @param widget    The widget
+ * @param tooltip   The tooltip to set for the widget (widget requires its own X-window)
+ */
+void tooltip_menu_set_tooltip(TooltipMenu *tooltip_menu, GtkWidget *widget, const char *tooltip);
+
+G_END_DECLS
+
+#endif /* PIDGIN_MENU_TRAY_H */
diff --git a/ui.c b/ui.c
index 886b2c7..5ee5a58 100644
--- a/ui.c
+++ b/ui.c
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -163,6 +164,7 @@ void otrg_ui_get_prefs(OtrgUiPrefs *prefsp, PurpleAccount *account,
     if (!otrg_plugin_proto_supports_otr(proto)) {
 	prefsp->policy = OTRL_POLICY_NEVER;
 	prefsp->avoid_logging_otr = FALSE;
+	prefsp->show_otr_button = FALSE;
 	return;
     }
 
@@ -173,4 +175,5 @@ void otrg_ui_get_prefs(OtrgUiPrefs *prefsp, PurpleAccount *account,
     /* If we've got no other way to get the prefs, use sensible defaults */
     prefsp->policy = OTRL_POLICY_DEFAULT;
     prefsp->avoid_logging_otr = FALSE;
+    prefsp->show_otr_button = FALSE;
 }
diff --git a/ui.h b/ui.h
index 3da58af..328a6ac 100644
--- a/ui.h
+++ b/ui.h
@@ -1,6 +1,7 @@
 /*
  *  Off-the-Record Messaging plugin for pidgin
- *  Copyright (C) 2004-2007  Ian Goldberg, Chris Alexander, Nikita Borisov
+ *  Copyright (C) 2004-2008  Ian Goldberg, Rob Smits,
+ *                           Chris Alexander, Nikita Borisov
  *                           <otr at cypherpunks.ca>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,6 +27,7 @@
 typedef struct {
     OtrlPolicy policy;
     gboolean avoid_logging_otr;
+    gboolean show_otr_button;
 } OtrgUiPrefs;
 
 typedef struct {

-- 
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