# HG changeset patch # User Kim Alvefur # Date 1534792853 -7200 # Node ID 1d57f485efef7feb6b3c7ed0e84efa47577d06fb # Parent 2b888a7aa21cb89252f64e8d0cf64a4b01c77b74 mod_profile: Use type property over content identifiguesstimation diff -r 2b888a7aa21c -r 1d57f485efef mod_profile/mod_profile.lua --- a/mod_profile/mod_profile.lua Mon Aug 20 20:22:43 2018 +0200 +++ b/mod_profile/mod_profile.lua Mon Aug 20 21:20:53 2018 +0200 @@ -74,13 +74,14 @@ if photo and photo[1] then local photo_raw = base64.decode(photo[1]); local photo_hash = sha1(photo_raw, true); + local photo_type = photo.TYPE and photo.TYPE[1]; pep:publish("urn:xmpp:avatar:metadata", true, item_container(photo_hash, st.stanza("metadata", { xmlns="urn:xmpp:avatar:metadata" }) :tag("info", { bytes = tostring(#photo_raw), id = photo_hash, - type = identify(photo_raw), + type = photo_type or identify(photo_raw), }))); pep:publish("urn:xmpp:avatar:data", true, item_container(photo_hash, st.stanza("data", { xmlns="urn:xmpp:avatar:data" }):text(photo[1])));