aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-misc.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:29 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-31 01:08:29 +0800
commit969df6cdc59df3e57c8c1619bd9a197124939c2d (patch)
tree811af868c2c3536ce320d2208a2b97fb2eb622be /src/empathy-misc.c
parent885555ee46acc4f4fe96b04b554ee3a0f2ae4baa (diff)
downloadgsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar.gz
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar.bz2
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar.lz
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar.xz
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.tar.zst
gsoc2013-empathy-969df6cdc59df3e57c8c1619bd9a197124939c2d.zip
Factor out some common code.
svn path=/trunk/; revision=2302
Diffstat (limited to 'src/empathy-misc.c')
-rw-r--r--src/empathy-misc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/empathy-misc.c b/src/empathy-misc.c
index eb4baf3d4..0a943bb6d 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)
{