( channelId: string, limit?: number, before?: number, )
| 97 | } |
| 98 | |
| 99 | export async function getForumPosts( |
| 100 | channelId: string, |
| 101 | limit?: number, |
| 102 | before?: number, |
| 103 | ): Promise<ForumPostsResponse> { |
| 104 | const response = await invokeTauri<RawForumPostsResponse>("get_forum_posts", { |
| 105 | channelId, |
| 106 | limit: limit ?? null, |
| 107 | before: before ?? null, |
| 108 | }); |
| 109 | |
| 110 | return { |
| 111 | posts: response.messages |
| 112 | .filter((m) => m.kind === KIND_FORUM_POST) |
| 113 | .map(fromRawForumPost), |
| 114 | nextCursor: response.next_cursor, |
| 115 | }; |
| 116 | } |
| 117 | |
| 118 | export async function getForumThread( |
| 119 | channelId: string, |
no outgoing calls
no test coverage detected