diff --git a/external/lang b/external/lang
index 47182fb7..456777fc 160000
--- a/external/lang
+++ b/external/lang
@@ -1 +1 @@
-Subproject commit 47182fb7112f82efa61ffe2856f25ca19c78b8c5
+Subproject commit 456777fcf68daaa3d1a5ceb6442f222cdc9e415d
diff --git a/package.json b/package.json
index b6235533..3c711314 100644
--- a/package.json
+++ b/package.json
@@ -77,7 +77,7 @@
"react-scroll": "^1.8.2",
"react-tippy": "^1.4.0",
"redux": "^4.1.0",
- "revolt.js": "4.3.2-patch.1",
+ "revolt.js": "4.3.3-alpha.1",
"rimraf": "^3.0.2",
"sass": "^1.35.1",
"shade-blend-color": "^1.0.0",
diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx
index 86463d3a..ea8391a5 100644
--- a/src/components/common/messaging/MessageBox.tsx
+++ b/src/components/common/messaging/MessageBox.tsx
@@ -1,18 +1,23 @@
import { ulid } from "ulid";
+import { Text } from "preact-i18n";
import { Channel } from "revolt.js";
import styled from "styled-components";
import { defer } from "../../../lib/defer";
import IconButton from "../../ui/IconButton";
-import { Send } from '@styled-icons/feather';
+import { Send, X } from '@styled-icons/feather';
import { debounce } from "../../../lib/debounce";
import Axios, { CancelTokenSource } from "axios";
import { useTranslation } from "../../../lib/i18n";
import { Reply } from "../../../redux/reducers/queue";
import { connectState } from "../../../redux/connector";
+import { SoundContext } from "../../../context/Settings";
import { WithDispatcher } from "../../../redux/reducers";
import { takeError } from "../../../context/revoltjs/util";
import TextAreaAutoSize from "../../../lib/TextAreaAutoSize";
+import AutoComplete, { useAutoComplete } from "../AutoComplete";
+import { ChannelPermission } from "revolt.js/dist/api/permissions";
import { AppContext } from "../../../context/revoltjs/RevoltClient";
+import { useChannelPermission } from "../../../context/revoltjs/hooks";
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";
import { internalEmit, internalSubscribe } from "../../../lib/eventEmitter";
import { useCallback, useContext, useEffect, useState } from "preact/hooks";
@@ -22,8 +27,6 @@ import { SingletonMessageRenderer, SMOOTH_SCROLL_ON_RECEIVE } from "../../../lib
import ReplyBar from "./bars/ReplyBar";
import FilePreview from './bars/FilePreview';
-import AutoComplete, { useAutoComplete } from "../AutoComplete";
-import { SoundContext } from "../../../context/Settings";
type Props = WithDispatcher & {
channel: Channel;
@@ -48,6 +51,14 @@ const Base = styled.div`
}
`;
+const Blocked = styled.div`
+ padding: 15px 0;
+ line-height: 20px;
+ user-select: none;
+ font-size: .875rem;
+ color: var(--tertiary-foreground);
+`;
+
const Action = styled.div`
display: grid;
place-items: center;
@@ -65,6 +76,15 @@ function MessageBox({ channel, draft, dispatcher }: Props) {
const client = useContext(AppContext);
const translate = useTranslation();
+ const permissions = useChannelPermission(channel._id);
+ if (!(permissions & ChannelPermission.SendMessage)) {
+ return (
+
+
+
+ )
+ }
+
function setMessage(content?: string) {
if (content) {
dispatcher({
@@ -272,7 +292,7 @@ function MessageBox({ channel, draft, dispatcher }: Props) {
}} />
-
+ { (permissions & ChannelPermission.UploadFiles) ?
-
+ : undefined }
-
+ { isTouchscreenDevice &&
-
+ }
>
)
diff --git a/yarn.lock b/yarn.lock
index 182a6277..595a23ce 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3412,10 +3412,10 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
-revolt.js@4.3.2-patch.1:
- version "4.3.2-patch.1"
- resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-4.3.2-patch.1.tgz#0c4190f0a640951636c6f2577c9298418b06917f"
- integrity sha512-XAu2JeYc2+OFLM56WktGT/4tAyvjibmNL5oGc5pPZEjl0DnoIxPE96CZPe+35ZCX9bEiuoX378Fwfmfe3uN7sw==
+revolt.js@4.3.3-alpha.1:
+ version "4.3.3-alpha.1"
+ resolved "https://registry.yarnpkg.com/revolt.js/-/revolt.js-4.3.3-alpha.1.tgz#b60a18e5cbe9f2c569e7f46974450931826e10d4"
+ integrity sha512-MxjTOWqg83cLYdpuqLCl3nOTD+jFxSSjrnvczuijam1YjeZ3IB27C6G4Qar3BwMn7B+zH8MgEDecW3YBmKBpIw==
dependencies:
"@insertish/mutable" "1.1.0"
axios "^0.19.2"