about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-12-18 14:36:18 +0100
committerMichael Vetter <jubalh@iodoru.org>2019-12-18 14:36:18 +0100
commit0ea1d3f85d276f6c3f28be8b1ae831a96138d5f7 (patch)
tree182bc803d813e4035a10964eec70f294d9900f36 /src/xmpp
parent2b6b165ed2aed54073da3abf30a6f13f73f243ab (diff)
downloadprofani-tty-0ea1d3f85d276f6c3f28be8b1ae831a96138d5f7.tar.gz
xep-0084: Normalize at out of image filename
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/avatar.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xmpp/avatar.c b/src/xmpp/avatar.c
index 7ca10b56..364d0143 100644
--- a/src/xmpp/avatar.c
+++ b/src/xmpp/avatar.c
@@ -196,8 +196,10 @@ avatar_request_item_handler(xmpp_stanza_t *const stanza, void *const userdata)
         }
     }
 
-    g_string_append(filename, from_attr);
+    gchar *from = str_replace(from_attr, "@", "_at_");
+    g_string_append(filename, from);
     g_string_append(filename, ".png");
+    free(from);
 
     GError *err = NULL;
     if (g_file_set_contents (filename->str, de, size, &err) == FALSE) {