fix: Correct handling of create_fulljid without resource

If resource was NULL/"" we otherwise had a trailing slash.
This commit is contained in:
Michael Vetter
2026-03-06 13:09:49 +01:00
parent fa64b135df
commit 35a2f2990a

View File

@@ -250,7 +250,11 @@ gchar*
create_fulljid(const gchar* const barejid, const gchar* const resource)
{
auto_gchar gchar* barejidlower = g_utf8_strdown(barejid, -1);
return g_strdup_printf("%s/%s", barejidlower, resource);
if (resource && strlen(resource) > 0) {
return g_strdup_printf("%s/%s", barejidlower, resource);
} else {
return g_strdup(barejidlower);
}
}
/*