changeset 11531:bf763a1b2454

[gaim-migrate @ 13780] (13:57:11) rlaager: LSchiere2: Should we just change gaim_notify_userinfo to take a screenname and eliminate all the duplication of "Buddy Information" and "Info for %s"? (13:57:18) LSchiere2: sounds good This breaks perl, I could not figure out how to fix that. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 12 Sep 2005 18:46:15 +0000
parents 2a13cfe607b5
children 57439a383f4f
files src/notify.c src/notify.h src/protocols/irc/msgs.c src/protocols/jabber/buddy.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/novell/novell.c src/protocols/oscar/oscar.c src/protocols/sametime/sametime.c src/protocols/silc/ops.c src/protocols/yahoo/yahoo_profile.c src/protocols/zephyr/zephyr.c
diffstat 12 files changed, 27 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/src/notify.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/notify.c	Mon Sep 12 18:46:15 2005 +0000
@@ -22,6 +22,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include "internal.h"
 #include "notify.h"
 
 static GaimNotifyUiOps *notify_ui_ops = NULL;
@@ -328,11 +329,14 @@
 }
 
 void *
-gaim_notify_userinfo(GaimConnection *gc, const char *who, const char *title,
+gaim_notify_userinfo(GaimConnection *gc, const char *who,
 						   const char *primary, const char *secondary,
 						   const char *text, GCallback cb, void *user_data)
 {
 	GaimNotifyUiOps *ops;
+	char title[256];
+
+	g_snprintf(title, sizeof(title), _("Info for %s"), who);
 
 	g_return_val_if_fail(primary != NULL, NULL);
 
--- a/src/notify.h	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/notify.h	Mon Sep 12 18:46:15 2005 +0000
@@ -362,7 +362,6 @@
  *
  * @param gc		The GaimConnection handle associated with the information.
  * @param who		The username associated with the information.
- * @param title     The title of the message.
  * @param primary   The main point of the message.
  * @param secondary The secondary information.
  * @param text      The formatted text.
@@ -373,9 +372,9 @@
  * @return A UI-specific handle.
  */
 void *gaim_notify_userinfo(GaimConnection *gc, const char *who,
-						   const char *title, const char *primary,
-						   const char *secondary, const char *text,
-						   GCallback cb, void *user_data);
+						   const char *primary, const char *secondary,
+						   const char *text, GCallback cb,
+						   void *user_data);
 
 /**
  * Opens a URI or somehow presents it to the user.
--- a/src/protocols/irc/msgs.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/irc/msgs.c	Mon Sep 12 18:46:15 2005 +0000
@@ -197,7 +197,6 @@
 {
 	GaimConnection *gc;
 	GString *info;
-	char buffer[256];
 	char *str, *tmp;
 
 	if (!irc->whois.nick) {
@@ -253,9 +252,7 @@
 	gc = gaim_account_get_connection(irc->account);
 	str = g_string_free(info, FALSE);
 
-	g_snprintf(buffer, sizeof(buffer),
-			   _("Buddy Information for %s"), irc->whois.nick);
-	gaim_notify_userinfo(gc, irc->whois.nick, buffer, _("Buddy Information"), NULL, str, NULL, NULL);
+	gaim_notify_userinfo(gc, irc->whois.nick, _("Buddy Information"), NULL, str, NULL, NULL);
 
 	g_free(irc->whois.nick);
 	g_free(str);
--- a/src/protocols/jabber/buddy.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/jabber/buddy.c	Mon Sep 12 18:46:15 2005 +0000
@@ -854,7 +854,7 @@
 
 	text = gaim_strdup_withhtml(info_text->str);
 
-	gaim_notify_userinfo(js->gc, from, title, _("Jabber Profile"),
+	gaim_notify_userinfo(js->gc, from, _("Jabber Profile"),
 			NULL, text, NULL, NULL);
 
 	while(imgids) {
--- a/src/protocols/msn/msn.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/msn/msn.c	Mon Sep 12 18:46:15 2005 +0000
@@ -1483,8 +1483,7 @@
 		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
 				tooltip_text, _("Error retrieving profile"));
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, NULL,
-				title, NULL, buf, NULL, NULL);
+		gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, buf, NULL, NULL);
 
 		g_free(tooltip_text);
 		return;
@@ -1820,8 +1819,7 @@
 #endif
 
 	g_string_prepend(s, tooltip_text);
-	gaim_notify_userinfo(info_data->gc, info_data->name, NULL, 
-						 title, NULL, s->str, NULL, NULL);
+	gaim_notify_userinfo(info_data->gc, info_data->name, title, NULL, s->str, NULL, NULL);
 
 	g_free(stripped);
 	g_free(url_buffer);
--- a/src/protocols/napster/napster.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/napster/napster.c	Mon Sep 12 18:46:15 2005 +0000
@@ -420,8 +420,7 @@
 		/* XXX - Format is:   "Elite" 37 " " "Active" 0 0 0 0 "gaim 0.63cvs" 0 0 192.168.1.41 32798 0 unknown flounder */
 		res = g_strsplit(buf, " ", 2);
 		/* res[0] == username */
-		gaim_notify_userinfo(gc, res[0], NULL, _("Buddy Information"), NULL,
-							  res[1], NULL, NULL);
+		gaim_notify_userinfo(gc, res[0], NULL, _("Buddy Information"), res[1], NULL, NULL);
 		g_strfreev(res);
 		break;
 
--- a/src/protocols/novell/novell.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/novell/novell.c	Mon Sep 12 18:46:15 2005 +0000
@@ -1511,7 +1511,7 @@
 		}
 	}
 
