git » sdk » commit 56ee845

Some doc fixes

author Stephen Paul Weber
2026-05-03 20:50:36 UTC
committer Stephen Paul Weber
2026-05-03 20:50:36 UTC
parent b30a5a4dec170d39e3e1d1275621f5373b057cac

Some doc fixes

docs/c/index.md +6 -5
docs/js/index.md +5 -5
docs/swift/index.md +2 -2

diff --git a/docs/c/index.md b/docs/c/index.md
index 285e325..085bedd 100644
--- a/docs/c/index.md
+++ b/docs/c/index.md
@@ -7,6 +7,7 @@ This guide quickly brings you up to speed on Borogove's C API. The API is flexib
 Let's get started by  initializing the client and setting the current user and persistence layer:
 
 ```c
+#include <stdio.h>
 #include <borogove.h>
 
 int main(void) {
@@ -55,7 +56,7 @@ bool available_chats(void *achat, void *client) {
 	// Allows running searches in parallel as a user types
 
 	if (achat) {
-		chat = borogove_client_start_chat(client, chat);
+		chat = borogove_client_start_chat(client, achat);
 
 		// Don't forget to release your memory
 		borogove_release(achat);
@@ -68,7 +69,7 @@ bool available_chats(void *achat, void *client) {
 
 // And in main...
 
-avilable_chats_iterator = borogove_client_find_available_chats(client, "hatter@example.com");
+available_chats_iterator = borogove_client_find_available_chats(client, "hatter@example.com");
 borogove_available_chat_iterator_next(available_chats_iterator, available_chats, client);
 ```
 
@@ -76,7 +77,7 @@ borogove_available_chat_iterator_next(available_chats_iterator, available_chats,
 
 You can always search by the full ID or URI of any chat on the network. Locally known chats will also be returned, as well as any chats from other services configured on the account.
 
-If you have already used a chat before, you can always get it from `borgove_client_get_chat` or list all known chats with `borogove_client_get_chats`.
+If you have already used a chat before, you can always get it from `borogove_client_get_chat` or list all known chats with `borogove_client_get_chats`.
 
 ## Messages
 
@@ -128,8 +129,8 @@ borogove_release(builder);
 This is how you can listen to events:
 
 ```c
-int otoken = client_add_status_online_listener(client, &online_handler, context_or_null);
-int mtoken = client_add_message_listener(client, &message_handler, context_or_null);
+borogove_event_handler_token otoken = borogove_client_add_status_online_listener(client, online_handler, context_or_null);
+borogove_event_handler_token mtoken = borogove_client_add_chat_message_listener(client, message_handler, context_or_null);
 ```
 
 Handlers run in a background thread separate from your UI or event loop.
diff --git a/docs/js/index.md b/docs/js/index.md
index ec4ef80..e8664e5 100644
--- a/docs/js/index.md
+++ b/docs/js/index.md
@@ -34,7 +34,7 @@ Let's get started by  initializing the client and setting the current user and p
 import * as borogove from "borogove";
 
 // Cache avatars and other media in browser cache
-const mediaStore = borogove.persistence.MediaStoreCache("myapp");
+const mediaStore = await borogove.persistence.MediaStoreCache("myapp");
 
 // Store chats and history in IndexedDB
 const persist = await borogove.persistence.IDB("snikket", mediaStore);
@@ -48,7 +48,7 @@ This example is for in the browser, but for other context only the persistence c
 Now we need to connect to the server, which must be a [Snikket](https://snikket.org)-compatible instance living at `example.com`, and authenticate the user:
 
 ```typescript
-client.addPasswordNeededListener() => {
+client.addPasswordNeededListener(() => {
 	client.usePassword("mycoolpassword");
 });
 
@@ -62,7 +62,7 @@ In real life you probably want to prompt the user when receiving the event. You
 Let’s continue by starting your first chat. A chat contains messages, a list of people that are participating, and optionally a list of members. The example below shows how to start a chat with a new contact:
 
 ```typescript
-async function findOneChat(client: borogove.Client): borogove.Chat {
+async function findOneChat(client: borogove.Client): Promise<borogove.Chat | null> {
 	const iterator = client.findAvailableChats("hatter@example.com");
 	for await (const availableChat of iterator) {
 		return client.startChat(availableChat);
@@ -91,7 +91,7 @@ chat.sendMessage(new borogove.ChatMessageBuilder({
 We can also load the most recent messages from a chat's history:
 
 ```typescript
-const messages = await chat.getMessagesBefore(null, null);
+const messages = await chat.getMessagesBefore(null);
 ```
 
 and send a reply to one of those:
@@ -117,7 +117,7 @@ const onlineEventToken = client.addStatusOnlineListener(() => {
 	console.log(`${client.accountId()} is online and in sync`)
 });
 
-const messageEventToken = client.addMessageListener((message, eventType) => {
+const messageEventToken = client.addChatMessageListener((message, eventType) => {
 	console.log(`Message ${message.body().toPlainText()} received or updated`, eventType);
 });
 
diff --git a/docs/swift/index.md b/docs/swift/index.md
index fae3e00..618b212 100644
--- a/docs/swift/index.md
+++ b/docs/swift/index.md
@@ -72,7 +72,7 @@ Now that we have the chat set up, let's send our first message:
 
 ```swift
 let outgoing = ChatMessageBuilder()
-outgoing.setBody(Html.text("I would like some tea."))
+outgoing.setBody(html: Html.text(text: "I would like some tea."))
 chat.sendMessage(message: outgoing)
 ```
 
@@ -86,7 +86,7 @@ and send a reply to one of those:
 
 ```swift
 let reply = messages[0].reply()
-reply.setBody(Html.text("Is that so?"))
+reply.setBody(html: Html.text(text: "Is that so?"))
 chat.sendMessage(message: reply)
 ```