diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-30 17:08:29 +0000 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-30 17:08:29 +0000 |
commit | 969df6cdc59df3e57c8c1619bd9a197124939c2d (patch) | |
tree | 811af868c2c3536ce320d2208a2b97fb2eb622be /src/empathy-misc.c | |
parent | 885555ee46acc4f4fe96b04b554ee3a0f2ae4baa (diff) |
Factor out some common code.
svn path=/trunk/; revision=2302
Diffstat (limited to 'src/empathy-misc.c')
-rw-r--r-- | src/empathy-misc.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/empathy-misc.c b/src/empathy-misc.c index eb4baf3d..0a943bb6 100644 --- a/src/empathy-misc.c +++ b/src/empathy-misc.c @@ -24,9 +24,30 @@ #include "empathy-misc.h" #include <libempathy/empathy-utils.h> +#include <libempathy-gtk/empathy-ui-utils.h> #include <libempathy-gtk/empathy-conf.h> /* public methods */ + +GdkPixbuf * +empathy_misc_get_pixbuf_for_notification (EmpathyContact *contact, + const char *icon_name) +{ + GdkPixbuf *pixbuf = NULL; + + if (contact != NULL) { + pixbuf = empathy_pixbuf_avatar_from_contact_scaled (contact, + 48, 48); + } + + if (!pixbuf) { + pixbuf = empathy_pixbuf_from_icon_name_sized + (icon_name, 48); + } + + return pixbuf; +} + gboolean empathy_notification_is_enabled (void) { |