Commit 89e49d9b authored by cypherpunk's avatar cypherpunk
Browse files

	* README:
	* Makefile.mingw:
	* packaging/fedora/gaim-otr.spec:
	* packaging/windows/gaim-otr.nsi:
	* configure.ac: Change version to 3.0.0

	* Makefile.mingw: add -lgtk_pixbuf-2.0-0 for the OTR button
	pixmaps.

	* configure.ac: Require libotr 3.x.

	* dialogs.h:
	* dialogs.c (otrg_dialog_unknown_fingerprint): This function now
	merely informs the user that a new fingerprint has been
	received, and doesn't require the user to confirm it before it
	can be used.

	* dialogs.h:
	* dialogs.c (otrg_dialog_verify_fingerprint): New function to
	allow the user to confirm the authenticity of a fingerprint.

	* dialogs.h: Add #defines for the online help URLs.

	* gtk-dialog.c: There are now three states a conversation can be
	in: Not Private (not using OTR), Unverified (using OTR, but to a
	fingerprint that hasn't been verified, so you are subject to a
	straightforward active attack), and Private (using OTR with a
	verified fingerprint).  There are new icons for these states
	that appear in the OTR button.

	* gtk-dialog.c: Callers of create_dialog can now specify
	additional widgets to appear in the dialog boxes.  We use this
	primarily for the "What's this?" help widgets.

	* gtk-dialog.c (otrg_gtk_dialog_unknown_fingerprint): This
	function no longer has to deal with callbacks to get the user's
	response to the new fingerprint.

	* gtk-dialog.c: Right-clicking the OTR button now produces an
	OTR menu, with options to start or end the private conversation,
	verify the fingerprint, view the secure session id, or get help.

	* gtk-dialog.c (dialog_update_label_conv): Have the OTR button
	obey the user's requested style (text only, pictures only,
	pictures and text, none).  Note that if the user chooses "none",
	there's currently no way to reach the aforementioned menu.

	* gtk-dialog.c: The "private connection established", "private
	connection refreshed", and "private connection ended" messages
	no longer pop up dialog boxes.  Instead, they appear inline in
	the conversation window.  The session id and fingerprint which
	used to appear in the "private connection established" dialog
	are now viewable via the OTR button right-click menu.

	* gtk-dialog.c: New dialog to view and verify fingerprints.

	* gtk-dialog.c: New dialog to view secure session id.

	* gtk-ui.c: New "Verify fingerprint" button in the plugin UI,
	and rearrangement of the (now four) buttons into a 2x2 table.

	* gtk-ui.c: New "Verified" column in the Known Fingerprints
	table.

	* otr-plugin.c (confirm_fingerprint_cb): This function no longer
	has to deal with callbacks due to the change in the libotr API.

	* otr-plugin.h:
	* otr-plugin.c (otrg_plugin_write_fingerprints): Refactored this
	function so that other parts of the code can call it.

	* otr-plugin.h:
	* otr-plugin.c (otrg_plugin_conv_to_context)
	(otrg_plugin_context_to_conv, otrg_plugin_context_to_trust): New
	functions.
