diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx
index 78c26981..35bd6bab 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 } from "revolt.js";
+import { Channel, User } from "revolt.js";
import styled, { css } from "styled-components/macro";
import { ulid } from "ulid";
@@ -229,6 +229,19 @@ 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 (
@@ -257,7 +270,12 @@ export default observer(({ channel }: Props) => {
);
}
- if (!channel.havePermission("SendMessage")) {
+ if (
+ (channel.channel_type !== "DirectMessage" &&
+ channel.channel_type !== "Group" &&
+ !channel.havePermission("SendMessage")) ||
+ isBlocked()
+ ) {
return (
diff --git a/src/controllers/modals/components/legacy/UserProfile.tsx b/src/controllers/modals/components/legacy/UserProfile.tsx
index dd73d897..6a7ea939 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 === "Friend" || user.bot) && (
+ {(user.relationship !== "Blocked" && user.relationship !== "BlockedOther" || user.bot) && (