ChaoticLeah / pronoun-plugin

A fediverse *key plugin that adds pronouns to display names
8 stars 0 forks source link

Username disappears if user.name == null #1

Closed floofylily closed 4 months ago

floofylily commented 4 months ago

Tested version: V3.3.7

When attempting to load the pronouns from a profile, the plugin will replace the display name of the user with user.name + pronouns However, if someone doesn't have a custom display name set, user.name will be null, and so the name will appear something like this: image image

This seems to be done intentionally

if note.user.name == null {
    note.user.name = ""
}

However, I think that it would be better if instead of hiding the name, it was instead set to be equivalent to the user.username variable.

floofylily commented 4 months ago

On closer inspection, I think the issue is with this code on line 321:

var name = note.user.name
if name == null {
    name = note.user.username
}

It checks if note.user.name is null, but that condition will always fail since note.user.name is being set to "" if it is null.

ChaoticLeah commented 4 months ago

Ah right this may be from before the refactor.... oops. Yeah ill take a look into this. Do you have any profiles/posts where I can see this happen?

ChaoticLeah commented 4 months ago

fixed in V3.3.8