From 0e9040e32b7e8291dd21dd01a767a982141c8248 Mon Sep 17 00:00:00 2001 From: Anonymous Date: Thu, 3 Oct 2024 16:48:21 +0800 Subject: [PATCH] Remove DMing without Friends UI --- .../common/messaging/MessageBox.tsx | 22 ++----------------- .../modals/components/legacy/UserProfile.tsx | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 35bd6bab..78c26981 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -1,7 +1,7 @@ import { HappyBeaming, Send, ShieldX } from "@styled-icons/boxicons-solid"; import Axios, { CancelTokenSource } from "axios"; import { observer } from "mobx-react-lite"; -import { Channel, User } from "revolt.js"; +import { Channel } from "revolt.js"; import styled, { css } from "styled-components/macro"; import { ulid } from "ulid"; @@ -229,19 +229,6 @@ export default observer(({ channel }: Props) => { const renderer = getRenderer(channel); - const isBlocked = () => { - if (channel.channel_type === "DirectMessage") { - const recipient = channel.recipient; - if (recipient instanceof User) { - return ( - recipient.relationship === "Blocked" || - recipient.relationship === "BlockedOther" - ); - } - } - return false; - }; - if (channel.server?.member?.timeout) { return ( @@ -270,12 +257,7 @@ export default observer(({ channel }: Props) => { ); } - if ( - (channel.channel_type !== "DirectMessage" && - channel.channel_type !== "Group" && - !channel.havePermission("SendMessage")) || - isBlocked() - ) { + if (!channel.havePermission("SendMessage")) { return ( diff --git a/src/controllers/modals/components/legacy/UserProfile.tsx b/src/controllers/modals/components/legacy/UserProfile.tsx index 6a7ea939..9cbb150a 100644 --- a/src/controllers/modals/components/legacy/UserProfile.tsx +++ b/src/controllers/modals/components/legacy/UserProfile.tsx @@ -207,7 +207,7 @@ export const UserProfile = observer( )} - {(user.relationship !== "Blocked" && user.relationship !== "BlockedOther" || user.bot) && ( + {(user.relationship === "Friend" || user.bot) && (