SMYN: Don't overwrite webhook names. (#338)
* Don't overwrite webhook names. * Syntax.
This commit is contained in:
parent
8e3cadaa5e
commit
a3449f747f
1 changed files with 3 additions and 2 deletions
|
|
@ -306,10 +306,11 @@ function getMemberListProfilesReactionsVoiceNameElement(props: memberListProfile
|
|||
function getMessageName(props: messageProps): [string | null, JSX.Element | null, string | null] {
|
||||
const { hideDefaultAtSign, replies } = settings.use();
|
||||
const { message, userOverride, isRepliedMessage, withMentionPrefix } = props;
|
||||
const isWebhook = !!message.webhookId && !message.interaction;
|
||||
const channel = ChannelStore.getChannel(message.channel_id) || {};
|
||||
const target = userOverride || message.author;
|
||||
const user = UserStore.getUser(target.id);
|
||||
const member = GuildMemberStore.getMember(channel.guild_id, target.id);
|
||||
const user = isWebhook ? target : UserStore.getUser(target.id);
|
||||
const member = isWebhook ? null : GuildMemberStore.getMember(channel.guild_id, target.id);
|
||||
const author = user && member ? { ...user, ...member } : user || member || null;
|
||||
const mentionSymbol = hideDefaultAtSign && (!isRepliedMessage || replies) ? "" : withMentionPrefix ? "@" : "";
|
||||
return renderUsername(author, channel.id, message.id, isRepliedMessage ? "replies" : "messages", mentionSymbol);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue