Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions crates/sprout-mcp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,24 @@ impl SproutMcpServer {

let channel_tag = match nostr::Tag::parse(&["channel", &p.channel_id]) {
Ok(t) => t,
Err(e) => return format!("Error building tag: {e}"),
Err(e) => return format!("Error building channel tag: {e}"),
};
let event_ref_tag = match nostr::Tag::parse(&["e", &p.channel_id]) {
Ok(t) => t,
Err(e) => return format!("Error building event-ref tag: {e}"),
};

let keys = self.client.keys().clone();
let event =
match nostr::EventBuilder::new(nostr::Kind::Custom(kind), &p.content, [channel_tag])
.sign_with_keys(&keys)
{
Ok(e) => e,
Err(e) => return format!("Error signing event: {e}"),
};
let event = match nostr::EventBuilder::new(
nostr::Kind::Custom(kind),
&p.content,
[channel_tag, event_ref_tag],
)
.sign_with_keys(&keys)
{
Ok(e) => e,
Err(e) => return format!("Error signing event: {e}"),
};

match self.client.send_event(event).await {
Ok(ok) if ok.accepted => format!("Message sent. Event ID: {}", ok.event_id),
Expand Down
2 changes: 0 additions & 2 deletions desktop/src/app/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export function AppShell() {
: "No channel selected"
}
isLoading={messagesQuery.isLoading}
key={activeChannel?.id ?? "no-channel"}
messages={timelineMessages}
/>
<MessageComposer
Expand All @@ -178,7 +177,6 @@ export function AppShell() {
sendMessageMutation.isPending
}
isSending={sendMessageMutation.isPending}
key={activeChannel?.id ?? "no-channel"}
onSend={async (content) => {
await sendMessageMutation.mutateAsync(content);
}}
Expand Down
5 changes: 4 additions & 1 deletion desktop/src/features/messages/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ function createOptimisticMessage(
pubkey: identity.pubkey,
created_at: Math.floor(Date.now() / 1_000),
kind: 4_0001,
tags: [["e", channelId]],
tags: [
["channel", channelId],
["e", channelId],
],
content,
sig: "",
pending: true,
Expand Down
8 changes: 7 additions & 1 deletion desktop/src/shared/api/relayClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ class RelayClient {
const event = await signRelayEvent({
kind: 40001,
content: content.trim(),
tags: [["e", channelId]],
// Include both tags for now:
// - `channel` lets the relay persist and authorize the event as channel-scoped
// - `e` keeps the existing desktop WebSocket history/subscription filters working
tags: [
["channel", channelId],
["e", channelId],
],
});

return new Promise<RelayEvent>((resolve, reject) => {
Expand Down