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.
This commit is contained in:
John Livingston
2025-07-21 12:04:29 +02:00
parent 759e1b8f6c
commit b2fdafd5ff
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
### Minor changes and fixes ### Minor changes and fixes
* Translations updates. * Translations updates.
* Fix #736: wrong format in Peertube accounts API result can prevent users to log in chat.
## 14.0.0 ## 14.0.0

View File

@ -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); module:log("debug", "User avatar path (Peertube >= v6, width 48): %s", peertube_url .. avatar.path);
return peertube_url .. avatar.path; return peertube_url .. avatar.path;
end 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_path = avatar.path;
min_width = avatar.width; min_width = avatar.width;
end end