Changelog & cleaning.
This commit is contained in:
parent
a5385e99cd
commit
2effa8e4e9
@ -5,6 +5,7 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* Builtin Prosody, Share chat url: ability to show/hide the scrollbar in readonly mode.
|
* Builtin Prosody, Share chat url: ability to show/hide the scrollbar in readonly mode.
|
||||||
|
* Builtin Prosody: display Peertube users avatars.
|
||||||
|
|
||||||
### Minor changes and fixes
|
### Minor changes and fixes
|
||||||
|
|
||||||
|
@ -64,13 +64,13 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
|
|||||||
cache_user[who] = { last_fetch_time = gettime() };
|
cache_user[who] = { last_fetch_time = gettime() };
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
|
|
||||||
local vcard_temp = st.stanza("vCard", { xmlns = "vcard-temp" });
|
local vcard_temp = st.stanza("vCard", { xmlns = "vcard-temp" });
|
||||||
|
|
||||||
vcard_temp:text_tag("FN", ret.displayName);
|
vcard_temp:text_tag("FN", ret.displayName);
|
||||||
vcard_temp:text_tag("NICKNAME", ret.displayName);
|
vcard_temp:text_tag("NICKNAME", ret.displayName);
|
||||||
vcard_temp:text_tag("URL", ret.url);
|
vcard_temp:text_tag("URL", ret.url);
|
||||||
|
|
||||||
if ret.avatar and ret.avatar.path then
|
if ret.avatar and ret.avatar.path then
|
||||||
module:log("debug", "Downloading user avatar on %s", peertube_url .. ret.avatar.path);
|
module:log("debug", "Downloading user avatar on %s", peertube_url .. ret.avatar.path);
|
||||||
local waitAvatar, doneAvatar = async.waiter();
|
local waitAvatar, doneAvatar = async.waiter();
|
||||||
@ -98,5 +98,4 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
|
|||||||
origin.send(st.reply(stanza):add_child(vcard_temp));
|
origin.send(st.reply(stanza):add_child(vcard_temp));
|
||||||
cache_user[who] = { last_fetch_time = gettime(), vcard = vcard_temp };
|
cache_user[who] = { last_fetch_time = gettime(), vcard = vcard_temp };
|
||||||
return true;
|
return true;
|
||||||
end, 1); -- TODO: Negative priority, so if the user has set a custom vCard (mod_vcard_legacy), it will be used?
|
end);
|
||||||
-- TODO: cache results for N seconds
|
|
||||||
|
Loading…
Reference in New Issue
Block a user