[gaim-migrate @ 10665]

Fri, 20 Aug 2004 22:05:18 +0000

author
Evan Schoenberg <evands@pidgin.im>
date
Fri, 20 Aug 2004 22:05:18 +0000
changeset 9797
b69f82378b7b
parent 9796
dd7499147bed
child 9798
9da203982089

[gaim-migrate @ 10665]
"This patch adds gaim_notify_userinfo() and a notify_userinfo() UI
callback. gaim_notify_userinfo() is much like
gaim_notify_formatted() except that it always takes a
GaimConnection* as its handle and has an
additional argument, const char* who.

gaim_gtk_notify_userinfo() currently passes all the information
except the GaimConnection* and the const char* who to
gaim_gtk_notify_formatted(). This could be changed in the future
to, for example, have a standardized window title which would
note the account and/or user associated with the information.

This is needed because some UIs (Adium, for example) don't want
to present the information in a standalone window - they want to
associate the information with a particular contact / buddy and
display it with that object's other information. Previously,
gaim_notify_formatted() was not useful for this purpose as it could
not be determined what user's info it was; gaim_notify_userinfo()
makes this possible.

This patch modifies notify.c and notify.h for the new function,
modifies gtknotify.c to register the ui op and pass calls to it on the
gaim_gtk_notify_formatted, and modifies all prpls except SILC
(which I don't understand well enough to modify, but there's no
actual harm in leaving it as gaim_notify_formatted() for now) to
use gaim_notify_userinfo() and pass their gc and username when
calling the function." -- Evan Schoenberg

committer: Luke Schierer <lschiere@pidgin.im>

src/gtknotify.c file | annotate | diff | comparison | revisions
src/notify.c file | annotate | diff | comparison | revisions
src/notify.h file | annotate | diff | comparison | revisions
src/protocols/gg/gg.c file | annotate | diff | comparison | revisions
src/protocols/irc/msgs.c file | annotate | diff | comparison | revisions
src/protocols/jabber/buddy.c file | annotate | diff | comparison | revisions
src/protocols/msn/msn.c file | annotate | diff | comparison | revisions
src/protocols/napster/napster.c file | annotate | diff | comparison | revisions
src/protocols/novell/novell.c file | annotate | diff | comparison | revisions
src/protocols/oscar/oscar.c file | annotate | diff | comparison | revisions
src/protocols/silc/ops.c file | annotate | diff | comparison | revisions
src/protocols/yahoo/yahoo_profile.c file | annotate | diff | comparison | revisions
src/protocols/zephyr/zephyr.c file | annotate | diff | comparison | revisions
--- a/src/gtknotify.c	Fri Aug 20 21:57:18 2004 +0000
+++ b/src/gtknotify.c	Fri Aug 20 22:05:18 2004 +0000
@@ -388,6 +388,16 @@
 	return window;
 }
 
+static void *
+gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who,
+						 const char *title, const char *primary,
+						 const char *secondary, const char *text,
+						 GCallback cb, void *user_data)
+{
+	return (gaim_gtk_notify_formatted(title, primary, secondary,
+									  text, cb, user_data));
+}
+
 static void
 gaim_gtk_close_notify(GaimNotifyType type, void *ui_handle)
 {
@@ -622,6 +632,7 @@
 	gaim_gtk_notify_email,
 	gaim_gtk_notify_emails,
 	gaim_gtk_notify_formatted,
+	gaim_gtk_notify_userinfo,
 	gaim_gtk_notify_uri,
 	gaim_gtk_close_notify
 };
--- a/src/notify.c	Fri Aug 20 21:57:18 2004 +0000
+++ b/src/notify.c	Fri Aug 20 22:05:18 2004 +0000
@@ -155,6 +155,33 @@
 	return NULL;
 }
 
+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)
+{
+	GaimNotifyUiOps *ops;
+
+	g_return_val_if_fail(primary != NULL, NULL);
+
+	ops = gaim_notify_get_ui_ops();
+
+	if (ops != NULL && ops->notify_userinfo != NULL) {
+		GaimNotifyInfo *info;
+
+		info            = g_new0(GaimNotifyInfo, 1);
+		info->type      = GAIM_NOTIFY_USERINFO;
+		info->handle    = gc;
+		info->ui_handle = ops->notify_userinfo(gc, who, title, primary,
+											   secondary, text, cb, user_data);
+
+		handles = g_list_append(handles, info);
+
+		return info->ui_handle;
+	}
+
+	return NULL;
+}