mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-09 20:33:03 +02:00
Fix null relay hints in DMs
This commit is contained in:
5
.changeset/four-foxes-lay.md
Normal file
5
.changeset/four-foxes-lay.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"nostrudel": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix null relay hints in DMs
|
@@ -289,11 +289,13 @@ export function addPubkeyRelayHints(draft: DraftNostrEvent) {
|
|||||||
...draft,
|
...draft,
|
||||||
tags: draft.tags.map((t) => {
|
tags: draft.tags.map((t) => {
|
||||||
if (isPTag(t) && !t[2]) {
|
if (isPTag(t) && !t[2]) {
|
||||||
const newTag = [...t];
|
|
||||||
const mailboxes = userMailboxesService.getMailboxes(t[1]).value;
|
const mailboxes = userMailboxesService.getMailboxes(t[1]).value;
|
||||||
|
if (mailboxes && mailboxes.inbox.urls.length > 0) {
|
||||||
|
const newTag = [...t];
|
||||||
// TODO: Pick the best mailbox for the user
|
// TODO: Pick the best mailbox for the user
|
||||||
if (mailboxes) newTag[2] = mailboxes.inbox.urls[0];
|
newTag[2] = mailboxes.inbox.urls[0];
|
||||||
return newTag;
|
return newTag;
|
||||||
|
} else return t;
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}),
|
}),
|
||||||
|
@@ -7,11 +7,9 @@ import { Button, Flex, FlexProps, Heading } from "@chakra-ui/react";
|
|||||||
import { useSigningContext } from "../../../providers/global/signing-provider";
|
import { useSigningContext } from "../../../providers/global/signing-provider";
|
||||||
import MagicTextArea, { RefType } from "../../../components/magic-textarea";
|
import MagicTextArea, { RefType } from "../../../components/magic-textarea";
|
||||||
import { useTextAreaUploadFileWithForm } from "../../../hooks/use-textarea-upload-file";
|
import { useTextAreaUploadFileWithForm } from "../../../hooks/use-textarea-upload-file";
|
||||||
import clientRelaysService from "../../../services/client-relays";
|
|
||||||
import { DraftNostrEvent } from "../../../types/nostr-event";
|
import { DraftNostrEvent } from "../../../types/nostr-event";
|
||||||
import { useDecryptionContext } from "../../../providers/global/dycryption-provider";
|
import { useDecryptionContext } from "../../../providers/global/dycryption-provider";
|
||||||
import useUserMailboxes from "../../../hooks/use-user-mailboxes";
|
import useUserMailboxes from "../../../hooks/use-user-mailboxes";
|
||||||
import RelaySet from "../../../classes/relay-set";
|
|
||||||
import { usePublishEvent } from "../../../providers/global/publish-provider";
|
import { usePublishEvent } from "../../../providers/global/publish-provider";
|
||||||
|
|
||||||
export default function SendMessageForm({
|
export default function SendMessageForm({
|
||||||
|
Reference in New Issue
Block a user