parent 15b2c30a
2005-06-24
* README:
* Makefile.mingw:
* packaging/fedora/gaim-otr.spec:
* packaging/windows/gaim-otr.nsi:
* configure.ac: Change version to 3.0.0
* Makefile.mingw: add -lgtk_pixbuf-2.0-0 for the OTR button
pixmaps.
* configure.ac: Require libotr 3.x.
* dialogs.h:
* dialogs.c (otrg_dialog_unknown_fingerprint): This function now
merely informs the user that a new fingerprint has been
received, and doesn't require the user to confirm it before it
can be used.
* dialogs.h:
* dialogs.c (otrg_dialog_verify_fingerprint): New function to
allow the user to confirm the authenticity of a fingerprint.
* dialogs.h: Add #defines for the online help URLs.
* gtk-dialog.c: There are now three states a conversation can be
in: Not Private (not using OTR), Unverified (using OTR, but to a
fingerprint that hasn't been verified, so you are subject to a
straightforward active attack), and Private (using OTR with a
verified fingerprint). There are new icons for these states
that appear in the OTR button.
* gtk-dialog.c: Callers of create_dialog can now specify
additional widgets to appear in the dialog boxes. We use this
primarily for the "What's this?" help widgets.
* gtk-dialog.c (otrg_gtk_dialog_unknown_fingerprint): This
function no longer has to deal with callbacks to get the user's
response to the new fingerprint.
* gtk-dialog.c: Right-clicking the OTR button now produces an
OTR menu, with options to start or end the private conversation,
verify the fingerprint, view the secure session id, or get help.
* gtk-dialog.c (dialog_update_label_conv): Have the OTR button
obey the user's requested style (text only, pictures only,
pictures and text, none). Note that if the user chooses "none",
there's currently no way to reach the aforementioned menu.
* gtk-dialog.c: The "private connection established", "private
connection refreshed", and "private connection ended" messages
no longer pop up dialog boxes. Instead, they appear inline in
the conversation window. The session id and fingerprint which
used to appear in the "private connection established" dialog
are now viewable via the OTR button right-click menu.
* gtk-dialog.c: New dialog to view and verify fingerprints.
* gtk-dialog.c: New dialog to view secure session id.
* gtk-ui.c: New "Verify fingerprint" button in the plugin UI,
and rearrangement of the (now four) buttons into a 2x2 table.
* gtk-ui.c: New "Verified" column in the Known Fingerprints
table.
* otr-plugin.c (confirm_fingerprint_cb): This function no longer
has to deal with callbacks due to the change in the libotr API.
* otr-plugin.h:
* otr-plugin.c (otrg_plugin_write_fingerprints): Refactored this
function so that other parts of the code can call it.
* otr-plugin.h:
* otr-plugin.c (otrg_plugin_conv_to_context)
(otrg_plugin_context_to_conv, otrg_plugin_context_to_trust): New
functions.
2005-05-27
* otr-plugin.c:
......
WIN32=1
# The version number to put in the plugin info
GAIM_OTR_VERSION = 2.0.2
GAIM_OTR_VERSION = 3.0.0
# Replace this with the path to the GAIM headers
GAIM_SOURCE ?= /usr/include/gaim
......@@ -27,8 +27,8 @@ LIBOTRLIBDIR = /usr/i586-mingw32msvc/lib
TARGET = gaim-otr.dll
LDFLAGS = -Wl,--enable-auto-image-base
LDLIBS = $(LIBOTRLIBDIR)/libotr.a -lgtk-win32-2.0-0 -latk-1.0-0 -lpango-1.0-0 \
-lglib-2.0-0 -lgdk-win32-2.0-0 -lgobject-2.0-0 -lgaim \
-lgcrypt -lgpg-error
-lglib-2.0-0 -lgdk_pixbuf-2.0-0 -lgdk-win32-2.0-0 -lgobject-2.0-0 \
-lgaim -lgcrypt -lgpg-error
else
FPIC = -fPIC
LDFLAGS = -module -avoid-version
......
24 Jun 2005:
- There are now three states a conversation can be in:
* Not Private (not using OTR)
* Unverified (using OTR, but to a fingerprint that hasn't
been verified, so you are subject to a straightforward
active attack)
* Private (using OTR with a verified fingerprint)
- There are new icons for these states that appear in the OTR button.
- Right-clicking the OTR button now produces an OTR menu, with options
to start or end the private conversation, verify the fingerprint, view
the secure session id, or get help.
- The OTR button obeys the user's requested style (text only, pictures
only, pictures and text, none). Note that if the user chooses "none",
there's currently no way to reach the aforementioned menu.
- The "private connection established", "private connection refreshed",
and "private connection ended" messages no longer pop up dialog boxes.
Instead, they appear inline in the conversation window. The session
id and fingerprint which used to appear in the "private connection
established" dialog are now viewable via the OTR button right-click
menu.
27 May 2005:
- The OTR button no longer disappears if you change your button style in
the gaim preferences.
......
......@@ -7,7 +7,7 @@ AC_INIT(otr-plugin.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gaim-otr, 2.0.2)
AM_INIT_AUTOMAKE(gaim-otr, 3.0.0)
AC_PROG_CC
......@@ -17,7 +17,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(2.0.2,,AC_MSG_ERROR(libotr 2.0.2 or newer is required.))
AM_PATH_LIBOTR(3.0.0,,AC_MSG_ERROR(libotr 3.0.0 or newer is required.))
PKG_CHECK_MODULES(EXTRA, glib-2.0 >= 2.4 gtk+-2.0 >= 2.4 gaim >= 1.0, , AC_MSG_ERROR(glib, gtk and gaim required))
......
......@@ -112,20 +112,17 @@ void otrg_dialog_private_key_wait_done(OtrgDialogWaitHandle handle)
}
/* Show a dialog informing the user that a correspondent (who) has sent
* us a Key Exchange Message (kem) that contains an unknown fingerprint.
* Ask the user whether to accept the fingerprint or not. If yes, call
* response_cb(us, ops, opdata, response_data, resp) with resp = 1. If no,
* set resp = 0. If the user destroys the dialog without answering, set
* resp = -1. */
* us a Key Exchange Message (kem) that contains an unknown fingerprint. */
void otrg_dialog_unknown_fingerprint(OtrlUserState us, const char *accountname,
const char *protocol, const char *who, OTRKeyExchangeMsg kem,
void (*response_cb)(OtrlUserState us, OtrlMessageAppOps *ops,
void *opdata, OTRConfirmResponse *response_data, int resp),
OtrlMessageAppOps *ops, void *opdata,
OTRConfirmResponse *response_data)
{
ui_ops->unknown_fingerprint(us, accountname, protocol, who, kem,
response_cb, ops, opdata, response_data);
const char *protocol, const char *who, OTRKeyExchangeMsg kem)
{
ui_ops->unknown_fingerprint(us, accountname, protocol, who, kem);
}
/* Show a dialog asking the user to verify the given fingerprint. */
void otrg_dialog_verify_fingerprint(Fingerprint *fprint)
{
ui_ops->verify_fingerprint(fprint);
}
/* Call this when a context transitions from (a state other than
......
......@@ -27,6 +27,13 @@
#include <libotr/proto.h>
#include <libotr/message.h>
/* The various help URLs */
#define BASE_HELPURL "http://otr-help.cypherpunks.ca/"
#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"
typedef struct s_OtrgDialogWait *OtrgDialogWaitHandle;
typedef struct {
......@@ -43,11 +50,9 @@ typedef struct {
void (*private_key_wait_done)(OtrgDialogWaitHandle handle);
void (*unknown_fingerprint)(OtrlUserState us, const char *accountname,
const char *protocol, const char *who, OTRKeyExchangeMsg kem,
void (*response_cb)(OtrlUserState us, OtrlMessageAppOps *ops,
void *opdata, OTRConfirmResponse *response_data, int resp),
OtrlMessageAppOps *ops, void *opdata,
OTRConfirmResponse *response_data);
const char *protocol, const char *who, OTRKeyExchangeMsg kem);
void (*verify_fingerprint)(Fingerprint *fprint);
void (*connected)(ConnContext *context);
......@@ -106,17 +111,12 @@ OtrgDialogWaitHandle otrg_dialog_private_key_wait_start(const char *account,
void otrg_dialog_private_key_wait_done(OtrgDialogWaitHandle handle);
/* Show a dialog informing the user that a correspondent (who) has sent
* us a Key Exchange Message (kem) that contains an unknown fingerprint.
* Ask the user whether to accept the fingerprint or not. If yes, call
* response_cb(us, ops, opdata, response_data, resp) with resp = 1. If no,
* set resp = 0. If the user destroys the dialog without answering, set
* resp = -1. */
* us a Key Exchange Message (kem) that contains an unknown fingerprint. */
void otrg_dialog_unknown_fingerprint(OtrlUserState us, const char *accountname,
const char *protocol, const char *who, OTRKeyExchangeMsg kem,
void (*response_cb)(OtrlUserState us, OtrlMessageAppOps *ops,
void *opdata, OTRConfirmResponse *response_data, int resp),
OtrlMessageAppOps *ops, void *opdata,
OTRConfirmResponse *response_data);
const char *protocol, const char *who, OTRKeyExchangeMsg kem);
/* Show a dialog asking the user to verify the given fingerprint. */
void otrg_dialog_verify_fingerprint(Fingerprint *fprint);
/* Call this when a context transitions from (a state other than
* CONN_CONNECTED) to CONN_CONNECTED. */
......
This diff is collapsed.
......@@ -54,6 +54,7 @@ static struct {
GtkWidget *connect_button;
GtkWidget *disconnect_button;
GtkWidget *forget_button;
GtkWidget *verify_button;
struct otroptionsdata oo;
} ui_layout;
......@@ -97,6 +98,8 @@ static GtkWidget *accountmenu_get_selected_item(void)
{
GtkWidget *menu;
if (ui_layout.accountmenu == NULL) return NULL;
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(ui_layout.accountmenu));
return gtk_menu_get_active(GTK_MENU(menu));
}
......@@ -117,6 +120,8 @@ static void otrg_gtk_ui_update_fingerprint(void)
item = accountmenu_get_selected_item();
if (!item) return;
account = item_get_account(item);
user_data = g_object_get_data(G_OBJECT(ui_layout.accountmenu),
"user_data");
......@@ -134,13 +139,14 @@ static void clist_all_unselected(void)
gtk_widget_set_sensitive(ui_layout.connect_button, 0);
gtk_widget_set_sensitive(ui_layout.disconnect_button, 0);
gtk_widget_set_sensitive(ui_layout.forget_button, 0);
gtk_widget_set_sensitive(ui_layout.verify_button, 0);
ui_layout.selected_fprint = NULL;
}
/* Update the keylist, if it's visible */
static void otrg_gtk_ui_update_keylist(void)
{
gchar *titles[4];
gchar *titles[5];
char hash[45];
ConnContext * context;
Fingerprint * fingerprint;
......@@ -171,14 +177,16 @@ static void otrg_gtk_ui_update_keylist(void)
titles[1] =
(gchar *) otrl_context_statestr[context->state];
}
titles[2] = (fingerprint->trust && fingerprint->trust[0]) ?
"Yes" : "No";
otrl_privkey_hash_to_human(hash, fingerprint->fingerprint);
titles[2] = hash;
titles[3] = hash;
p = gaim_find_prpl(context->protocol);
proto_name = (p && p->info->name) ? p->info->name : "Unknown";
titles[3] = g_strdup_printf("%s (%s)", context->accountname,
titles[4] = g_strdup_printf("%s (%s)", context->accountname,
proto_name);
i = gtk_clist_append(GTK_CLIST(keylist), titles);
g_free(titles[3]);
g_free(titles[4]);
gtk_clist_set_row_data(GTK_CLIST(keylist), i, fingerprint);
if (ui_layout.selected_fprint == fingerprint) {
selected_row = i;
......@@ -223,6 +231,7 @@ static void ui_destroyed(GtkObject *object)
ui_layout.connect_button = NULL;
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;
......@@ -234,6 +243,7 @@ static void clist_selected(GtkWidget *widget, gint row, gint column,
int connect_sensitive = 0;
int disconnect_sensitive = 0;
int forget_sensitive = 0;
int verify_sensitive = 0;
Fingerprint *f = gtk_clist_get_row_data(GTK_CLIST(ui_layout.keylist),
row);
if (f && f->context->state == CONN_CONNECTED &&
......@@ -253,11 +263,15 @@ static void clist_selected(GtkWidget *widget, gint row, gint column,
if (f && f->context->state == CONN_UNCONNECTED) {
connect_sensitive = 1;
}
if (f) {
verify_sensitive = 1;
}
gtk_widget_set_sensitive(ui_layout.connect_button,
connect_sensitive);
gtk_widget_set_sensitive(ui_layout.disconnect_button,
disconnect_sensitive);
gtk_widget_set_sensitive(ui_layout.forget_button, forget_sensitive);
gtk_widget_set_sensitive(ui_layout.verify_button, verify_sensitive);
ui_layout.selected_fprint = f;
}
......@@ -350,6 +364,13 @@ static void forget_fingerprint(GtkWidget *widget, gpointer data)
otrg_ui_forget_fingerprint(fingerprint);
}
static void verify_fingerprint(GtkWidget *widget, gpointer data)
{
Fingerprint *fingerprint = ui_layout.selected_fprint;
otrg_dialog_verify_fingerprint(fingerprint);
}
static void otroptions_clicked_cb(GtkButton *button, struct otroptionsdata *oo)
{
gtk_widget_set_sensitive(oo->enablebox, TRUE);
......@@ -576,18 +597,21 @@ static void make_options_ui(GtkWidget *vbox)
static void make_fingerprints_ui(GtkWidget *vbox)
{
GtkWidget *hbox;
GtkWidget *table;
GtkWidget *label;
char *titles[4] = { "Screenname", "Status", "Fingerprint", "Account" };
char *titles[5] = { "Screenname", "Status", "Verified",
"Fingerprint", "Account" };
ui_layout.scrollwin = gtk_scrolled_window_new(0, 0);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ui_layout.scrollwin),
GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
ui_layout.keylist = gtk_clist_new_with_titles(4, titles);
ui_layout.keylist = gtk_clist_new_with_titles(5, titles);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 0, 90);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 1, 90);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 2, 400);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 3, 200);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 2, 60);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 3, 400);
gtk_clist_set_column_width(GTK_CLIST(ui_layout.keylist), 4, 200);
gtk_clist_set_selection_mode(GTK_CLIST(ui_layout.keylist),
GTK_SELECTION_SINGLE);
gtk_clist_column_titles_active(GTK_CLIST(ui_layout.keylist));
......@@ -601,6 +625,12 @@ static void make_fingerprints_ui(GtkWidget *vbox)
hbox = gtk_hbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5);
table = gtk_table_new(2, 2, TRUE);
gtk_table_set_row_spacings(GTK_TABLE(table), 5);
gtk_table_set_col_spacings(GTK_TABLE(table), 20);
gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
ui_layout.connect_button = gtk_button_new();
......@@ -608,30 +638,32 @@ static void make_fingerprints_ui(GtkWidget *vbox)
GTK_SIGNAL_FUNC(connect_connection), NULL);
label = gtk_label_new("Start private connection");
gtk_container_add(GTK_CONTAINER(ui_layout.connect_button), label);
gtk_box_pack_start(GTK_BOX(hbox), ui_layout.connect_button,
FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
gtk_table_attach_defaults(GTK_TABLE(table), ui_layout.connect_button,
0, 1, 0, 1);
ui_layout.disconnect_button = gtk_button_new();
gtk_signal_connect(GTK_OBJECT(ui_layout.disconnect_button), "clicked",
GTK_SIGNAL_FUNC(disconnect_connection), NULL);
label = gtk_label_new("End private connection");
gtk_container_add(GTK_CONTAINER(ui_layout.disconnect_button), label);
gtk_box_pack_start(GTK_BOX(hbox), ui_layout.disconnect_button,
FALSE, FALSE, 0);
gtk_table_attach_defaults(GTK_TABLE(table), ui_layout.disconnect_button,
0, 1, 1, 2);
gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
ui_layout.verify_button = gtk_button_new();
gtk_signal_connect(GTK_OBJECT(ui_layout.verify_button), "clicked",
GTK_SIGNAL_FUNC(verify_fingerprint), NULL);
label = gtk_label_new("Verify fingerprint");
gtk_container_add(GTK_CONTAINER(ui_layout.verify_button), label);
gtk_table_attach_defaults(GTK_TABLE(table), ui_layout.verify_button,
1, 2, 0, 1);
ui_layout.forget_button = gtk_button_new();
gtk_signal_connect(GTK_OBJECT(ui_layout.forget_button), "clicked",
GTK_SIGNAL_FUNC(forget_fingerprint), NULL);
label = gtk_label_new("Forget fingerprint");
gtk_container_add(GTK_CONTAINER(ui_layout.forget_button), label);
gtk_box_pack_start(GTK_BOX(hbox), ui_layout.forget_button,
FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
gtk_table_attach_defaults(GTK_TABLE(table), ui_layout.forget_button,
1, 2, 1, 2);
gtk_signal_connect(GTK_OBJECT(vbox), "destroy",
GTK_SIGNAL_FUNC(ui_destroyed), NULL);
......@@ -648,10 +680,7 @@ static void make_fingerprints_ui(GtkWidget *vbox)
ui_layout.sortcol = 0;
ui_layout.sortdir = 1;
gtk_widget_set_sensitive(ui_layout.connect_button, 0);
gtk_widget_set_sensitive(ui_layout.disconnect_button, 0);
gtk_widget_set_sensitive(ui_layout.forget_button, 0);
ui_layout.selected_fprint = NULL;
clist_all_unselected();
}
/* Construct the OTR UI widget */
......
......@@ -208,19 +208,16 @@ static void update_context_list_cb(void *opdata)
otrg_ui_update_keylist();
}
/* Forward declaration because we need to use &ui_ops in this function */
static void confirm_fingerprint_cb(OtrlUserState us, void *opdata,
const char *accountname, const char *protocol, const char *username,
OTRKeyExchangeMsg kem,
void (*response_cb)(OtrlUserState us, OtrlMessageAppOps *ops,
void *opdata, OTRConfirmResponse *response_data, int resp),
OTRConfirmResponse *response_data);
OTRKeyExchangeMsg kem)
{
otrg_dialog_unknown_fingerprint(us, accountname, protocol, username, kem);
}
static void write_fingerprints_cb(void *opdata)
{
gchar *storefile = g_build_filename(gaim_user_dir(), STOREFNAME, NULL);
otrl_privkey_write_fingerprints(otrg_plugin_userstate, storefile);
g_free(storefile);
otrg_plugin_write_fingerprints();
}
static void gone_secure_cb(void *opdata, ConnContext *context)
......@@ -263,17 +260,6 @@ static OtrlMessageAppOps ui_ops = {
log_message_cb
};
static void confirm_fingerprint_cb(OtrlUserState us, void *opdata,
const char *accountname, const char *protocol, const char *username,
OTRKeyExchangeMsg kem,
void (*response_cb)(OtrlUserState us, OtrlMessageAppOps *ops,
void *opdata, OTRConfirmResponse *response_data, int resp),
OTRConfirmResponse *response_data)
{
otrg_dialog_unknown_fingerprint(us, accountname, protocol, username, kem,
response_cb, &ui_ops, opdata, response_data);
}
static void process_sending_im(GaimAccount *account, char *who, char **message,
void *m)
{
......@@ -458,6 +444,71 @@ void otrg_plugin_disconnect(ConnContext *context)
context->accountname, context->protocol, context->username);
}
/* Write the fingerprints to disk. */
void otrg_plugin_write_fingerprints(void)
{
gchar *storefile = g_build_filename(gaim_user_dir(), STOREFNAME, NULL);
otrl_privkey_write_fingerprints(otrg_plugin_userstate, storefile);
g_free(storefile);
}
/* Find the ConnContext appropriate to a given GaimConversation. */
ConnContext *otrg_plugin_conv_to_context(GaimConversation *conv)
{
GaimAccount *account;
char *username;
const char *accountname, *proto;
ConnContext *context;
account = gaim_conversation_get_account(conv);
accountname = gaim_account_get_username(account);
proto = gaim_account_get_protocol_id(account);
username = g_strdup(
gaim_normalize(account, gaim_conversation_get_name(conv)));
context = otrl_context_find(otrg_plugin_userstate, username, accountname,
proto, 0, NULL, NULL, NULL);
g_free(username);
return context;
}
/* Find the GaimConversation appropriate to the given ConnContext. If
* one doesn't yet exist, create it if force_create is true. */
GaimConversation *otrg_plugin_context_to_conv(ConnContext *context,
int force_create)
{
GaimAccount *account;
GaimConversation *conv;
account = gaim_accounts_find(context->accountname, context->protocol);
if (account == NULL) return NULL;
conv = gaim_find_conversation_with_account(context->username, account);
if (conv == NULL && force_create) {
conv = gaim_conversation_new(GAIM_CONV_IM, account, context->username);
}
return conv;
}
/* What level of trust do we have in the privacy of this ConnContext? */
TrustLevel otrg_plugin_context_to_trust(ConnContext *context)
{
TrustLevel level = TRUST_NOT_PRIVATE;
if (context && context->state == CONN_CONNECTED) {
if (context->active_fingerprint->trust &&
context->active_fingerprint->trust[0] != '\0') {
level = TRUST_PRIVATE;
} else {
level = TRUST_UNVERIFIED;
}
}
return level;
}
static guint button_type_cbid;
static gboolean otr_plugin_load(GaimPlugin *handle)
......
......@@ -58,6 +58,26 @@ void otrg_plugin_send_default_query_conv(GaimConversation *conv);
* appropriate. */
void otrg_plugin_disconnect(ConnContext *context);
/* Write the fingerprints to disk. */
void otrg_plugin_write_fingerprints(void);
/* Find the ConnContext appropriate to a given GaimConversation. */
ConnContext *otrg_plugin_conv_to_context(GaimConversation *conv);
/* Find the GaimConversation appropriate to the given ConnContext. If
* one doesn't yet exist, create it if force_create is true. */
GaimConversation *otrg_plugin_context_to_conv(ConnContext *context,
int force_create);
typedef enum {
TRUST_NOT_PRIVATE,
TRUST_UNVERIFIED,
TRUST_PRIVATE
} TrustLevel;
/* What level of trust do we have in the privacy of this ConnContext? */
TrustLevel otrg_plugin_context_to_trust(ConnContext *context);
/* Return 1 if the given protocol supports OTR, 0 otherwise. */
int otrg_plugin_proto_supports_otr(const char *proto);
......
Summary: Off-The-Record Messaging plugin for GAIM
Name: gaim-otr
Version: 2.0.2
Release: 2%{?dist}
Version: 3.0.0
Release: 1%{?dist}
Source: http://www.cypherpunks.ca/otr/%{name}-%{version}.tar.gz
Url: http://www.cypherpunks.ca/otr/
License: GPL
......
......@@ -3,6 +3,7 @@
;
; known issue. installer induced uninstaller abortion causes overwrite by installer without
; uninstall.
; v3.0.0 - Bump version number.
; v2.0.2 - Bump version number.
; v2.0.1 - Bump version number.
; v2.0.0-2 - linking to libotr-2.0.1
......@@ -21,7 +22,7 @@
; todo: SetBrandingImage
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "gaim-otr"
!define PRODUCT_VERSION "2.0.2"
!define PRODUCT_VERSION "3.0.0"
!define PRODUCT_PUBLISHER "Cypherpunks CA"
!define PRODUCT_WEB_SITE "http://www.cypherpunks.ca/otr/"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
......
......@@ -103,7 +103,6 @@ void otrg_ui_disconnect_connection(ConnContext *context)
void otrg_ui_forget_fingerprint(Fingerprint *fingerprint)
{
ConnContext *context;
gchar *storefile;
if (fingerprint == NULL) return;
......@@ -114,9 +113,7 @@ void otrg_ui_forget_fingerprint(Fingerprint *fingerprint)
context->active_fingerprint == fingerprint) return;
otrl_context_forget_fingerprint(fingerprint, 1);
storefile = g_build_filename(gaim_user_dir(), STOREFNAME, NULL);
otrl_privkey_write_fingerprints(otrg_plugin_userstate, storefile);
g_free(storefile);
otrg_plugin_write_fingerprints();
otrg_ui_update_keylist();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment