changeset 31450:66b30e47caec

Gadu-Gadu: Add encrypted (SSL) connection support for GNUTLS users. Fixes #13613. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author tomkiewicz@o2.pl
date Thu, 07 Apr 2011 01:49:57 +0000
parents 7db33b356d4a
children ec08b29cf087
files libpurple/protocols/gg/Makefile.am libpurple/protocols/gg/gg.c libpurple/protocols/gg/lib/libgadu.h
diffstat 3 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/gg/Makefile.am	Thu Apr 07 01:29:17 2011 +0000
+++ b/libpurple/protocols/gg/Makefile.am	Thu Apr 07 01:49:57 2011 +0000
@@ -56,7 +56,13 @@
 	lib/session.h \
 	lib/sha1.c
 
-INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib -DGG_IGNORE_DEPRECATED
+INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib -DGG_IGNORE_DEPRECATED -DUSE_INTERNAL_LIBGADU
+
+if USE_GNUTLS
+INTGG_CFLAGS += -DUSE_GNUTLS
+GADU_LIBS += $(GNUTLS_LIBS)
+endif
+
 endif
 
 GGSOURCES = \
--- a/libpurple/protocols/gg/gg.c	Thu Apr 07 01:29:17 2011 +0000
+++ b/libpurple/protocols/gg/gg.c	Thu Apr 07 01:49:57 2011 +0000
@@ -2041,7 +2041,12 @@
 
 	glp->async = 1;
 	glp->status = ggp_to_gg_status(status, &glp->status_descr);
+#if defined(USE_GNUTLS) || !defined(USE_INTERNAL_LIBGADU)
+	glp->tls = 1;
+#else
 	glp->tls = 0;
+#endif
+	purple_debug_info("gg", "TLS enabled: %d\n", glp->tls);
 
 	if (!info->status_broadcasting)
 		glp->status = glp->status|GG_STATUS_FRIENDS_MASK;
--- a/libpurple/protocols/gg/lib/libgadu.h	Thu Apr 07 01:29:17 2011 +0000
+++ b/libpurple/protocols/gg/lib/libgadu.h	Thu Apr 07 01:49:57 2011 +0000
@@ -72,7 +72,11 @@
 #undef GG_CONFIG_HAVE_LONG_LONG
 
 /* Defined if libgadu was compiled and linked with GnuTLS support. */
-#undef GG_CONFIG_HAVE_GNUTLS
+#ifdef USE_GNUTLS
+#	define GG_CONFIG_HAVE_GNUTLS
+#else
+#	undef GG_CONFIG_HAVE_GNUTLS
+#endif
 
 /* Defined if libgadu was compiled and linked with OpenSSL support. */
 #undef GG_CONFIG_HAVE_OPENSSL