Commit 7be342a6 authored by cypherpunk's avatar cypherpunk
Browse files

	* otr-plugin.c:
	* dialogs.h:
	* dialogs.c:
	* gtk-dialog.c: Add a force_create parameter to
	display_otr_message.
parent cb7519ba
2008-08-07
* otr-plugin.c:
* dialogs.h:
* dialogs.c:
* gtk-dialog.c: Add a force_create parameter to
display_otr_message.
2008-07-10 2008-07-10
* otr-plugin.c: Use /dev/urandom to generate keys instead of * otr-plugin.c: Use /dev/urandom to generate keys instead of
......
...@@ -104,9 +104,11 @@ void otrg_dialog_notify_info(const char *accountname, const char *protocol, ...@@ -104,9 +104,11 @@ void otrg_dialog_notify_info(const char *accountname, const char *protocol,
* username conversation. Return 0 on success, non-0 on error (in which * username conversation. Return 0 on success, non-0 on error (in which
* case the message will be displayed inline as a received message). */ * case the message will be displayed inline as a received message). */
int otrg_dialog_display_otr_message( const char *accountname, int otrg_dialog_display_otr_message( const char *accountname,
const char *protocol, const char *username, const char *msg) const char *protocol, const char *username, const char *msg,
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);
} }
/* Put up a Please Wait dialog. This dialog can not be cancelled. /* Put up a Please Wait dialog. This dialog can not be cancelled.
......
...@@ -47,7 +47,7 @@ typedef struct { ...@@ -47,7 +47,7 @@ typedef struct {
const char *title, const char *primary, const char *secondary); const char *title, const char *primary, const char *secondary);
int (*display_otr_message)(const char *accountname, const char *protocol, int (*display_otr_message)(const char *accountname, const char *protocol,
const char *username, const char *msg); const char *username, const char *msg, int force_create);
OtrgDialogWaitHandle (*private_key_wait_start)(const char *account, OtrgDialogWaitHandle (*private_key_wait_start)(const char *account,
const char *protocol); const char *protocol);
...@@ -119,7 +119,8 @@ void otrg_dialog_notify_info(const char *accountname, const char *protocol, ...@@ -119,7 +119,8 @@ void otrg_dialog_notify_info(const char *accountname, const char *protocol,
* username conversation. Return 0 on success, non-0 on error (in which * username conversation. Return 0 on success, non-0 on error (in which
* case the message will be displayed inline as a received message). */ * case the message will be displayed inline as a received message). */
int otrg_dialog_display_otr_message( const char *accountname, int otrg_dialog_display_otr_message( const char *accountname,
const char *protocol, const char *username, const char *msg); const char *protocol, const char *username, const char *msg,
int 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.
* Return a handle that must eventually be passed to * Return a handle that must eventually be passed to
......
...@@ -1017,16 +1017,14 @@ static OtrgDialogWaitHandle otrg_gtk_dialog_private_key_wait_start( ...@@ -1017,16 +1017,14 @@ static OtrgDialogWaitHandle otrg_gtk_dialog_private_key_wait_start(
} }
static int otrg_gtk_dialog_display_otr_message(const char *accountname, static int otrg_gtk_dialog_display_otr_message(const char *accountname,
const char *protocol, const char *username, const char *msg) const char *protocol, const char *username, const char *msg,
int force_create)
{ {
/* See if there's a conversation window we can put this in. */ /* See if there's a conversation window we can put this in. */
PurpleAccount *account;
PurpleConversation *conv; PurpleConversation *conv;
account = purple_accounts_find(accountname, protocol); conv = otrg_plugin_userinfo_to_conv(accountname, protocol, username,
if (!account) return -1; force_create);
conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, username, account);
if (!conv) return -1; if (!conv) return -1;
purple_conversation_write(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); purple_conversation_write(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL));
......
...@@ -254,7 +254,7 @@ static int display_otr_message_cb(void *opdata, const char *accountname, ...@@ -254,7 +254,7 @@ static int display_otr_message_cb(void *opdata, const char *accountname,
const char *protocol, const char *username, const char *msg) const char *protocol, const char *username, const char *msg)
{ {
return otrg_dialog_display_otr_message(accountname, protocol, return otrg_dialog_display_otr_message(accountname, protocol,
username, msg); username, msg, 0);
} }
static void update_context_list_cb(void *opdata) static void update_context_list_cb(void *opdata)
......
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