Support nested thread replies in desktop (#50)

This commit is contained in:
Wes
2026-03-13 08:38:42 -07:00
committed by GitHub
parent b9bda6b3b0
commit a516b16eda
12 changed files with 864 additions and 120 deletions
+32
View File
@@ -19,6 +19,7 @@ import type {
RelayEvent,
SearchMessagesInput,
SearchMessagesResponse,
SendChannelMessageResult,
SetPresenceResult,
SetChannelPurposeInput,
SetChannelTopicInput,
@@ -152,6 +153,14 @@ type RawSearchResponse = {
found: number;
};
type RawSendChannelMessageResult = {
event_id: string;
parent_event_id: string | null;
root_event_id: string | null;
depth: number;
created_at: number;
};
type RawToken = {
id: string;
name: string;
@@ -501,6 +510,29 @@ export async function getEventById(eventId: string): Promise<RelayEvent> {
return JSON.parse(eventJson) as RelayEvent;
}
export async function sendChannelMessage(
channelId: string,
content: string,
parentEventId?: string | null,
): Promise<SendChannelMessageResult> {
const response = await invokeTauri<RawSendChannelMessageResult>(
"send_channel_message",
{
channelId,
content,
parentEventId,
},
);
return {
eventId: response.event_id,
parentEventId: response.parent_event_id,
rootEventId: response.root_event_id,
depth: response.depth,
createdAt: response.created_at,
};
}
export async function signRelayEvent(input: {
kind: number;
content: string;
+8
View File
@@ -126,6 +126,14 @@ export type RelayEvent = {
pending?: boolean;
};
export type SendChannelMessageResult = {
eventId: string;
parentEventId: string | null;
rootEventId: string | null;
depth: number;
createdAt: number;
};
export type FeedItemCategory =
| "mention"
| "needs_action"