pidgin: ae9c5670: Gadu-Gadu: possibility to require encryp...

tomkiewicz at cpw.pidgin.im tomkiewicz at cpw.pidgin.im
Sat Oct 8 11:56:02 EDT 2011


----------------------------------------------------------------------
Revision: ae9c56707416416a3c468f1a1492005371c2bea8
Parent:   60b08bb268ca62ab52c6223839341566e945a61d
Author:   tomkiewicz at cpw.pidgin.im
Date:     10/08/11 11:49:37
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ae9c56707416416a3c468f1a1492005371c2bea8

Changelog: 

Gadu-Gadu: possibility to require encryption; use encryption when available is default option now

Changes against parent 60b08bb268ca62ab52c6223839341566e945a61d

  patched  ChangeLog
  patched  libpurple/protocols/gg/gg.c

-------------- next part --------------
============================================================
--- ChangeLog	71b224f5f05d8b1c7c54447d37cb73c3b3d2228b
+++ ChangeLog	3742b9648641608bd4a1b421ecee4652711a050d
@@ -6,6 +6,10 @@ version 3.0.0 (??/??/????):
 	* Don't try to format ICQ usernames entered as email addresses.
 	  Gets rid of an "Unable to format username" error at login. (#13883)
 
+	Gadu-Gadu:
+	* Possibility to require encryption. Also, using encryption when
+	  available is default option now. (Tomasz Wasilczyk)
+
 	MXit:
 	* Remove all reference to Hidden Number.
 	* Fix decoding of font-size changes in the markup of received messages.
============================================================
--- libpurple/protocols/gg/gg.c	9b4035daae84e7c68c1f36a3b78759f84fba8671
+++ libpurple/protocols/gg/gg.c	d7807eb6fc4adb64c8497e5a34af809d7a7f8343
@@ -2143,13 +2143,28 @@ static void ggp_login(PurpleAccount *acc
 	glp->async = 1;
 	glp->status = ggp_to_gg_status(status, &glp->status_descr);
 	
-	encryption_type = purple_account_get_string(account, "encryption", "none");
-	purple_debug_info("gg", "Requested encryption type: %s\n", encryption_type);
+	encryption_type = purple_account_get_string(account, "encryption",
+		"opportunistic_tls");
+	purple_debug_info("gg", "Requested encryption type: %s\n",
+		encryption_type);
 	if (strcmp(encryption_type, "opportunistic_tls") == 0)
-		glp->tls = 1;
-	else
-		glp->tls = 0;
-	purple_debug_info("gg", "TLS enabled: %d\n", glp->tls);
+		glp->tls = GG_SSL_ENABLED;
+	else if (strcmp(encryption_type, "require_tls") == 0)
+	{
+		if (gg_libgadu_check_feature(GG_LIBGADU_FEATURE_SSL))
+			glp->tls = GG_SSL_REQUIRED;
+		else
+		{
+			purple_connection_error(gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
+				_("SSL support unavailable"));
+			g_free(glp);
+			return;
+		}
+	}
+	else /* encryption_type == "none" */
+		glp->tls = GG_SSL_DISABLED;
+	purple_debug_info("gg", "TLS mode: %d\n", glp->tls);
 
 	if (!info->status_broadcasting)
 		glp->status = glp->status|GG_STATUS_FRIENDS_MASK;
@@ -2808,13 +2823,10 @@ static void init_plugin(PurplePlugin *pl
 	list = g_list_append(list, kvp); \
 }
 
-	ADD_VALUE(encryption_options, _("Don't use encryption"), "none");
 	ADD_VALUE(encryption_options, _("Use encryption if available"),
 		"opportunistic_tls");
-#if 0
-	/* TODO */
 	ADD_VALUE(encryption_options, _("Require encryption"), "require_tls");
-#endif
+	ADD_VALUE(encryption_options, _("Don't use encryption"), "none");
 
 	option = purple_account_option_list_new(_("Connection security"),
 		"encryption", encryption_options);


More information about the Commits mailing list