[pkg-otr-team] [irssi-plugin-otr] 72/167: * otr-plugin.c: * dialogs.h: * dialogs.c: * gtk-dialog.c: Add a force_create parameter to display_otr_message.

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


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

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

commit 7be342a6c6edba43768e02364dace9a8f6fb62db
Author: cypherpunk <cypherpunk>
Date:   Wed Aug 6 14:59:58 2008 +0000

    	* otr-plugin.c:
    	* dialogs.h:
    	* dialogs.c:
    	* gtk-dialog.c: Add a force_create parameter to
    	display_otr_message.
---
 ChangeLog    |  8 ++++++++
 dialogs.c    |  6 ++++--
 dialogs.h    |  5 +++--
 gtk-dialog.c | 10 ++++------
 otr-plugin.c |  2 +-
 5 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d2073bb..e916fc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
 
 	* otr-plugin.c: Use /dev/urandom to generate keys instead of
diff --git a/dialogs.c b/dialogs.c
index 3f568ef..9acf422 100644
--- a/dialogs.c
+++ b/dialogs.c
@@ -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
  * case the message will be displayed inline as a received message). */
 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.
diff --git a/dialogs.h b/dialogs.h
index a8de431..204adef 100644
--- a/dialogs.h
+++ b/dialogs.h
@@ -47,7 +47,7 @@ typedef struct {
 	const char *title, const char *primary, const char *secondary);
 
     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,
 	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
  * case the message will be displayed inline as a received message). */
 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.
  * Return a handle that must eventually be passed to
diff --git a/gtk-dialog.c b/gtk-dialog.c
index ab4b2da..60fdb8a 100644
--- a/gtk-dialog.c
+++ b/gtk-dialog.c
@@ -1017,16 +1017,14 @@ static OtrgDialogWaitHandle otrg_gtk_dialog_private_key_wait_start(
 }
 
 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. */
-    PurpleAccount *account;
     PurpleConversation *conv;
 
-    account = purple_accounts_find(accountname, protocol);
-    if (!account) return -1;
-
-    conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, username, account);
+    conv = otrg_plugin_userinfo_to_conv(accountname, protocol, username,
+		force_create);
     if (!conv) return -1;
 
     purple_conversation_write(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL));
diff --git a/otr-plugin.c b/otr-plugin.c
index 85ef5a5..4713516 100644
--- a/otr-plugin.c
+++ b/otr-plugin.c
@@ -254,7 +254,7 @@ static int display_otr_message_cb(void *opdata, const char *accountname,
 	const char *protocol, const char *username, const char *msg)
 {
     return otrg_dialog_display_otr_message(accountname, protocol,
-	    username, msg);
+	    username, msg, 0);
 }
 
 static void update_context_list_cb(void *opdata)

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