pidgin/pidgin

2fc408bdc848
Parents 8344bea0b9c7
Children 55aead831b0e
Actually use the path variable pasted to purple_smiley_new
--- a/libpurple/smiley.c Tue Oct 04 19:39:01 2016 -0500
+++ b/libpurple/smiley.c Tue Oct 04 19:45:24 2016 -0500
@@ -130,14 +130,30 @@
PurpleSmiley *
purple_smiley_new(const gchar *shortcut, const gchar *path)
{
+ PurpleSmiley *smiley = NULL;
+ GBytes *bytes = NULL;
+ gchar *contents = NULL;
+ gsize length = 0;
+
g_return_val_if_fail(shortcut != NULL, NULL);
g_return_val_if_fail(path != NULL, NULL);
- return g_object_new(
+ if(!g_file_get_contents(path, &contents, &length, NULL)) {
+ return NULL;
+ }
+
+ bytes = g_bytes_new_take(contents, length);
+
+ smiley = g_object_new(
PURPLE_TYPE_SMILEY,
+ "contents", bytes,
"shortcut", shortcut,
NULL
);
+
+ g_bytes_unref(bytes);
+
+ return smiley;
}
PurpleSmiley *