Remove DMing without Friends UI

pull/1060/head
Anonymous 2024-10-03 16:48:21 +08:00 committed by Harish Vishwakarma
parent 383ad5d543
commit 0e9040e32b
2 changed files with 3 additions and 21 deletions

View File

@ -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 (
<Base>
@ -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 (
<Base>
<Blocked>

View File

@ -207,7 +207,7 @@ export const UserProfile = observer(
</Button>
</Link>
)}
{(user.relationship !== "Blocked" && user.relationship !== "BlockedOther" || user.bot) && (
{(user.relationship === "Friend" || user.bot) && (
<Localizer>
<Tooltip
content={