changeset 15827:eec0d0202ffd

merge of '9d227438376255715d0d778ce0a57734aed4c99a' and 'ebb919dd47f8edc3b1b82fdbc2d2a7764bc9ab6f'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 19 Mar 2007 06:35:51 +0000
parents f59cfcce68a8 (diff) 84b0f9b23ede (current diff)
children 2edbd4fede72
files pidgin/gaimcombobox.c pidgin/gaimcombobox.h pidgin/gaimstock.c pidgin/gaimstock.h
diffstat 5 files changed, 59 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntrequest.c	Mon Mar 19 06:11:46 2007 +0000
+++ b/finch/gntrequest.c	Mon Mar 19 06:35:51 2007 +0000
@@ -384,10 +384,21 @@
 			}
 			else if (type == GAIM_REQUEST_FIELD_STRING)
 			{
+				const char *hint = gaim_request_field_get_type_hint(field);
 				GntWidget *entry = gnt_entry_new(
 							gaim_request_field_string_get_default_value(field));
 				gnt_entry_set_masked(GNT_ENTRY(entry),
 						gaim_request_field_string_is_masked(field));
+				if (gaim_str_has_prefix(hint, "screenname")) {
+					GaimBlistNode *node = gaim_blist_get_root();
+					gboolean offline = gaim_str_has_suffix(hint, "all");
+					for (; node; node = gaim_blist_node_next(node, offline)) {
+						if (!GAIM_BLIST_NODE_IS_BUDDY(node))
+							continue;
+						gnt_entry_add_suggest(GNT_ENTRY(entry), gaim_buddy_get_name((GaimBuddy*)node));
+					}
+					gnt_entry_set_always_suggest(GNT_ENTRY(entry), TRUE);
+				}
 				gnt_box_add_widget(GNT_BOX(hbox), entry);
 				field->ui_data = entry;
 			}
--- a/libpurple/connection.c	Mon Mar 19 06:11:46 2007 +0000
+++ b/libpurple/connection.c	Mon Mar 19 06:35:51 2007 +0000
@@ -435,7 +435,7 @@
 
 	g_return_if_fail(gc   != NULL);
 
-	if (text != NULL) {
+	if (text == NULL) {
 		g_critical("gaim_connection_error: check `text != NULL' failed");
 		text = _("Unknown error");
 	}
--- a/libpurple/dnsquery.c	Mon Mar 19 06:11:46 2007 +0000
+++ b/libpurple/dnsquery.c	Mon Mar 19 06:35:51 2007 +0000
@@ -758,7 +758,7 @@
 		{
 			char message[1024];
 			g_snprintf(message, sizeof(message), _("Thread creation failure: %s"),
-					err ? err->message : _("Unknown reason"));
+					(err && err->message) ? err->message : _("Unknown reason"));
 			g_error_free(err);
 			gaim_dnsquery_failed(query_data, message);
 		}
--- a/libpurple/dnssrv.c	Mon Mar 19 06:11:46 2007 +0000
+++ b/libpurple/dnssrv.c	Mon Mar 19 06:35:51 2007 +0000
@@ -110,7 +110,7 @@
 #ifdef HAVE_SIGNAL_H
 	gaim_restore_default_signal_handlers();
 #endif
-	
+
 	if (read(in, query, 256) <= 0)
 		_exit(0);
 
@@ -222,9 +222,9 @@
 		GaimSrvResponse *srvres_tmp = NULL;
 		GSList *lst = query_data->results;
 
-		size = g_slist_length(query_data->results);
+		size = g_slist_length(lst);
 
-		if(query_data->cb)
+		if(query_data->cb && size > 0)
 			srvres_tmp = srvres = g_new0(GaimSrvResponse, size);
 		while (lst) {
 			if(query_data->cb)
@@ -234,10 +234,10 @@
 		}
 
 		query_data->results = NULL;
+
+		gaim_debug_info("dnssrv", "found %d SRV entries\n", size);
 	}
 
-	gaim_debug_info("dnssrv", "found %d SRV entries\n", size);
-
 	if(query_data->cb)
 		query_data->cb(srvres, size, query_data->extradata);
 
@@ -367,29 +367,22 @@
 	query_data->query = query;
 	query_data->extradata = extradata;
 
-	if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree) {
-		query_data->error_message = g_strdup_printf("System missing DNS API (Requires W2K+)\n");
-
-		/* Asynchronously call the callback since stuff may not expect
-		 * the callback to be called before this returns */
-		query_data->handle = g_idle_add(res_main_thread_cb, query_data);
-
-		return query_data;
+	if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree)
+		query_data->error_message = g_strdup("System missing DNS API (Requires W2K+)\n");
+	else {
+		query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
+		if (query_data->resolver == NULL) {
+			query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", (err && err->message) ? err->message : "");
+			g_error_free(err);
+		}
 	}
 
-	query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err);
-	if (query_data->resolver == NULL)
-	{
-		query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", err ? err->message : "");
-		g_error_free(err);
-
-		/* Asynchronously call the callback since stuff may not expect
-		 * the callback to be called before this returns */
+	/* The query isn't going to happen, so finish the SRV lookup now.
+	 * Asynchronously call the callback since stuff may not expect
+	 * the callback to be called before this returns */
+	if (query_data->error_message != NULL)
 		query_data->handle = g_idle_add(res_main_thread_cb, query_data);
 
-		return query_data;
-	}
-
 	return query_data;
 #endif
 }
--- a/po/POTFILES.in	Mon Mar 19 06:11:46 2007 +0000
+++ b/po/POTFILES.in	Mon Mar 19 06:35:51 2007 +0000
@@ -1,33 +1,33 @@
 pidgin.desktop.in
-console/gntaccount.c
-console/gntblist.c
-console/gntconn.c
-console/gntconv.c
-console/gntdebug.c
-console/gntgaim.c
-console/gntnotify.c
-console/gntplugin.c
-console/gntprefs.c
-console/gntrequest.c
-console/gntstatus.c
-console/gntui.c
-console/libgnt/gntbox.c
-console/libgnt/gntbutton.c
-console/libgnt/gntcheckbox.c
-console/libgnt/gntcolors.c
-console/libgnt/gntcombobox.c
-console/libgnt/gntentry.c
-console/libgnt/gntkeys.c
-console/libgnt/gntlabel.c
-console/libgnt/gntline.c
-console/libgnt/gntstyle.c
-console/libgnt/gnttextview.c
-console/libgnt/gnttree.c
-console/libgnt/gntutils.c
-console/libgnt/gntwidget.c
-console/plugins/gntgf.c
-console/plugins/gnthistory.c
-console/plugins/lastlog.c
+finch/gntaccount.c
+finch/gntblist.c
+finch/gntconn.c
+finch/gntconv.c
+finch/gntdebug.c
+finch/gntgaim.c
+finch/gntnotify.c
+finch/gntplugin.c
+finch/gntprefs.c
+finch/gntrequest.c
+finch/gntstatus.c
+finch/gntui.c
+finch/libgnt/gntbox.c
+finch/libgnt/gntbutton.c
+finch/libgnt/gntcheckbox.c
+finch/libgnt/gntcolors.c
+finch/libgnt/gntcombobox.c
+finch/libgnt/gntentry.c
+finch/libgnt/gntkeys.c
+finch/libgnt/gntlabel.c
+finch/libgnt/gntline.c
+finch/libgnt/gntstyle.c
+finch/libgnt/gnttextview.c
+finch/libgnt/gnttree.c
+finch/libgnt/gntutils.c
+finch/libgnt/gntwidget.c
+finch/plugins/gntgf.c
+finch/plugins/gnthistory.c
+finch/plugins/lastlog.c
 pidgin/eggtrayicon.c
 pidgin/gaimcombobox.c
 pidgin/gaimstock.c