-	gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), NULL,
+	gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), 
 						 _("User Properties"), NULL, info_text->str,
 						 NULL, NULL);
 
--- a/src/protocols/oscar/oscar.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Sep 12 18:46:15 2005 +0000
@@ -4874,7 +4874,7 @@
 			g_free(statusmsg);
 			g_strfreev(splitmsg);
 
-			gaim_notify_userinfo(gc, who, title, _("Buddy Information"), NULL, dialogmsg, NULL, NULL);
+			gaim_notify_userinfo(gc, who, _("Buddy Information"), NULL, dialogmsg, NULL, NULL);
 
 			g_free(title);
 			g_free(dialogmsg);
@@ -5100,7 +5100,7 @@
 	tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account));
 	g_string_free(str, TRUE);
 	title = g_strdup_printf(_("Info for %s"), userinfo->sn);
-	gaim_notify_userinfo(gc, userinfo->sn, title, _("Buddy Information"), NULL, tmp, NULL, NULL);
+	gaim_notify_userinfo(gc, userinfo->sn, _("Buddy Information"), NULL, tmp, NULL, NULL);
 	g_free(title);
 	g_free(tmp);
 
@@ -6030,7 +6030,7 @@
 	else
 		alias = who;
 	primary = g_strdup_printf(_("ICQ Info for %s"), alias);
-	gaim_notify_userinfo(gc, who, NULL, primary, NULL, str->str, NULL, NULL);
+	gaim_notify_userinfo(gc, who, primary, NULL, str->str, NULL, NULL);
 	g_free(primary);
 	g_string_free(str, TRUE);
 
--- a/src/protocols/sametime/sametime.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Mon Sep 12 18:46:15 2005 +0000
@@ -3454,8 +3454,7 @@
   /* @todo emit a signal to allow a plugin to override the display of
      this notification, so that it can create its own */
 
-  gaim_notify_userinfo(gc, who, "Buddy Information",
-		       "Meanwhile User Status", NULL, str->str, NULL, NULL);
+  gaim_notify_userinfo(gc, who, "Meanwhile User Status", NULL, str->str, NULL, NULL);
 
   g_string_free(str, TRUE);
 }
--- a/src/protocols/silc/ops.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/silc/ops.c	Mon Sep 12 18:46:15 2005 +0000
@@ -937,7 +937,7 @@
 			SilcUInt32 idle, mode;
 			SilcBuffer channels, user_modes;
 			SilcClientEntry client_entry;
