Timezones: something something isdm
This commit is contained in:
parent
5b474e9818
commit
82bc3356ea
1 changed files with 7 additions and 3 deletions
|
|
@ -364,10 +364,14 @@ export default definePlugin({
|
|||
let userId = props.message.author.id;
|
||||
|
||||
if (userId === UserStore.getCurrentUser().id) {
|
||||
if (!showOwnTimezone && !recipientTimezoneInDms) return null;
|
||||
|
||||
const channel = ChannelStore.getChannel(props.message.channel_id);
|
||||
if (recipientTimezoneInDms) userId = channel?.getRecipientId() ?? userId;
|
||||
const recipientId = channel?.isDM() ? channel.getRecipientId() : null;
|
||||
|
||||
if (recipientTimezoneInDms && recipientId) {
|
||||
userId = recipientId;
|
||||
} else if (!showOwnTimezone) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return <TimestampComponent userId={userId} timestamp={props.message.timestamp.toISOString()} type="message" />;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue