From e954c31eba7fd07242be9bbb6278f0f1ca8b2719 Mon Sep 17 00:00:00 2001 From: TeamAbronDev Date: Thu, 2 Jan 2025 15:53:33 +0330 Subject: [PATCH 1/9] dm non friend --- .env | 4 ++-- src/components/common/messaging/MessageBox.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 5436a1ed..1b08a29c 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -VITE_API_URL=https://peptide.chat/api -# VITE_API_URL=http://local.revolt.chat:8000 +# VITE_API_URL=https://peptide.chat/api +VITE_API_URL=http://local.revolt.chat:8000 diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 78c26981..2b2e0bfb 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -45,6 +45,7 @@ import AutoComplete, { useAutoComplete } from "../AutoComplete"; import { PermissionTooltip } from "../Tooltip"; import FilePreview from "./bars/FilePreview"; import ReplyBar from "./bars/ReplyBar"; +import { User } from "@styled-icons/boxicons-regular"; type Props = { channel: Channel; @@ -256,8 +257,8 @@ export default observer(({ channel }: Props) => { ); } - - if (!channel.havePermission("SendMessage")) { + console.log(channel) + if (!channel.havePermission("SendMessage") && channel.recipient?.relationship == "Blocked" || channel.recipient?.relationship == "BlockedOther"){ return ( @@ -275,7 +276,6 @@ export default observer(({ channel }: Props) => { ); } - // Push message content to draft. const setMessage = useCallback( (content?: string) => { From fd25aef5355837eb8708f39f85792f56b2c9f22a Mon Sep 17 00:00:00 2001 From: TeamAbronDev Date: Thu, 2 Jan 2025 15:56:15 +0330 Subject: [PATCH 2/9] change env file --- .env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 1b08a29c..5436a1ed 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -# VITE_API_URL=https://peptide.chat/api -VITE_API_URL=http://local.revolt.chat:8000 +VITE_API_URL=https://peptide.chat/api +# VITE_API_URL=http://local.revolt.chat:8000 From 7fc0d268276f13bf63c94bc6dec10689e455914f Mon Sep 17 00:00:00 2001 From: TeamAbronDev Date: Thu, 2 Jan 2025 16:21:11 +0330 Subject: [PATCH 3/9] invite url --- src/controllers/modals/components/CreateInvite.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/controllers/modals/components/CreateInvite.tsx b/src/controllers/modals/components/CreateInvite.tsx index 0efa3be4..10927a5e 100644 --- a/src/controllers/modals/components/CreateInvite.tsx +++ b/src/controllers/modals/components/CreateInvite.tsx @@ -7,10 +7,10 @@ import { ModalForm } from "@revoltchat/ui"; import { noopAsync } from "../../../lib/js"; -import { IS_REVOLT } from "../../../version"; import { takeError } from "../../client/jsx/error"; import { modalController } from "../ModalController"; import { ModalProps } from "../types"; +import { IS_REVOLT } from "../../../version"; /** * Code block which displays invite @@ -37,6 +37,7 @@ export default function CreateInvite({ }: ModalProps<"create_invite">) { const [processing, setProcessing] = useState(false); const [code, setCode] = useState("abcdef"); + const [url, setUrl] = useState("abcdef"); // Generate an invite code useEffect(() => { @@ -44,7 +45,10 @@ export default function CreateInvite({ target .createInvite() - .then(({ _id }) => setCode(_id)) + .then((res) => { + setUrl(res.url || "default_url"); + setCode(res._id || "default_code"); + }) .catch((err) => modalController.push({ type: "error", error: takeError(err) }), ) @@ -65,7 +69,7 @@ export default function CreateInvite({ ) : ( - {code} + {url} ), }, @@ -79,9 +83,7 @@ export default function CreateInvite({ children: , onClick: () => modalController.writeText( - IS_REVOLT - ? `https://rvlt.gg/${code}` - : `https://${window.location.host}/invite/${code}`, + `${url}` ), }, ]} From a0b4e420e54a5431bd09fbf9c8ce0b4e87679963 Mon Sep 17 00:00:00 2001 From: TeamAbronDev Date: Thu, 2 Jan 2025 16:36:36 +0330 Subject: [PATCH 4/9] invite url --- src/controllers/modals/components/legacy/UserProfile.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/modals/components/legacy/UserProfile.tsx b/src/controllers/modals/components/legacy/UserProfile.tsx index 9cbb150a..fac30f03 100644 --- a/src/controllers/modals/components/legacy/UserProfile.tsx +++ b/src/controllers/modals/components/legacy/UserProfile.tsx @@ -207,7 +207,8 @@ export const UserProfile = observer( )} - {(user.relationship === "Friend" || user.bot) && ( +                        {(user.relationship === "Friend" || user.bot || user.relationship === "None") && ( + Date: Thu, 2 Jan 2025 16:45:39 +0330 Subject: [PATCH 5/9] file permission --- .env | 2 +- src/components/common/messaging/MessageBox.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 5436a1ed..1512e2f3 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ VITE_API_URL=https://peptide.chat/api -# VITE_API_URL=http://local.revolt.chat:8000 +#VITE_API_URL=http://local.revolt.chat:8000 diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 2b2e0bfb..70ee0633 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -627,7 +627,7 @@ export default observer(({ channel }: Props) => { )} - {channel.havePermission("UploadFiles") ? ( + {/* {channel.havePermission("UploadFiles") ? ( */} { }} /> - ) : ( + {/* ) : ( - )} + )} */} Date: Thu, 2 Jan 2025 16:50:33 +0330 Subject: [PATCH 6/9] test push --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 1512e2f3..5436a1ed 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ VITE_API_URL=https://peptide.chat/api -#VITE_API_URL=http://local.revolt.chat:8000 +# VITE_API_URL=http://local.revolt.chat:8000 From ed6e0f3fbe7b27410ff180032462fde85e2d6660 Mon Sep 17 00:00:00 2001 From: teamabron <110968521+teamabron@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:16:44 +0330 Subject: [PATCH 7/9] Update UserProfile.tsx --- src/controllers/modals/components/legacy/UserProfile.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/modals/components/legacy/UserProfile.tsx b/src/controllers/modals/components/legacy/UserProfile.tsx index fac30f03..f9040a66 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 === "None") && ( + {(user.relationship === "Friend" || user.relationship === "None" || user.relationship === "Outgoing" || user.relationship === "Incoming" || user.bot ) && ( Date: Sat, 4 Jan 2025 10:14:40 +0330 Subject: [PATCH 8/9] bug-open closed dms --- src/pages/channels/Channel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/channels/Channel.tsx b/src/pages/channels/Channel.tsx index 55318ad5..ae219cb2 100644 --- a/src/pages/channels/Channel.tsx +++ b/src/pages/channels/Channel.tsx @@ -99,7 +99,7 @@ export const Channel = observer( const client = useClient(); const state = useApplicationState(); - if (!client.channels.exists(id)) { + if (!client.channels.exists(id) && client.servers.get(server_id)) { if (server_id) { const server = client.servers.get(server_id); if (server && server.channel_ids.length > 0) { @@ -110,7 +110,7 @@ export const Channel = observer( target_id = last_id; } } - + return ( Date: Sat, 4 Jan 2025 10:14:54 +0330 Subject: [PATCH 9/9] bug-open closed dms --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 5436a1ed..16d366c6 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -VITE_API_URL=https://peptide.chat/api +VITE_API_URL=https://test.peptide.chat/api # VITE_API_URL=http://local.revolt.chat:8000