From b2fdafd5ff119b86cd3f4c084fcb729d9bb03dbe Mon Sep 17 00:00:00 2001 From: John Livingston Date: Mon, 21 Jul 2025 12:04:29 +0200 Subject: [PATCH] Fix #736: wrong format in Peertube accounts API result can prevent users to log in chat. Can't reproduce the bug (https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/736), but this should fix the issue. --- CHANGELOG.md | 1 + .../mod_vcard_peertubelivechat/mod_vcard_peertubelivechat.lua | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0484298..3ce514cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Minor changes and fixes * Translations updates. +* Fix #736: wrong format in Peertube accounts API result can prevent users to log in chat. ## 14.0.0 diff --git a/prosody-modules/mod_vcard_peertubelivechat/mod_vcard_peertubelivechat.lua b/prosody-modules/mod_vcard_peertubelivechat/mod_vcard_peertubelivechat.lua index 11f32338..825f3287 100644 --- a/prosody-modules/mod_vcard_peertubelivechat/mod_vcard_peertubelivechat.lua +++ b/prosody-modules/mod_vcard_peertubelivechat/mod_vcard_peertubelivechat.lua @@ -37,7 +37,9 @@ local function read_avatar_url(ret) module:log("debug", "User avatar path (Peertube >= v6, width 48): %s", peertube_url .. avatar.path); return peertube_url .. avatar.path; end - if (avatar.width < min_width) then; + -- https://github.com/JohnXLivingston/peertube-plugin-livechat/issues/736 + -- seems that in some case, avatar.width is a table... So we check that it is a number. + if (type(avatar.width) == 'number' and avatar.width < min_width) then; min_path = avatar.path; min_width = avatar.width; end