Commit c276bfa7 authored by Rob Smits's avatar Rob Smits
Browse files

2012-04-30

	* gtk-dialog.c:
	* gtk-ui.c:
	* otr-plugin.c:
	* otr-plugin.h:
	* ui.c: More changes for instance tags. Some logging-
	related changes too (output whether pidgin is logging,
	change default not to log otr conversations). -- Rob
	Smits

2009-06-11

	* gtk-dialog.c:
	* otr-plugin.c:
	* otr-plugin.h: Initial instance tags implementation
	from Lisa Du
parent 1a7b6e27
...@@ -2,7 +2,7 @@ Off-the-Record Messaging plugin for pidgin ...@@ -2,7 +2,7 @@ Off-the-Record Messaging plugin for pidgin
Authors: Authors:
Ian Goldberg, Rob Smits, Chris Alexander, Willy Lew, Nikita Borisov Ian Goldberg, Rob Smits, Chris Alexander, Willy Lew, Lisa Du, Nikita Borisov
<otr@cypherpunks.ca> <otr@cypherpunks.ca>
See the README file for mailing list information See the README file for mailing list information
2012-04-30
* gtk-dialog.c:
* gtk-ui.c:
* otr-plugin.c:
* otr-plugin.h:
* ui.c: More changes for instance tags. Some logging-
related changes too (output whether pidgin is logging,
change default not to log otr conversations). -- Rob
Smits
2010-03-02 2010-03-02
* po/vi.po: Vietnamese translation from Lyndon Johnson * po/vi.po: Vietnamese translation from Lyndon Johnson
...@@ -9,6 +20,13 @@ ...@@ -9,6 +20,13 @@
the fingerprints in the manual authentication dialog the fingerprints in the manual authentication dialog
selectable (but not selected by default). selectable (but not selected by default).
2009-06-11
* gtk-dialog.c:
* otr-plugin.c:
* otr-plugin.h: Initial instance tags implementation
from Lisa Du
2009-08-24 2009-08-24
* po/fr.po: Fixed \n errors * po/fr.po: Fixed \n errors
......
...@@ -51,6 +51,8 @@ Use the provided Makefile.mingw: ...@@ -51,6 +51,8 @@ Use the provided Makefile.mingw:
make -f Makefile.mingw make -f Makefile.mingw
See Makefile.mingw.notes for a few hints.
INSTALLATION INSTALLATION
You should be able to simply do "make install". If you want to install You should be able to simply do "make install". If you want to install
......
WIN32=1 WIN32=1
# The version number to put in the plugin info # The version number to put in the plugin info
PIDGIN_OTR_VERSION = 3.2.0 PIDGIN_OTR_VERSION = 4.0.0
# Name of the gettext domain # Name of the gettext domain
GETTEXT_PACKAGE = pidgin-otr GETTEXT_PACKAGE = pidgin-otr
# Replace this with the path to the pidgin and purple headers # Replace this with the path to the pidgin and purple headers
PIDGIN_HEADERS ?= /usr/i586-mingw32msvc/include/pidgin PIDGIN_HEADERS ?= -I/usr/i586-mingw32msvc/include/pidgin \
PURPLE_HEADERS ?= /usr/i586-mingw32msvc/include/libpurple -I/usr/i586-mingw32msvc/include/pidgin/win32
PURPLE_HEADERS ?= -I/usr/i586-mingw32msvc/include/libpurple \
-I/usr/i586-mingw32msvc/include/libpurple/win32
# If you don't have pkg-config, put the appropriate -I entry on the next line # Replace this with the path to the extracted GTK+ "all-in-one" win32 bundle
GTK_WIN32_BUNDLE ?= /usr/i586-mingw32msvc/misc/gtk_bundle
# Replace this with the to path DLL files from a Win32 Pidgin distributable
# (i.e. pidgin.dll and libpurple.dll)
PIDGIN_WIN32_LIBS ?= /usr/i586-mingw32msvc/misc/pidgin_dlls
# If you don't have pkg-config, uncomment the -I lines below
GTK_HDRS ?= `pkg-config --cflags glib-2.0 gtk+-2.0` GTK_HDRS ?= `pkg-config --cflags glib-2.0 gtk+-2.0`
#GTK_HDRS ?= -I$(GTK_WIN32_BUNDLE)/include/gtk-2.0 \
# -I$(GTK_WIN32_BUNDLE)/include/glib-2.0 \
# -I$(GTK_WIN32_BUNDLE)/include/cairo \
# -I$(GTK_WIN32_BUNDLE)/include/pango-1.0 \
# -I$(GTK_WIN32_BUNDLE)/include/atk-1.0 \
# -I$(GTK_WIN32_BUNDLE)/include/gdk-pixbuf-2.0 \
# -I$(GTK_WIN32_BUNDLE)/lib/glib-2.0/include \
# -I$(GTK_WIN32_BUNDLE)/lib/gtk-2.0/include
# The location of the libotr include files. Note that if, for example, # The location of the libotr include files. Note that if, for example,
# the full path of message.h is /usr/include/libotr/message.h, you # the full path of message.h is /usr/include/libotr/message.h, you
...@@ -41,12 +59,13 @@ ZIPFILE = pidgin-otr-$(PIDGIN_OTR_VERSION).zip ...@@ -41,12 +59,13 @@ ZIPFILE = pidgin-otr-$(PIDGIN_OTR_VERSION).zip
CC = i586-mingw32msvc-gcc CC = i586-mingw32msvc-gcc
LDFLAGS = -Wl,--enable-auto-image-base LDFLAGS = -Wl,--enable-auto-image-base
LDLIBS = $(LIBOTRLIBDIR)/libotr.a -lgtk-win32-2.0 -lglib-2.0 -lgdk_pixbuf-2.0 \ LDLIBS = $(LIBOTRLIBDIR)/libotr.a -L$(GTK_WIN32_BUNDLE)/lib \
-lgobject-2.0 -lpidgin -llibpurple -lgcrypt -lgpg-error \ -L$(PIDGIN_WIN32_LIBS) -lgtk-win32-2.0 -lglib-2.0 \
-L$(LIBINTLLIBDIR) -lintl -lgdk_pixbuf-2.0 -lgobject-2.0 -lpidgin -llibpurple \
-lgcrypt -lgpg-error -L$(LIBINTLLIBDIR) -lintl
CC ?= gcc CC ?= gcc
override CFLAGS += -g -O2 -Wall -I$(PIDGIN_HEADERS) -I$(PURPLE_HEADERS) \ override CFLAGS += -g -O2 -Wall $(PIDGIN_HEADERS) $(PURPLE_HEADERS) \
$(GTK_HDRS) -I$(LIBOTRINCDIR) $(FPIC) -DUSING_GTK -DPURPLE_PLUGINS \ $(GTK_HDRS) -I$(LIBOTRINCDIR) $(FPIC) -DUSING_GTK -DPURPLE_PLUGINS \
-DPIDGIN_OTR_VERSION=\"$(PIDGIN_OTR_VERSION)\" \ -DPIDGIN_OTR_VERSION=\"$(PIDGIN_OTR_VERSION)\" \
-DPIDGIN_NAME=\"Pidgin\" -I$(LIBINTLINCDIR) -DENABLE_NLS \ -DPIDGIN_NAME=\"Pidgin\" -I$(LIBINTLINCDIR) -DENABLE_NLS \
...@@ -66,8 +85,8 @@ clean: ...@@ -66,8 +85,8 @@ clean:
distclean: clean distclean: clean
$(MAKE) -C po -f Makefile.mingw distclean $(MAKE) -C po -f Makefile.mingw distclean
## Package up all the pieces needed to build the installer ## Prepare the win32_export directory
zip: all prepare_win32_export: all
mkdir win32_export mkdir win32_export
# Copy pieces over from the libotr source dir # Copy pieces over from the libotr source dir
for f in otr_mackey.exe otr_parse.exe otr_remac.exe otr_modify.exe \ for f in otr_mackey.exe otr_parse.exe otr_remac.exe otr_modify.exe \
...@@ -90,8 +109,16 @@ zip: all ...@@ -90,8 +109,16 @@ zip: all
i586-mingw32msvc-strip *.exe *.dll; \ i586-mingw32msvc-strip *.exe *.dll; \
perl -pi -e 's/$$/\r/' README.Toolkit.txt Protocol-v2.html \ perl -pi -e 's/$$/\r/' README.Toolkit.txt Protocol-v2.html \
COPYING.txt COPYING.LIB.txt README.txt; \ COPYING.txt COPYING.LIB.txt README.txt; \
installer: prepare_win32_export
makensis packaging/windows/pidgin-otr-rob.nsi
rm -rf win32_export
## Package up all the pieces needed to build the installer
zip: prepare_win32_export
rm -f ../$(ZIPFILE); \ rm -f ../$(ZIPFILE); \
zip -r ../$(ZIPFILE) README.txt \ zip -r ../$(ZIPFILE) README.txt \
README.Toolkit.txt Protocol-v2.html COPYING.txt \ README.Toolkit.txt Protocol-v2.html COPYING.txt \
COPYING.LIB.txt *.exe *.dll *.nsi locale COPYING.LIB.txt *.exe *.dll *.nsi locale
rm -rf win32_export rm -rf win32_export
Here are some rough notes that might help you create a pidgin-otr Win32 build on
a Linux system with mingw32. These have been tested on Ubuntu 11.04.
I am listing packages and their build instructions in the order they should be
built. Good luck!
libgpg-error-1.0:
(before configure)
HOST_CC=gcc
DLLTOOL=i586-mingw32msvc-dlltool
AS=i586-mingw32msvc-as
export HOST_CC DLLTOOL AS
./configure --with-pic --build=`./config.guess` --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
make
sudo make install
gcrypt-1.2.1:
w32root=i586-mingw32msvc ./autogen.sh --build-w32
Then append #undef HAVE_GETTIMEOFDAY to libgcrypt config.h
Apply windows slow random fix (patch on otr website, listed as "Note that if you're compiling from source on win32...")
make
sudo make install
libotr:
./configure --with-pic --build=`./config.guess` --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --with-libgcrypt-prefix=/usr/i586-mingw32msvc
make
sudo make install
pidgin-otr:
You will need: Pidgin source code distributable, Pidgin Win32 distributable, and an "all-in-one bundle" of the GTK+ stack 2.14.7 or greater (e.g., gtk+-bundle_2.24.10-20120208_win32.zip).
In Makefile.mingw, specify the location of PIDGIN_HEADERS, PURPLE_HEADERS, GTK_WIN32_BUNDLE, and PIDGIN_WIN32_LIBS
Ensure either pkg-config will correctly resolve all the dependencies for glib-2.0 and gtk+-2.0 (there is a README in the GTK+ bundle about this), or uncomment (and perhaps revise) the hardcoded list of includes for GTK_HDRS
make -f Makefile.mingw
nsis:
sudo apt-get install nsis
Locate the "nsisunz" plugin (a google search for "nsisunz.zip" should be sufficient)
Extract the DLL to /usr/local/share/nsis/Plugins (yes it's a DLL extension, but it will still work for GNU/Linux nsis)
make -f Makefile.mingw installer <-- This should now build the nsis installer
Off-the-Record Messaging plugin for pidgin Off-the-Record Messaging plugin for pidgin
v3.2.0, 15 Jun 2008 v4.0.0, 2012
This is a pidgin plugin which implements Off-the-Record (OTR) Messaging. 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 It is known to work (at least) under the Linux and Windows versions of
...@@ -300,9 +300,9 @@ The Off-the-Record Messaging plugin for pidgin is covered by the following ...@@ -300,9 +300,9 @@ The Off-the-Record Messaging plugin for pidgin is covered by the following
(GPL) license: (GPL) license:
Off-the-Record Messaging plugin for pidgin Off-the-Record Messaging plugin for pidgin
Copyright (C) 2004-2009 Ian Goldberg, Rob Smits, Copyright (C) 2004-2012 Ian Goldberg, Rob Smits,
Chris Alexander, Willy Lew, Chris Alexander, Willy Lew,
Nikita Borisov Lisa Du, Nikita Borisov
<otr@cypherpunks.ca> <otr@cypherpunks.ca>
...@@ -325,7 +325,7 @@ CONTACT ...@@ -325,7 +325,7 @@ CONTACT
To report problems, comments, suggestions, patches, etc., you can email To report problems, comments, suggestions, patches, etc., you can email
the authors: the authors:
Ian Goldberg, Rob Smits, Chris Alexander, and Nikita Borisov Ian Goldberg, Rob Smits, Chris Alexander, Willy Lew, Lisa Du, Nikita Borisov
<otr@cypherpunks.ca> <otr@cypherpunks.ca>
For more information on Off-the-Record Messaging, visit For more information on Off-the-Record Messaging, visit
......
/* /*
* Off-the-Record Messaging plugin for pidgin * Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2009 Ian Goldberg, Rob Smits, * Copyright (C) 2004-2012 Ian Goldberg, Rob Smits,
* Chris Alexander, Willy Lew, * Chris Alexander, Willy Lew,
* Nikita Borisov * Nikita Borisov
* <otr@cypherpunks.ca> * <otr@cypherpunks.ca>
...@@ -109,7 +109,7 @@ int otrg_dialog_display_otr_message( const char *accountname, ...@@ -109,7 +109,7 @@ int otrg_dialog_display_otr_message( const char *accountname,
int force_create) int force_create)
{ {
return ui_ops->display_otr_message(accountname, protocol, username, msg, return ui_ops->display_otr_message(accountname, protocol, username, msg,
force_create); force_create);
} }
/* Put up a Please Wait dialog. This dialog can not be cancelled. /* Put up a Please Wait dialog. This dialog can not be cancelled.
......
/* /*
* Off-the-Record Messaging plugin for pidgin * Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2009 Ian Goldberg, Rob Smits, * Copyright (C) 2004-2012 Ian Goldberg, Rob Smits,
* Chris Alexander, Willy Lew, * Chris Alexander, Willy Lew,
* Nikita Borisov * Nikita Borisov
* <otr@cypherpunks.ca> * <otr@cypherpunks.ca>
......
This diff is collapsed.
/* /*
* Off-the-Record Messaging plugin for pidgin * Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2009 Ian Goldberg, Rob Smits, * Copyright (C) 2004-2012 Ian Goldberg, Rob Smits,
* Chris Alexander, Willy Lew, * Chris Alexander, Willy Lew,
* Nikita Borisov * Nikita Borisov
* <otr@cypherpunks.ca> * <otr@cypherpunks.ca>
......
/* /*
* Off-the-Record Messaging plugin for pidgin * Off-the-Record Messaging plugin for pidgin
* Copyright (C) 2004-2009 Ian Goldberg, Rob Smits, * Copyright (C) 2004-2012 Ian Goldberg, Rob Smits,
* Chris Alexander, Willy Lew, * Chris Alexander, Willy Lew,
* Nikita Borisov * Nikita Borisov
* <otr@cypherpunks.ca> * <otr@cypherpunks.ca>
...@@ -91,7 +91,7 @@ static void account_menu_changed_cb(GtkWidget *item, PurpleAccount *account, ...@@ -91,7 +91,7 @@ static void account_menu_changed_cb(GtkWidget *item, PurpleAccount *account,
GtkWidget *fprint = ui_layout.fprint_label; GtkWidget *fprint = ui_layout.fprint_label;
char s[100]; char s[100];
char *fingerprint; char *fingerprint;
if (account) { if (account) {
char fingerprint_buf[45]; char fingerprint_buf[45];
accountname = purple_account_get_username(account); accountname = purple_account_get_username(account);
...@@ -123,7 +123,9 @@ static void account_menu_changed_cb(GtkWidget *item, PurpleAccount *account, ...@@ -123,7 +123,9 @@ static void account_menu_changed_cb(GtkWidget *item, PurpleAccount *account,
* UI, if visible. */ * UI, if visible. */
static void otrg_gtk_ui_update_fingerprint(void) static void otrg_gtk_ui_update_fingerprint(void)
{ {
g_signal_emit_by_name(G_OBJECT(ui_layout.accountmenu), "changed"); if (ui_layout.accountmenu) {
g_signal_emit_by_name(G_OBJECT(ui_layout.accountmenu), "changed");
}
} }
static void account_menu_added_removed_cb(PurpleAccount *account, void *data) static void account_menu_added_removed_cb(PurpleAccount *account, void *data)
...@@ -162,26 +164,54 @@ static void otrg_gtk_ui_update_keylist(void) ...@@ -162,26 +164,54 @@ static void otrg_gtk_ui_update_keylist(void)
int i; int i;
PurplePlugin *p; PurplePlugin *p;
char *proto_name; char *proto_name;
if (context->their_instance != OTRL_INSTAG_MASTER) continue;
fingerprint = context->fingerprint_root.next; fingerprint = context->fingerprint_root.next;
/* If there's no fingerprint, don't add it to the known /* If there's no fingerprint, don't add it to the known
* fingerprints list */ * fingerprints list */
while(fingerprint) { while(fingerprint) {
ConnContext *context_iter;
TrustLevel best_level = TRUST_NOT_PRIVATE;
int used = 0;
titles[0] = context->username; titles[0] = context->username;
if (context->msgstate == OTRL_MSGSTATE_ENCRYPTED && titles[1] = _("Unused");
context->active_fingerprint != fingerprint) {
titles[1] = _("Unused"); for (context_iter = context->m_context;
} else { context_iter && context_iter->m_context == context->m_context;
context_iter = context_iter->next) {
TrustLevel this_level = TRUST_NOT_PRIVATE;
if (context_iter->active_fingerprint == fingerprint) {
this_level = otrg_plugin_context_to_trust(context_iter);
used = 1;
if (this_level == TRUST_PRIVATE) {
best_level = TRUST_PRIVATE;
} else if (this_level == TRUST_UNVERIFIED
&& best_level != TRUST_PRIVATE) {
best_level = TRUST_UNVERIFIED;
} else if (this_level == TRUST_FINISHED
&& best_level == TRUST_NOT_PRIVATE) {
best_level = TRUST_FINISHED;
}
}
}
if (used) {
titles[1] = (gchar *) titles[1] = (gchar *)
_(trust_states[otrg_plugin_context_to_trust(context)]); _(trust_states[best_level]);
} }
titles[2] = (fingerprint->trust && fingerprint->trust[0]) ? titles[2] = (fingerprint->trust && fingerprint->trust[0]) ?
_("Yes") : _("No"); _("Yes") : _("No");
otrl_privkey_hash_to_human(hash, fingerprint->fingerprint); otrl_privkey_hash_to_human(hash, fingerprint->fingerprint);
titles[3] = hash; titles[3] = hash;
p = purple_find_prpl(context->protocol); p = purple_find_prpl(context->protocol);
proto_name = (p && p->info->name) ? p->info->name : _("Unknown"); proto_name = (p && p->info->name) ? p->info->name : _("Unknown");
titles[4] = g_strdup_printf("%s (%s)", context->accountname, titles[4] = g_strdup_printf("%s (%s)", context->accountname,
proto_name); proto_name);
i = gtk_clist_append(GTK_CLIST(keylist), titles); i = gtk_clist_append(GTK_CLIST(keylist), titles);
g_free(titles[4]); g_free(titles[4]);
gtk_clist_set_row_data(GTK_CLIST(keylist), i, fingerprint); gtk_clist_set_row_data(GTK_CLIST(keylist), i, fingerprint);
...@@ -208,9 +238,9 @@ static void generate(GtkWidget *widget, gpointer data) ...@@ -208,9 +238,9 @@ static void generate(GtkWidget *widget, gpointer data)
{ {
PurpleAccount *account; PurpleAccount *account;
account = pidgin_account_option_menu_get_selected(ui_layout.accountmenu); account = pidgin_account_option_menu_get_selected(ui_layout.accountmenu);
if (account == NULL) return; if (account == NULL) return;
otrg_plugin_create_privkey(purple_account_get_username(account), otrg_plugin_create_privkey(purple_account_get_username(account),
purple_account_get_protocol_id(account)); purple_account_get_protocol_id(account));
} }
...@@ -243,26 +273,33 @@ static void clist_selected(GtkWidget *widget, gint row, gint column, ...@@ -243,26 +273,33 @@ static void clist_selected(GtkWidget *widget, gint row, gint column,
int verify_sensitive = 0; int verify_sensitive = 0;
Fingerprint *f = gtk_clist_get_row_data(GTK_CLIST(ui_layout.keylist), Fingerprint *f = gtk_clist_get_row_data(GTK_CLIST(ui_layout.keylist),
row); row);
if (f && f->context->msgstate == OTRL_MSGSTATE_ENCRYPTED && ConnContext *context_iter;
f->context->active_fingerprint == f) {
disconnect_sensitive = 1;
}
if (f && f->context->msgstate == OTRL_MSGSTATE_FINISHED) {
disconnect_sensitive = 1;
}
if (f && (f->context->msgstate != OTRL_MSGSTATE_ENCRYPTED ||
f->context->active_fingerprint != f)) {
forget_sensitive = 1;
}
if (f && f->context->msgstate == OTRL_MSGSTATE_PLAINTEXT) {
connect_sensitive = 1;
}
if (f && f->context->msgstate == OTRL_MSGSTATE_FINISHED) {
connect_sensitive = 1;
}
if (f) { if (f) {
verify_sensitive = 1; verify_sensitive = 1;
forget_sensitive = 1;
if (f->context && f->context->m_context) {
for (context_iter = f->context;
context_iter && context_iter->m_context ==
f->context->m_context;
context_iter = context_iter->next) {
if (context_iter->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
context_iter->active_fingerprint == f) {
disconnect_sensitive = 1;
forget_sensitive = 0;
}
else if (context_iter->msgstate == OTRL_MSGSTATE_FINISHED) {
connect_sensitive = 1;
}
else if (context_iter->msgstate == OTRL_MSGSTATE_PLAINTEXT) {
connect_sensitive = 1;
}
}
}
} }
gtk_widget_set_sensitive(ui_layout.connect_button, gtk_widget_set_sensitive(ui_layout.connect_button,
connect_sensitive); connect_sensitive);
gtk_widget_set_sensitive(ui_layout.disconnect_button, gtk_widget_set_sensitive(ui_layout.disconnect_button,
...@@ -280,23 +317,44 @@ static void clist_unselected(GtkWidget *widget, gint row, gint column, ...@@ -280,23 +317,44 @@ static void clist_unselected(GtkWidget *widget, gint row, gint column,
static int fngsortval(Fingerprint *f) static int fngsortval(Fingerprint *f)
{ {
int is_active = (f->context->msgstate == OTRL_MSGSTATE_ENCRYPTED && int result = 200;
f->context->active_fingerprint == f); ConnContext *context_iter;
TrustLevel level = otrg_plugin_context_to_trust(f->context);
for (context_iter = f->context->m_context;
switch(level) { context_iter && context_iter->m_context == f->context->m_context;
case TRUST_PRIVATE: context_iter = context_iter->next) {
return is_active ? 0 : 100;
case TRUST_UNVERIFIED: int is_active = 0;
return is_active ? 1 : 100; TrustLevel level;
case TRUST_FINISHED:
return 2; if (context_iter->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
case TRUST_NOT_PRIVATE: context_iter->active_fingerprint == f) {
return 3; is_active = 1;
}
level = otrg_plugin_context_to_trust(context_iter);
if (level == TRUST_PRIVATE) {
if (is_active) {
result = 0;
break;
} else {
result = result > 100 ? 100 : result;
}
} else if (level == TRUST_UNVERIFIED) {
if (is_active) {
result = 1;
} else {
result = result > 100 ? 100 : result;
}
} else if (level == TRUST_FINISHED) {
result = result > 2 ? 2 : result;
} else if (level == TRUST_NOT_PRIVATE) {
result = result > 3 ? 3 : result;
}
} }
/* Shouldn't get here, but anyway. */ return result;
return 200;
} }
static gint statuscmp(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2) static gint statuscmp(GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
...@@ -345,20 +403,25 @@ static void disconnect_connection(GtkWidget *widget, gpointer data) ...@@ -345,20 +403,25 @@ static void disconnect_connection(GtkWidget *widget, gpointer data)
{ {
/* Forget whatever state we've got with this context */ /* Forget whatever state we've got with this context */
ConnContext *context; ConnContext *context;
ConnContext *context_iter;
if (ui_layout.selected_fprint == NULL) return; if (ui_layout.selected_fprint == NULL) return;
context = ui_layout.selected_fprint->context; context = ui_layout.selected_fprint->context;
if (context == NULL) return; if (context == NULL) return;
/* Don't do anything with fingerprints other than the active one for (context_iter = context->m_context;
* if we're in the ENCRYPTED state */ context_iter && context_iter->m_context == context->m_context;
if (context->msgstate == OTRL_MSGSTATE_ENCRYPTED && context_iter = context_iter->next) {
context->active_fingerprint != ui_layout.selected_fprint) {
return; /* Don't do anything with fingerprints other than the active one
* if we're in the ENCRYPTED state */
if (context_iter->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
context_iter->active_fingerprint == ui_layout.selected_fprint) {
otrg_ui_disconnect_connection(context_iter);
}
} }
otrg_ui_disconnect_connection(context);
} }
static void forget_fingerprint(GtkWidget *widget, gpointer data) static void forget_fingerprint(GtkWidget *widget, gpointer data)
...@@ -383,7 +446,7 @@ static void otrsettings_clicked_cb(GtkButton *button, ...@@ -383,7 +446,7 @@ static void otrsettings_clicked_cb(GtkButton *button,
GTK_TOGGLE_BUTTON(os->enablebox))) { GTK_TOGGLE_BUTTON(os->enablebox))) {
gtk_widget_set_sensitive(os->automaticbox, TRUE); gtk_widget_set_sensitive(os->automaticbox, TRUE);
if (gtk_toggle_button_get_active( if (gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(os->automaticbox))) { GTK_TOGGLE_BUTTON(os->automaticbox))) {
gtk_widget_set_sensitive(os->onlyprivatebox, TRUE); gtk_widget_set_sensitive(os->onlyprivatebox, TRUE);
} else { } else {
gtk_widget_set_sensitive(os->onlyprivatebox, FALSE); gtk_widget_set_sensitive(os->onlyprivatebox, FALSE);
...@@ -431,13 +494,13 @@ static void create_otrsettings_buttons(struct otrsettingsdata *os, ...@@ -431,13 +494,13 @@ static void create_otrsettings_buttons(struct otrsettingsdata *os,
gtk_box_pack_start(GTK_BOX(vbox), os->avoidloggingotrbox, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(vbox), os->avoidloggingotrbox, FALSE, FALSE, 5);
g_signal_connect(G_OBJECT(os->enablebox), "clicked", g_signal_connect(G_OBJECT(os->enablebox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os); G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->automaticbox), "clicked", g_signal_connect(G_OBJECT(os->automaticbox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os); G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->onlyprivatebox), "clicked", g_signal_connect(G_OBJECT(os->onlyprivatebox), "clicked",
G_CALLBACK(otrsettings_clicked_cb), os); G_CALLBACK(otrsettings_clicked_cb), os);
g_signal_connect(G_OBJECT(os->avoidloggingotrbox), "clicked",