ShowMeYourName: compare username & nick case insensitive (#2630)

Co-authored-by: vee <vendicated@riseup.net>
This commit is contained in:
Bloofield 2024-06-26 20:59:24 +10:00 committed by GitHub
parent 32c2128c5b
commit 3688c7e4c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,12 +66,16 @@ export default definePlugin({
const { nick } = author; const { nick } = author;
const prefix = withMentionPrefix ? "@" : ""; const prefix = withMentionPrefix ? "@" : "";
if (username === nick || isRepliedMessage && !settings.store.inReplies)
if (isRepliedMessage && !settings.store.inReplies || username === nick.toLowerCase())
return <>{prefix}{nick}</>; return <>{prefix}{nick}</>;
if (settings.store.mode === "user-nick") if (settings.store.mode === "user-nick")
return <>{prefix}{username} <span className="vc-smyn-suffix">{nick}</span></>; return <>{prefix}{username} <span className="vc-smyn-suffix">{nick}</span></>;
if (settings.store.mode === "nick-user") if (settings.store.mode === "nick-user")
return <>{prefix}{nick} <span className="vc-smyn-suffix">{username}</span></>; return <>{prefix}{nick} <span className="vc-smyn-suffix">{username}</span></>;
return <>{prefix}{username}</>; return <>{prefix}{username}</>;
} catch { } catch {
return <>{author?.nick}</>; return <>{author?.nick}</>;