comparison src/notify.c @ 11533:c9b815aeddc1

[gaim-migrate @ 13782] Pushing more of the userinfo stuff to the UI. Also, fixed a notify API warning in the perl plugin. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 12 Sep 2005 20:04:37 +0000
parents bf763a1b2454
children 216988c717da
comparison
equal deleted inserted replaced
11532:57439a383f4f 11533:c9b815aeddc1
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */ 24 */
25 #include "internal.h"
26 #include "notify.h" 25 #include "notify.h"
27 26
28 static GaimNotifyUiOps *notify_ui_ops = NULL; 27 static GaimNotifyUiOps *notify_ui_ops = NULL;
29 static GList *handles = NULL; 28 static GList *handles = NULL;
30 29
328 return g_list_nth_data(results->rows, row_id); 327 return g_list_nth_data(results->rows, row_id);
329 } 328 }
330 329
331 void * 330 void *
332 gaim_notify_userinfo(GaimConnection *gc, const char *who, 331 gaim_notify_userinfo(GaimConnection *gc, const char *who,
333 const char *primary, const char *secondary,
334 const char *text, GCallback cb, void *user_data) 332 const char *text, GCallback cb, void *user_data)
335 { 333 {
336 GaimNotifyUiOps *ops; 334 GaimNotifyUiOps *ops;
337 char title[256]; 335
338 336 g_return_val_if_fail(who != NULL, NULL);
339 g_snprintf(title, sizeof(title), _("Info for %s"), who);
340
341 g_return_val_if_fail(primary != NULL, NULL);
342 337
343 ops = gaim_notify_get_ui_ops(); 338 ops = gaim_notify_get_ui_ops();
344 339
345 if (ops != NULL && ops->notify_userinfo != NULL) { 340 if (ops != NULL && ops->notify_userinfo != NULL) {
346 GaimNotifyInfo *info; 341 GaimNotifyInfo *info;
347 342
348 info = g_new0(GaimNotifyInfo, 1); 343 info = g_new0(GaimNotifyInfo, 1);
349 info->type = GAIM_NOTIFY_USERINFO; 344 info->type = GAIM_NOTIFY_USERINFO;
350 info->handle = gc; 345 info->handle = gc;
351 info->ui_handle = ops->notify_userinfo(gc, who, title, primary, 346 info->ui_handle = ops->notify_userinfo(gc, who,
352 secondary, text, cb, user_data); 347 text, cb, user_data);
353 348
354 handles = g_list_append(handles, info); 349 handles = g_list_append(handles, info);
355 350
356 return info->ui_handle; 351 return info->ui_handle;
357 } 352 }