-			char *buf, tmp[1024], *tmp2, *title;
+			char *buf, tmp[1024], *tmp2;
 			char *moodstr, *statusstr, *contactstr, *langstr, *devicestr, *tzstr, *geostr;
 			GString *s;
 
@@ -1084,9 +1084,7 @@
 						_("More..."), G_CALLBACK(silcgaim_whois_more));
 			else
 #endif
-			title = g_strdup_printf(_("Info for %s"), client_entry->nickname);
-			gaim_notify_userinfo(gc, client_entry->nickname, title, _("Buddy Information"), NULL, buf, NULL, NULL);
-			g_free(title);
+			gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL);
 			g_free(buf);
 		}
 		break;
@@ -1094,7 +1092,7 @@
 	case SILC_COMMAND_WHOWAS:
 		{
 			SilcClientEntry client_entry;
-			char *buf, *nickname, *realname, *username, *tmp, *title;
+			char *buf, *nickname, *realname, *username, *tmp;
 			GString *s;
 
 			if (!success) {
@@ -1146,10 +1144,8 @@
 				silc_free(pk);
 			}
 
-			title = g_strdup_printf(_("Info for %s"), client_entry->nickname);
 			buf = g_string_free(s, FALSE);
-			gaim_notify_userinfo(gc, client_entry->nickname, title, _("Buddy Information"), NULL, buf, NULL, NULL);
-			g_free(title);
+			gaim_notify_userinfo(gc, client_entry->nickname, _("Buddy Information"), NULL, buf, NULL, NULL);
 			g_free(buf);
 		}
 		break;
--- a/src/protocols/yahoo/yahoo_profile.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/yahoo/yahoo_profile.c	Mon Sep 12 18:46:15 2005 +0000
@@ -764,7 +764,7 @@
 		g_snprintf(buf, 1024, "<html><body>%s<b>%s</b></body></html>",
 				tooltip_text, _("Error retrieving profile"));
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title,
+		gaim_notify_userinfo(info_data->gc, info_data->name, title,
 			NULL, buf, NULL, NULL);
 
 		g_free(profile_url_text);
@@ -801,7 +801,7 @@
 				  "you will need to visit this link in your web browser"),
 				profile_url_text, profile_url_text);
 
-		gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title, 
+		gaim_notify_userinfo(info_data->gc, info_data->name, title, 
 				NULL, buf, NULL, NULL);
 
 		g_free(profile_url_text);
@@ -1188,7 +1188,7 @@
 	g_string_prepend(s, "<html><body>\n");
 
 	/* show it to the user */
-	gaim_notify_userinfo(info_data->gc, info_data->name, NULL, title,
+	gaim_notify_userinfo(info_data->gc, info_data->name,title,
 						  NULL, s->str, NULL, NULL);
 
 	g_free(last_updated_utf8_string);
--- a/src/protocols/zephyr/zephyr.c	Mon Sep 12 18:43:03 2005 +0000
+++ b/src/protocols/zephyr/zephyr.c	Mon Sep 12 18:46:15 2005 +0000
@@ -727,7 +727,7 @@
 					ZGetLocations(&locs, &one);
 					g_string_append_printf(str, _("<br>At %s since %s"), locs.host, locs.time);
 				}
-				gaim_notify_userinfo(gc, b ? b->name : user, NULL, _("Buddy Information"), NULL, 
+				gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, 
 						     str->str, NULL, NULL);
 				g_string_free(str, TRUE);
 			} else {
@@ -1142,7 +1142,7 @@
 								       tree_child(tree_child(tree_child(tree_child(locations,2),0),2),2)->contents);
 					}
 
-					gaim_notify_userinfo(gc, b ? b->name : user, NULL, _("Buddy Information"), NULL, 
+					gaim_notify_userinfo(gc, b ? b->name : user, _("Buddy Information"), NULL, 
 							     str->str, NULL, NULL);
 					g_string_free(str, TRUE);
 				} else {