# HG changeset patch # User Citronalco # Date 1659476700 -7200 # Node ID 8a4b17e2e98435f46932b81d26cadb8823f14f15 # Parent f0fe95f9e21ceb7859b4899139c3cfae78bf683d mod_muc_badge: If room has no title use localpart of room's jid (fixes #1767) Without this patch Prosody shows an HTTP 500 error (Lua 5.1) or a "nil" label in the SVG badge (Lua 5.2) if room has no title set. diff -r f0fe95f9e21c -r 8a4b17e2e984 mod_muc_badge/mod_muc_badge.lua --- a/mod_muc_badge/mod_muc_badge.lua Wed Aug 03 03:14:17 2022 +0200 +++ b/mod_muc_badge/mod_muc_badge.lua Tue Aug 02 23:45:00 2022 +0200 @@ -23,6 +23,7 @@ module:depends"http"; local jid_prep = require "util.jid".prep; +local jid_split = require "util.jid".split; -- Support both old and new MUC code local mod_muc = module:depends"muc"; @@ -76,7 +77,7 @@ for _ in pairs(room._occupants) do count = count + 1; end - local badge_label = (" %s "):format(room:get_name()); + local badge_label = (" %s "):format(room:get_name() or jid_split(jid)); local badge_count = (" %s "):format(string.format(number, count)); local response = event.response;