comparison src/notify.c @ 9797:62eb9fe24692

[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: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 20 Aug 2004 22:05:18 +0000
parents fa6395637e2c
children 9e0b98c458b1
comparison
equal deleted inserted replaced
9796:68574cef02e2 9797:62eb9fe24692
153 } 153 }
154 154
155 return NULL; 155 return NULL;
156 } 156 }
157 157
158 void *gaim_notify_userinfo(GaimConnection *gc, const char *who, const char *title,
159 const char *primary, const char *secondary,
160 const char *text, GCallback cb, void *user_data)
161 {
162 GaimNotifyUiOps *ops;
163
164 g_return_val_if_fail(primary != NULL, NULL);
165
166 ops = gaim_notify_get_ui_ops();
167
168 if (ops != NULL && ops->notify_userinfo != NULL) {
169 GaimNotifyInfo *info;
170
171 info = g_new0(GaimNotifyInfo, 1);
172 info->type = GAIM_NOTIFY_USERINFO;
173 info->handle = gc;
174 info->ui_handle = ops->notify_userinfo(gc, who, title, primary,
175 secondary, text, cb, user_data);
176
177 handles = g_list_append(handles, info);
178
179 return info->ui_handle;
180 }
181
182 return NULL;
183 }
184
158 void * 185 void *
159 gaim_notify_uri(void *handle, const char *uri) 186 gaim_notify_uri(void *handle, const char *uri)
160 { 187 {
161 GaimNotifyUiOps *ops; 188 GaimNotifyUiOps *ops;
162 189