Files
mcde/programs/dtchat/localui.h
T
lotherk 7025ae866e dtchat: wire the local manager into the UI (T5.8)
localui.c starts the identity, listener, --peer links, pin store and the transfers from the UI: Nearby comes from DcPeers, messages become conversations of the Local peers account, the send hook routes by peer id, the file hooks use the offer dialog and DcFileSend/DcFileRecv with the Xt timer pumping the DcLoop. An unknown pin shows the 6-digit SAS dialog; Codes match stores the pin in peers.json, Reject (or a changed pin) blocks and closes. main.c gains --local/--config/--listen/--peer/--downloads. End-to-end test: a headless peer connected, the dialog was accepted, the pin stored and 'hello ui' appeared in the transcript (screenshot dtchat-t58-pair.png). make mcde-host still blocked by pid 2126511.
2026-11-16 21:06:10 +00:00

25 lines
778 B
C

/*
* localui.h -- the UI side of the local peer mode
*
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
*/
#ifndef _Dtchat_localui_h
#define _Dtchat_localui_h
#include "ui_main.h"
#include "dc_internal.h"
typedef struct DtLocal DtLocal;
/*
* Start the listener, the manual peer links, the pin store and the UI hooks.
* PEERS is owned by the manager (the caller must not free it while running).
* Returns NULL when the identity or the listener cannot be set up.
*/
DtLocal *dtchat_local_start(DtChatUi *ui, DcModel *model, DcPeers *peers,
const char *config_dir, const char *listen_text,
const char *const *peer_text, int npeers, const char *downloads_dir);
void dtchat_local_stop(DtLocal *local);
#endif /* _Dtchat_localui_h */