changeset 26516:e15d189020c9

merge of 'c62ab40bbe8c46b10ab31caed16f8af9dfa7d091' and 'd7035ee86f48f7b086fe0db1d6c7973d6ea784d4'
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 08 Apr 2009 22:48:04 +0000
parents ac6cb19e60d0 (current diff) 89da4ae5e451 (diff)
children 3609fb4bc78e
files
diffstat 3 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gnttree.c	Wed Apr 08 22:36:53 2009 +0000
+++ b/finch/libgnt/gnttree.c	Wed Apr 08 22:48:04 2009 +0000
@@ -432,7 +432,7 @@
 
 	if (tree->top == NULL)
 		tree->top = tree->root;
-	if (tree->current == NULL) {
+	if (tree->current == NULL && tree->root != NULL) {
 		tree->current = tree->root;
 		tree_selection_changed(tree, NULL, tree->current);
 	}
@@ -491,6 +491,13 @@
 		tree->top = get_next(tree->top);
 	row = tree->top;
 	scrcol = widget->priv.width - 1 - 2 * pos;  /* exclude the borders and the scrollbar */
+
+	if (tree->current && !row_matches_search(tree->current)) {
+		GntTreeRow *old = tree->current;
+		tree->current = tree->top;
+		tree_selection_changed(tree, old, tree->current);
+	}
+
 	for (i = start + pos; row && i < widget->priv.height - pos;
 				i++, row = get_next(row))
 	{
--- a/finch/plugins/gnttinyurl.c	Wed Apr 08 22:36:53 2009 +0000
+++ b/finch/plugins/gnttinyurl.c	Wed Apr 08 22:48:04 2009 +0000
@@ -293,9 +293,9 @@
 		cbdata->conv = conv;
 		tmp = purple_unescape_html((char *)iter->data);
 		if (g_ascii_strncasecmp(tmp, "http://", 7) && g_ascii_strncasecmp(tmp, "https://", 8)) {
-			url = g_strdup_printf("%shttp://%s", purple_prefs_get_string(PREF_URL), tmp);
+			url = g_strdup_printf("%shttp%%3A%%2F%%2F%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp));
 		} else {
-			url = g_strdup_printf("%s%s", purple_prefs_get_string(PREF_URL), tmp);
+			url = g_strdup_printf("%s%s", purple_prefs_get_string(PREF_URL), purple_url_encode(tmp));
 		}
 		g_free(tmp);
 		purple_util_fetch_url(url, TRUE, "finch", FALSE, url_fetched, cbdata);
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Apr 08 22:36:53 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Wed Apr 08 22:48:04 2009 +0000
@@ -2829,6 +2829,7 @@
 	p2p_data->host_username = g_strdup(who);
 	p2p_data->val_13 = val_13;
 	p2p_data->connection_type = YAHOO_P2P_WE_ARE_SERVER;
+	p2p_data->source = -1;
 
 	purple_network_listen(YAHOO_PAGER_PORT_P2P, SOCK_STREAM, yahoo_p2p_server_listen_cb, p2p_data);
 
@@ -2932,10 +2933,9 @@
 
 	if (base64) {
 		guint32 ip;
-		char *tmp2;
 		YahooFriend *f;
 		char *host_ip;
-		struct yahoo_p2p_data *p2p_data = g_new0(struct yahoo_p2p_data, 1);
+		struct yahoo_p2p_data *p2p_data;
 
 		decoded = purple_base64_decode(base64, &len);
 		if (len) {
@@ -2944,9 +2944,7 @@
 			g_free(tmp);
 		}
 
-		tmp2 = g_strndup((const gchar *)decoded, len); /* so its \0 terminated...*/
-		ip = strtol(tmp2, NULL, 10);
-		g_free(tmp2);
+		ip = strtol((gchar *)decoded, NULL, 10);
 		g_free(decoded);
 		host_ip = g_strdup_printf("%u.%u.%u.%u", ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff,
 		                       (ip >> 24) & 0xff);
@@ -2964,12 +2962,14 @@
 				val_11 = f->session_id;
 		}
 
-		p2p_data->host_username = g_strdup(who);	
+		p2p_data = g_new0(struct yahoo_p2p_data, 1);
+		p2p_data->host_username = g_strdup(who);
 		p2p_data->val_13 = val_13;
 		p2p_data->session_id = val_11;
 		p2p_data->host_ip = host_ip;
 		p2p_data->gc = gc;
 		p2p_data->connection_type = YAHOO_P2P_WE_ARE_CLIENT;
+		p2p_data->source = -1;
 
 		/* connect to host */
 		if((purple_proxy_connect(NULL, account, host_ip, YAHOO_PAGER_PORT_P2P, yahoo_p2p_init_cb, p2p_data))==NULL)	{