soc.2009.telepathy: e7dd4ec8: Don't pass account and password options ...

sttwister at soc.pidgin.im sttwister at soc.pidgin.im
Thu Jun 4 10:45:41 EDT 2009


-----------------------------------------------------------------
Revision: e7dd4ec81c467eafc55a72990d1175e499840160
Ancestor: 4242313c69229c17ddb0c1f1ddc18c6693cea58f
Author: sttwister at soc.pidgin.im
Date: 2009-06-04T14:43:30
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/e7dd4ec81c467eafc55a72990d1175e499840160

Modified files:
        libpurple/protocols/telepathy/telepathy.c

ChangeLog: 

Don't pass account and password options unless they're required. Fixes connecting via salut

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy.c	386b88ea4714fccbbf43ff07e65f143da4c8b877
+++ libpurple/protocols/telepathy/telepathy.c	19b859a022f22c9f11774fb201b669048a8e1542
@@ -300,8 +300,6 @@ list_pending_messages_cb  (TpChannel *pr
 			/* escape HTML special characters */
 			gchar *escaped_message = g_markup_escape_text(msg, -1);
 
-			purple_debug_info("telepathy", "Escaped: %s\n", escaped_message);
-
 			/* also change \n to <br> */
 			gchar *final_message = purple_strdup_withhtml(escaped_message);
 			g_free(escaped_message);
@@ -788,11 +786,6 @@ telepathy_login(PurpleAccount *acct)
 
 	purple_debug_info("telepathy", "Logging in as %s\n", acct->username);
 
-	/* some protocols might not require username or password, so check them before */
-	if (acct->username != NULL)
-		tp_asv_set_string(options, "account", acct->username);
-	if (acct->password != NULL)
-		tp_asv_set_string(options, "password", acct->password);
 
 	/* fill in the hash table with the other options, considering the right signatures */
 	for (i = 0; data->protocol->params[i].name != NULL; ++i)
@@ -802,6 +795,12 @@ telepathy_login(PurpleAccount *acct)
 		name = data->protocol->params[i].name;
 		signature = data->protocol->params[i].dbus_signature;
 
+		/* some protocols might not require username or password, so check them before */
+		if (g_strcmp0(name, "account") == 0 && acct->username != NULL)
+			tp_asv_set_string(options, "account", acct->username);
+		if (g_strcmp0(name, "password") == 0 && acct->password != NULL)
+			tp_asv_set_string(options, "password", acct->password);
+
 		/* account and password have already been added */
 		if (g_strcmp0(name, "account") != 0 && g_strcmp0(name, "password"))
 		{


More information about the Commits mailing list