Branch: master

ec7b81f4 2014-10-02 22:29:56 Slávek Banko
Fix libotr3 detection
Fix FTBFS with libotr3
M configure.in.in
M src/otrlchatinterface.cpp
diff --git a/configure.in.in b/configure.in.in
index 55b59af..f3e1086 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -24,8 +24,9 @@
 
 m4_pattern_allow([AM_PATH_LIBOTR])
 
-AM_PATH_LIBOTR(4.0.0,AC_DEFINE_UNQUOTED(HAVE_LIBOTR_0400, 1, [Defines if your system has libotr greater than or equal to v4.0.0]),)
-if test -n "$HAVE_LIBOTR_0400"; then
-  AM_PATH_LIBOTR(3.1.0,,AC_MSG_ERROR(libotr 3.1.0 or newer is required.))
-fi
-AC_SUBST(HAVE_LIBOTR_0400)
\ No newline at end of file
+AM_PATH_LIBOTR(4.0.0,
+  [ AC_DEFINE([HAVE_LIBOTR_0400], 1, [Defines if your system has libotr greater than or equal to v4.0.0]) ],
+  [ AM_PATH_LIBOTR(3.1.0,
+      [ AC_DEFINE([HAVE_LIBOTR_0310], 1, [Define if you use libotr3]) ],
+      [ AC_MSG_ERROR(libotr 3.1.0 or newer is required.) ] )
+  ])
diff --git a/src/otrlchatinterface.cpp b/src/otrlchatinterface.cpp
index 49895e4..135377b 100644
--- a/src/otrlchatinterface.cpp
+++ b/src/otrlchatinterface.cpp
@@ -209,7 +209,9 @@
 		OTRPlugin::plugin()->emitGoneSecure( ((Kopete::ChatSession*)opdata), 1 );
 	}
 
+#ifdef HAVE_LIBOTR_0400
 	session->setProperty("otr-instag", QString::number(context->their_instance));
+#endif // HAVE_LIBOTR_0400
 }
 
 /* Actually I've never seen this event but its implemented in case someone should receive it 
@@ -578,11 +580,13 @@
 
 	otrl_privkey_read_fingerprints(userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL);
 
+#ifdef HAVE_LIBOTR_0400
 	otrl_instag_read(userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "instags");
 
 	unsigned int interval = otrl_message_poll_get_default_interval(userstate);
 	forwardSecrecyTimerStart(interval);
 	connect(&m_forwardSecrecyTimer, SIGNAL(timeout()), this, SLOT(otrlMessagePoll()));
+#endif // HAVE_LIBOTR_0400
 
 }
 
@@ -607,7 +611,9 @@
 }
 
 void OtrlChatInterface::otrlMessagePoll(){
+#ifdef HAVE_LIBOTR_0400
 	otrl_message_poll(userstate, 0, 0);
+#endif // HAVE_LIBOTR_0400
 }
 
 /********************* Chat section ***************************/