@@ -779,7 +780,11 @@
account = gaim_accounts_find(accountname, protocol);
if (!account) return -1;
+#if GAIM_MAJOR_VERSION < 2
conv = gaim_find_conversation_with_account(username, account);
+#else
+ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, username, account);
+#endif
if (!conv) return -1;
gaim_conversation_write(conv, NULL, msg, GAIM_MESSAGE_SYSTEM, time(NULL));
@@ -968,7 +973,11 @@
account = gaim_accounts_find(context->accountname, context->protocol);
if (!account) return;
+#if GAIM_MAJOR_VERSION < 2
conv = gaim_find_conversation_with_account(context->username, account);
+#else
+ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, context->username, account);
+#endif
if (!conv) return;
dialog_update_label_conv(conv, level);
}
@@ -1252,7 +1261,11 @@
account = gaim_accounts_find(accountname, protocol);
if (!account) return;
+#if GAIM_MAJOR_VERSION < 2
conv = gaim_find_conversation_with_account(username, account);
+#else
+ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, username, account);
+#endif
if (!conv) return;
buf = g_strdup_printf("%s has ended his private conversation with you; "
@@ -1406,9 +1419,13 @@
GtkWidget *whatsthis;
/* Do nothing if this isn't an IM conversation */
+#if GAIM_MAJOR_VERSION < 2
if (gaim_conversation_get_type(conv) != GAIM_CONV_IM) return;
-
bbox = gtkconv->bbox;
+#else
+ if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) return;
+ bbox = gtkconv->lower_hbox;
+#endif
context = otrg_plugin_conv_to_context(conv);
@@ -1515,7 +1532,11 @@
GtkWidget *button;
/* Do nothing if this isn't an IM conversation */
+#if GAIM_MAJOR_VERSION < 2
if (gaim_conversation_get_type(conv) != GAIM_CONV_IM) return;
+#else
+ if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) return;
+#endif
button = gaim_conversation_get_data(conv, "otr-button");
if (button) gtk_object_destroy(GTK_OBJECT(button));
@@ -1531,7 +1552,11 @@
OtrlPolicy policy;
/* Do nothing if this isn't an IM conversation */
+#if GAIM_MAJOR_VERSION < 2
if (gaim_conversation_get_type(conv) != GAIM_CONV_IM) return;
+#else
+ if (gaim_conversation_get_type(conv) != GAIM_CONV_TYPE_IM) return;
+#endif
account = gaim_conversation_get_account(conv);
name = gaim_conversation_get_name(conv);
diff -Naur gaim-otr-3.0.0/otr-plugin.c gaim-otr-3.0.0-gaim2/otr-plugin.c
--- gaim-otr-3.0.0/otr-plugin.c 2005-10-27 12:01:59.000000000 -0400
+++ gaim-otr-3.0.0-gaim2/otr-plugin.c 2005-11-15 21:08:51.000000000 -0500
@@ -32,11 +32,11 @@
/* gaim headers */
#include "gaim.h"
-#include "core.h"
#include "notify.h"
#include "version.h"
#include "util.h"
#include "debug.h"
+#include "core.h"
#ifdef USING_GTK
/* gaim GTK headers */
@@ -156,7 +156,11 @@
buddy = gaim_find_buddy(account, recipient);
if (!buddy) return -1;
+#if GAIM_MAJOR_VERSION < 2
return (buddy->present == GAIM_BUDDY_ONLINE);
+#else
+ return (GAIM_BUDDY_IS_ONLINE(buddy));
+#endif
}
static void inject_message_cb(void *opdata, const char *accountname,
@@ -430,7 +434,11 @@
proto = gaim_account_get_protocol_id(acct);
if (!otrg_plugin_proto_supports_otr(proto)) return;
+#if GAIM_MAJOR_VERSION < 2
act = gaim_blist_node_action_new("OTR Settings", otr_options_cb, NULL);
+#else
+ act = gaim_blist_node_action_new("OTR Settings", otr_options_cb, NULL, NULL);
+#endif
*menu = g_list_append(*menu, act);
}
@@ -482,9 +490,17 @@
account = gaim_accounts_find(context->accountname, context->protocol);
if (account == NULL) return NULL;
+#if GAIM_MAJOR_VERSION < 2
conv = gaim_find_conversation_with_account(context->username, account);
+#else
+ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, context->username, account);
+#endif
if (conv == NULL && force_create) {
+#if GAIM_MAJOR_VERSION < 2
conv = gaim_conversation_new(GAIM_CONV_IM, account, context->username);
+#else
+ conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, account, context->username);
+#endif
}
return conv;
@@ -567,9 +583,15 @@
GAIM_CALLBACK(process_connection_change), NULL);
gaim_signal_connect(blist_handle, "blist-node-extended-menu",
otrg_plugin_handle, GAIM_CALLBACK(supply_extended_menu), NULL);
+#if GAIM_MAJOR_VERSION < 2
button_type_cbid = gaim_prefs_connect_callback(
"/gaim/gtk/conversations/button_type",
process_button_type_change, NULL);
+#else
+ button_type_cbid = gaim_prefs_connect_callback(NULL,
+ "/gaim/gtk/conversations/button_type",
+ process_button_type_change, NULL);
+#endif
gaim_conversation_foreach(otrg_dialog_new_conv);
@@ -642,7 +664,12 @@
/* We stick with the functions in the gaim 1.0.x API for
* compatibility. */
- 1, /* major version */
+#if GAIM_MAJOR_VERSION < 2
+ 1, /* major version */
+#else
+ /* The 2.0.x API is causing no trouble - Dustin */
+ 2, /* major version */
+#endif
0, /* minor version */
GAIM_PLUGIN_STANDARD, /* type */
--G4iJoqBmSsgzjUCe--
From arodland@entermail.net Sat Nov 19 08:25:47 2005
From: arodland@entermail.net (Andrew Rodland)
Date: Sat, 19 Nov 2005 03:25:47 -0500
Subject: [OTR-dev] otr against gaim-cvs
In-Reply-To: <20051117134628.GN847@smtp.paip.net>
References: <200511170338.09666.arodland@entermail.net> <20051117134628.GN847@smtp.paip.net>
Message-ID: <200511190325.47920.arodland@entermail.net>
On Thursday 17 November 2005 08:46 am, Ian Goldberg wrote:
> On Thu, Nov 17, 2005 at 03:38:09AM -0500, Andrew Rodland wrote:
> > Is there a tree anywhere that's tracking the changes going into gaim
> > (pre-2.0) CVS, or are the devs waiting for things to settle down first?
> > I'm tracking gaim-cvs, so if there's an otr-cvs, I'm willing to keep on
> > it and find out when and how it breaks :)
>
> Someone's sent in a patch, which we'll look at when we get a chance (at
> the end of the month). We'll probably stick it in CVS if it looks
> plausible, and then you'll be able to let us know what breaks. ;-)
>
> Ah, whatever. Here's the patch that was sent in (only briefly looked
> at by me). Have at it, and let us know... ;-)
>
I've been using this for a few days, and it looks pretty good. I've had one
segfault that appeared to be OTR-related, but it disappeared before I could
get a backtrace on it, so I don't have any idea whether it's related to
gaim-cvs or not. Everything else seems to be pretty good, though; no protocol
problems (not that I expected any), and the UI and gaim integration are just
fine.
Andrew
From evan.s@dreskin.net Sun Nov 20 19:06:36 2005
From: evan.s@dreskin.net (Evan Schoenberg)
Date: Sun, 20 Nov 2005 13:06:36 -0600
Subject: [OTR-dev] Bug (with fix) in proto.h, lilbotr 3.0.0
Message-ID: <1D7CDCD9-5E39-4665-9B30-DFBED79A283A@dreskin.net>
--Apple-Mail-2--412425769
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
At proto.h:43 we have
#define OTRL_POLICY_ALLOW_V1 0x01
#define OTRL_POLICY_ALLOW_V2 0x02
#define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
#define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
#define OTRL_POLICY_WHITESPACE_START_AKE 0x08
#define OTRL_POLICY_ERROR_START_AKE 0x10
Note that SEND_WHITESPACE_TAG and WHITESPACE_START_AKE have the same
value. This is incorrect; the correct definition should be:
#define OTRL_POLICY_ALLOW_V1 0x01
#define OTRL_POLICY_ALLOW_V2 0x02
#define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
#define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
#define OTRL_POLICY_WHITESPACE_START_AKE 0x10
#define OTRL_POLICY_ERROR_START_AKE 0x12
Thanks,
Evan
www.adiumx.com
--Apple-Mail-2--412425769
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
At=A0proto.h:43 we have
#define OTRL_POLICY_ALLOW_V1 0x01
#define OTRL_POLICY_ALLOW_V2 0x02
#define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
#define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
#define OTRL_POLICY_WHITESPACE_START_AKE 0x08
#define OTRL_POLICY_ERROR_START_AKE 0x10
Note that SEND_WHITESPACE_TAG and =
WHITESPACE_START_AKE have the same value.=A0 This is incorrect; the =
correct definition should be:
#define =
OTRL_POLICY_ALLOW_V1 0x01#define OTRL_POLICY_ALLOW_V2 0x02
#define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
#define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
#define OTRL_POLICY_WHITESPACE_START_AKE 0x10
#define OTRL_POLICY_ERROR_START_AKE 0x12
Thanks,
Evan
www.adiumx.com
=
--Apple-Mail-2--412425769--
From ian@cypherpunks.ca Sun Nov 20 20:37:10 2005
From: ian@cypherpunks.ca (Ian Goldberg)
Date: Sun, 20 Nov 2005 15:37:10 -0500
Subject: [OTR-dev] Bug (with fix) in proto.h, lilbotr 3.0.0
In-Reply-To: <1D7CDCD9-5E39-4665-9B30-DFBED79A283A@dreskin.net>
References: <1D7CDCD9-5E39-4665-9B30-DFBED79A283A@dreskin.net>
Message-ID: <20051120203710.GI847@smtp.paip.net>
On Sun, Nov 20, 2005 at 01:06:36PM -0600, Evan Schoenberg wrote:
> At proto.h:43 we have
>
> #define OTRL_POLICY_ALLOW_V1 0x01
> #define OTRL_POLICY_ALLOW_V2 0x02
> #define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
> #define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
> #define OTRL_POLICY_WHITESPACE_START_AKE 0x08
> #define OTRL_POLICY_ERROR_START_AKE 0x10
>
> Note that SEND_WHITESPACE_TAG and WHITESPACE_START_AKE have the same
> value. This is incorrect; the correct definition should be:
> #define OTRL_POLICY_ALLOW_V1 0x01
> #define OTRL_POLICY_ALLOW_V2 0x02
> #define OTRL_POLICY_REQUIRE_ENCRYPTION 0x04
> #define OTRL_POLICY_SEND_WHITESPACE_TAG 0x08
> #define OTRL_POLICY_WHITESPACE_START_AKE 0x10
> #define OTRL_POLICY_ERROR_START_AKE 0x12
Good catch, but the last value should be 0x20, not 0x12.
I've checked in the fix to CVS.
Feel free to use the fixed version (0x10, 0x20) in Adium; it won't cause
incompatibility with other clients or anything. It just so happens that
that bug will never be exposed in gaim-otr or otrproxy, so I won't rush
out a new release of libotr.
Thanks!
- Ian
From paul@xelerance.com Mon Nov 21 04:53:00 2005
From: paul@xelerance.com (Paul Wouters)
Date: Mon, 21 Nov 2005 05:53:00 +0100 (CET)
Subject: [OTR-dev] Bug (with fix) in proto.h, lilbotr 3.0.0
In-Reply-To: <20051120203710.GI847@smtp.paip.net>
References: <1D7CDCD9-5E39-4665-9B30-DFBED79A283A@dreskin.net>
<20051120203710.GI847@smtp.paip.net>
Message-ID:
On Sun, 20 Nov 2005, Ian Goldberg wrote:
> Feel free to use the fixed version (0x10, 0x20) in Adium; it won't cause
> incompatibility with other clients or anything. It just so happens that
> that bug will never be exposed in gaim-otr or otrproxy, so I won't rush
> out a new release of libotr.
Are you sure?
I've seen a few bugs related to starting or restarting (or dual starting?)
sessions from a v2 to a v1 client. Lots of repeated refreshes, sometimes
ending up working, sometimes not, and a rare malformed message.
(not only on jabber, this actually mostly happens for me on MSN, but I
also use that one mostly)
Paul
From ian@cypherpunks.ca Mon Nov 21 16:33:40 2005
From: ian@cypherpunks.ca (Ian Goldberg)
Date: Mon, 21 Nov 2005 11:33:40 -0500
Subject: [OTR-dev] Bug (with fix) in proto.h, lilbotr 3.0.0
In-Reply-To:
References: <1D7CDCD9-5E39-4665-9B30-DFBED79A283A@dreskin.net> <20051120203710.GI847@smtp.paip.net>
Message-ID: <20051121163340.GK847@smtp.paip.net>
On Mon, Nov 21, 2005 at 05:53:00AM +0100, Paul Wouters wrote:
> On Sun, 20 Nov 2005, Ian Goldberg wrote:
>
> > Feel free to use the fixed version (0x10, 0x20) in Adium; it won't cause
> > incompatibility with other clients or anything. It just so happens that
> > that bug will never be exposed in gaim-otr or otrproxy, so I won't rush
> > out a new release of libotr.
>
> Are you sure?
> I've seen a few bugs related to starting or restarting (or dual starting?)
> sessions from a v2 to a v1 client. Lots of repeated refreshes, sometimes
> ending up working, sometimes not, and a rare malformed message.
>
> (not only on jabber, this actually mostly happens for me on MSN, but I
> also use that one mostly)
Quite sure. There may be another bug, but it's not this one. If you
can capture the incoming and outgoing messages that go by when you see
this happening, I'll see if anything obvious is wrong.
Thanks,
- Ian