McdeSys gains mcde_sys_print_file(path, printer): it looks for lp(1)
(/usr/bin, /usr/local/bin, /usr/sbin, pkg prefix; MCDE_PRINT_COMMAND
overrides it for tests), passes -d PRINTER when one is named, and runs it
as the existing job (fd into the event loop, finish/cancel). dtpaint links
libMcdeSys, adds File > Print... (Ctrl+P): it picks the default queue from
mcde_sys_printers (or the first), writes the image to /tmp/dtpaint-PID.bmp,
starts the job and removes the file when the job ends; errors and 'no
printer is set up' go to the information dialog. Measured under Xvfb with
MCDE_PRINT_COMMAND=fake lp: argv '-d HP_LaserJet_M110w_CC1016
/tmp/dtpaint-3543226.bmp', the fake copied a valid 640x480 BMP and the
temporary file was gone; no physical page was printed (the real queue is
the user's step).
OpenBMP now dispatches on the file: 24-bit BMP keeps the proven path
(OpenBMP24), 8-bit palette BMP decodes uncompressed and RLE8 (count/value,
end-of-line, end-of-bitmap, delta, absolute runs with word padding, top-down
and bottom-up), and the first image of a .ico decodes 1/4/8/24/32 bpp
(BGRA with alpha 0 composited onto the background; PNG-compressed icons are
refused because there is no PNG decoder). All three go through one RGB
buffer and SetImageRGB, which allocates distinct colours in one batch on
PseudoColor. Measured under Xvfb: ImageMagick's RLE8 160x100 gradient opens
and shows the gradient; a 64x64 32-bpp ICO opens with its four colours;
24-bit -selftest still passes.
Image > Attributes... (Ctrl+E) asks width and height (1..4096), builds a
new pixmap filled with the background, copies the overlap and discards the
selection; the resize is a document operation, so undo starts fresh after
it. Colors > Edit Colors... opens three RGB scales initialised from the
current foreground; OK allocates the colour and updates the fg square.
Both dialogs are FormDialogs with OK/Cancel from the catalog; the form size
is set after popup so the shell does not shrink to its children.
Measured under Xvfb: 640x480 -> 300x300 canvas; Red 255 + OK draws a red
line and turns the fg indicator red.
Select drags a box, Free-Form Select traces a lasso; both draw an XOR
marquee (scaled with the zoom), keep the pixels, and can be dragged to move
them: the snapshot is the undo base, the selected pixels float in a pixmap,
and a 1-bit polygon mask clips clear/paste for the lasso. Edit > Clear
Selection (Del) clears the selected pixels and deselects; Edit > Select All
(Ctrl+A) selects the whole image; the Clear Selection item is sensitive only
while a selection exists. A non-selection tool's click deselects, as in the
reference. Measured under Xvfb: box marquee, move of a scribble (outside
pixels stay), Delete clears it, lasso marquee around a dot and Delete clears
just that dot, Ctrl+A marks the image and enables the menu item.
Curve is the reference's two-phase tool: drag the two end points, release,
then move to bend the quadratic Bezier and click to commit. Polygon adds a
vertex per left click, previews the open outline with a rubber line to the
pointer, and closes on a right click or a double click; leaving the tool
restores the snapshot. Both keep the one-step undo (snapshot at the first
press). Measured under Xvfb: a bent curve from (300,200) to (500,300)
through (400,150); a closed quadrilateral; Undo removes the polygon and
keeps the earlier curve.
Airbrush sprays random foreground/background dots in a 15-pixel square
while dragging; Text opens a prompt dialog, then fills the text box with
the background colour and draws the string in the foreground colour with
the GC's font (the image stays 1:1 at any zoom). The prompt's OK button
is a gadget whose callback widget is the SelectionBox itself, so the text
field is found there, not under XtParent. Measured under Xvfb: spray dots
on the canvas; 'Hello dtpaint' appears at the clicked point.
The magnifier cycles the factor (left up, right down); View > Normal Size
(Ctrl+PgUp) and Large Size (Ctrl+PgDn) set 1x and 4x. The canvas grows to
image*zoom inside the scrolled window; Expose samples only the exposed
rectangle into an XImage (nearest pixel), and pointer events divide by the
factor, so drawing and the status line stay in image coordinates.
Measured under Xvfb: 1x 640x480 -> 2x 1280x960 -> 4x 2560x1920, a line
drawn at 4x appears at the same image coordinates at 1x.
DoSave(curPath) passed curPath as both the destination and the source of
snprintf, which is undefined; glibc emptied it, so after Ctrl+S the title
fell back to 'untitled' and the next Save opened Save As again. Copy only
when the pointers differ. Found while verifying the PseudoColor path on
Xvfb depth 8 (4-colour BMP round trip exact, selftest PASS); recorded in
AGENTS.md.
main.c uses xmScrolledWindowWidgetClass (paneScroll, added in ad02893dde)
but never included <Xm/ScrolledW.h>, so any full make install / the MCDE
PLIST gate died at dtsystemsettings-main.o with 'xmScrolledWindowWidgetClass
undeclared'. One include, alphabetical among the Xm headers. Found while
running the PLIST gate for the dtpaint review (t0704); -fsyntax-only clean.
Review of programs/dtpaint found and this fixes:
- Picker crash: a click in the grey strip below the image reached
XGetImage outside the pixmap (BadMatch, X_GetImage). The canvas is now
a drawing area of exactly the image size inside a scrolled window, and
CanvasInput bounds-checks; large BMPs scroll instead of being clipped.
- Undo: one snapshot taken before every image-changing operation (pencil,
brush, eraser, fill, shapes, invert, flip, clear) and refreshed after a
load; previously only shape tools snapshotted and OpenBMP left snap
uninitialized, so Undo after Open turned the image black.
- Menus: Clear Selection and Edit Colors were wired to Clear Image and
About; they are now insensitive until D3/D4. Help Topics is real.
Accelerator text shown; Clear Image uses 'Ctrl Shift<Key>N' (the old
'Ctrl<Key>Shift<Key>N' never fired).
- Save remembers the path and title, asks before New/Open/Exit when
dirty (Discard/Keep), and reports open/save errors in a dialog instead
of stderr; the per-tool-change stderr debug is gone.
- Colour model: fg/bg are pixels (picker takes any colour, right button
sets background) with a drawn fg/bg indicator; toolbox is radio with
the indicator hidden (one sunken tool); swatches are 16x16.
- Open/Save/Invert no longer do one X round trip per pixel: TrueColor
converts through the visual's masks, other visuals batch the distinct
colours. Measured on a 1024x768 BMP: open 18.3 s -> 0.02 s, invert
14.9 s -> 0.05 s, save 6.3 s -> 0.23 s.
- FloodFill is scanline with a growing seed stack, not 4 neighbours per
pixel; XmString leaks freed; message dialogs destroy their shell.
- Catalog grows to 34 messages; the German copy transliterates umlauts
(core font has no UTF-8 rendition), re-measured under de_DE.UTF-8.
-selftest now also checks the BMP round trip and double invert/flip: PASS.
Builds clean under -Wall -Wextra -Werror; PLIST gate ok (3714 installed).
Left column is a Form so the colour box never overlaps the canvas.
- dtsystemsettings: the shell is 1022x550 and stays so (min/max equal); every
pane lives in it instead of growing the window (thirteen per-pane
XtVaSetValues(shell, width, height) calls are gone), and a taller pane
scrolls (the pages sit in an XmScrolledWindow with XmAUTOMATIC).
- panes.c: CDs & DVDs had no icon (Dtmedia.m.pm does not exist) - it shows
IrixCD.m.pm; Energy Saver shows SDtpowermgr.m.pm; Accounts had the same icon
as Startup (DtStart.pm) and shows McdeUser.t.pm. The "Startup Disk" entry
and the disabled "Dock" entry (no icon, PANE_LATER) are removed.
- McdePrefs: the tab strip is one of many (XmNradioBehavior,
XmNradioAlwaysOne). Without it every visited tab stayed pressed
(measured 2026-11-21: Keyboard, Mouse and Shortcuts all down at once).
- dttoolbox: the window title is "dttoolchest" (msg 1 of the catalog).
- McdeSys: mcde_sys_keyboard_is_mac asks the machine (hw.model "Mac...")
before usbdevs. At session start the internal keyboard may not be
enumerated yet, so dtkeys took a MacBook for a PC keyboard and exchanged
Alt and Command (_MCDE_KEYS said "pc", measured 2026-11-21).
Measured on the MacBook: keyboard _MCDE_KEYS "pc" with an Apple Internal
Keyboard / Trackpad on usb1 port 2 addr 7.
The session ran with LANG=C although dtlogin passed LANG=en_US.UTF-8 to
Xsession (dtlogin -debug 3: 'LANG=en_US.UTF-8'; ps -e on Xsession showed it).
Xsession is a ksh93 script, and ksh93 93u+m 1.0.10 on NetBSD rejects LANG as
'en_US.UTF-8: unknown locale' and leaves it empty when PATH comes earlier in
the environment (put_lang -> libast setlocale); Xsession then set LANG=C.
Measured in the installed system: env -i PATH=/bin:/usr/bin LANG=en_US.UTF-8
ksh93 -> empty, LANG before PATH -> kept, no PATH -> kept. verify.c now
creates LANG right after LOGNAME; setLang() replaces the value in place.
Tests: test-desktop-login's LOGIN and CORES checks matched padded ps and wc
output ('CORES= 0'); install-simple's .local lookup is bounded to 5 s per
round (the loop outlasted ENDCHK's 300 s without a network).
libICE creates it only as root and NetBSD creates it nowhere; the session
log said '_IceTransmkdir: ERROR: euid != 0, directory /tmp/.ICE-unix will not
be created' and dtsession had no local ICE socket, its clients going over
TCP to the host name (2026-11-18). dtlogin (root) makes it 1777 next to
/var/dt, as libICE itself would.
sys.resources/sys.font gave *Font and *FontSet as
'-dt-interface user-medium-r-normal-m*-*-*-*-*-*-*-*-*'. The first match the
server lists for that alias is ...-gb2312.1980-0, a two-byte font: Motif drew
ASCII two bytes per glyph and every menu bar, label and the dtbar status read
as Chinese ('Fi' = 0xC6E9 = GB2312 '崎'). With iso8859-1 named, dtfile's labels
read 'Back', 'Forward', 'DEVICES' (xrdb -merge in the installed VM,
2026-11-18).
- dtlogin Xconfig: Dtlogin*language en_US.UTF-8 on NetBSD. dtlogin has
no DEF_LANG there and rc.d passes no LANG: every session ran with LANG=C
(Konrad, 2026-11-18: 'default soll en_US.UTF-8 sein').
- types/Makefile.am: tradcpp does not expand macros inside '...', and the
actions quote their commands; 'CDE_INSTALLATION_TOP/bin/dthelpgen' reached
dthelp.dt, dt.dt, dtfile.dt, uxstd.dt, develop.dt, xclients.dt unexpanded
('sh: CDE_INSTALLATION_TOP/bin/dthelpgen: not found' in ~/.dt/errorlog).
The paths are filled in by sed after cpp.
- 0079.dtcursor: $CDE_INSTALLATION_TOP is no session variable (the path
was /share/icons); derived from DT_BINPATH.
The login went back to the greeter: dtsession dumped core
(~/dtsession.core, SIGSEGV in strlen <- strdup <- SmsRegisterClientReply
<- SmXSMP.c:562, return address 0x1fb5c in the PIE). NetBSD builds libSM
without UUID support, so SmsGenerateClientID derives the ID from the host
name's address and returns NULL when the name does not resolve (sm_genid.c,
getaddrinfo) -- an offline machine whose name is not in /etc/hosts, the
installed test VM, the workstation without network.
- src/external/mit/xorg/lib/libSM/Makefile: -DHAVE_UUID_CREATE, libc's DCE
uuid_create/uuid_to_string (the branch sm_genid.c has for FreeBSD).
- dtsession SmXSMP.c: a NULL ID refuses that client instead of killing the
session manager.
Running it as root made it enforce access control, and the display manager's
own connection then failed before the greeter ('Authorization required, but
no authorization protocol specified'). As nobody it cannot read the -auth
file and serves without access control, which is how this display has always
worked; the session now uses the user's ~/.Xauthority (previous commit).
With the server running as root it enforces access control (it can read
-auth now), and WaitForServer's XOpenDisplay in the parent had no
authorization: 'Authorization required, but no authorization protocol
specified' and 'Server for display :0 can't be started' (2026-11-18).
SetAuthorization(d) is called before the wait, as the server child already
did.
SetUserAuthorization() writes ~/.Xauthority for the user (and sets
XAUTHORITY itself when it has to use the fallback file), but the session
environment then named the server's auth file -- 0600 root, unreadable for
the user. dtsession could not open the display and dtlogin went back to the
greeter (measured 2026-11-18; dtsession runs fine when XAUTHORITY names
~/.Xauthority).
Two causes of 'the login goes back to the greeter', both measured in the
installed VM 2026-11-18:
- Xservers.src ran the server as the pseudo-user nobody on NetBSD; it could
not read its own -auth file (0600 root) and the session could not open the
display. NetBSD's xdm runs the server as root; NetBSD gets
local_uid@console root now, as Solaris and OpenBSD already had.
- dm.c's dtMakeDefaultDir made /var/dt/appconfig and appmanager 0755 root;
dtsession creates its directory there as the user and died with
'MakeDirectory: /var/dt/appconfig/appmanager/<user>-<host>: Permission
denied'. appconfig and appmanager are 0777, tmp is 1777.
Xstartup's last line is 'exec sessreg -a ...' and Xreset's 'sessreg -d ...'.
configure (AC_CHECK_PROGS(SESSREG, sessreg)) recorded the bare name from the
build host, and Dtlogin*userPath had no /usr/X11R7/bin -- where NetBSD's
sessreg is. The session setup died with 'Xstartup[57]: exec: sessreg: not
found', dtlogin restarted the greeter: the password was accepted and the
login bounced (measured in the installed VM 2026-11-18, Xerrors).
- pkgsrc/Makefile: ac_cv_prog_SESSREG=/bin/sessreg
- dtlogin/config/Xconfig.src: NetBSD's userPath carries /usr/X11R7/bin
(xrdb, xset, xmodmap too)
- tools/install-simple.sh: answer the museum question (it hung there)
- tools/test-desktop-login.sh: the greeter test rebuilt: root shell first,
wait for X and dtgreet before typing (keys sent too early were lost), -g
restarts dtlogin with -debug.
build/logs/userland-2026-11-17f.log:22437: the 25 test programs of
libDtChat, dtchat-demo and McdeSys's test_audio/test_netwatch were
noinst_PROGRAMS, so the package build compiled them for NetBSD and
tools/check-buildtools.sh took them for build tools. configure.ac has
MCDE_CROSS now; in a cross build they are check_PROGRAMS (dtchat-demo
EXTRA_PROGRAMS), in a native one noinst as before, so tools/mcde-tests.sh
still finds them in build/mcde-host. autoreconf -fi of the tree: exit 0,
the Makefile.in lines are @MCDE_CROSS_TRUE@check_PROGRAMS /
@MCDE_CROSS_FALSE@noinst_PROGRAMS.
Every manual page of MCDE is ${PLIST.docs} in the PLIST; dtchat's man_MANS
installed it in a --disable-docs build too, and pkgsrc's check stopped
wm/mcde (build/logs/userland-2026-11-17e.log:22217).
dtlogin.src/dtsession.src: NetBSD keeps `include display_manager'; every
other system gets the stack of the CDE import (7a787b72c5) again -- Linux
has no display_manager file, so a native build had a PAM file that denied
every login.
Xsession.src: MAIL is $HOME/.mail/INBOX, the file dtwm's mail indicator
watches (Dtwm.defs.src:184, 6266bc5031); the folder and the file are made
at login.
Makefile.am: 0079.dtcursor (t0301) was in the tree and in the PLIST but
not in dist_xsess_SCRIPTS, so it was never installed.
Telegram and WhatsApp learn a document's SHA-256 only when the transfer is
finished, so their file-offer carries none and the digest comes with
file-end. The UI used to verify only the offer hash, which meant those two
paths wrote the bytes unchecked. accounts_run now takes the offer's hash
when there is one and the file-end's otherwise, hashes the .part file after
the last chunk and renames only on a match; a mismatch still removes the
part file and reports it in the status line and the transcript.
The fake adapter gained the matching modes: latehash offers without a hash
and sends the right one in file-end, badendhash sends a wrong one there.
tests/file_ui.sh drives all four shapes through the real UI under its own
Xvfb with DTCHAT_TEST_FILE_ACCEPT: files and latehash write the verified
hello world, badhash and badendhash are rejected and leave neither the file
nor a .part. Measured with the built binaries: four ok, exit 0.
Harness entry DtChat/file_ui added; the full run is 53 ok/0 bad
(make mcde-host exit=0, build/logs/mcde-host-2026-11-17-endhash.log).
The adapter's exit path called xmpp_disconnect(conn) unconditionally; when the process ended before connecting (hello only, stdin closed), libstrophe crashed on the NULL connection. The call is now inside the existing conn != NULL branch, so the installed dtchat-xmpp answers hello and exits cleanly.
dtchat-telegram joins bin_PROGRAMS (always built: TDLib when available, otherwise a stub that reports the missing library); dtchat-xmpp is installed when MCDE_STROPHE built it; the Go-built dtchat-whatsapp is installed by install-exec-hook when MCDE_GO is set. The PLIST lists dtchat-telegram unconditionally and the other two behind PLIST_VARS xmpp/whatsapp (left unset in the recipe, so a target without libstrophe/Go omits them while the host build installs all three). The accounts editor's default adapter path becomes <bindir>/dtchat-<protocol> in the packaged layout. Host build and mcde-linux install/plist follow.
DTCHAT_WHATSAPP_FAKE_FILE makes the fake adapter offer that file (name, size, SHA-256), and on file-accept read it in 4 KiB blocks, emit file-data and a file-end carrying the hash; the real accept path (DownloadAny) now also sends the SHA-256 in file-end, and the static fake keeps its hello-world hash. tests/whatsapp_fake.py uses a 9000-byte deterministic file, checks the offer name/size/hash, reassembles every chunk byte-for-byte and verifies the file-end hash (31 checks, green stand-alone). Harness entry already exists; in-tree build and harness follow.
The dialog now edits real accounts instead of in-memory demo entries: the schema is Label, Protocol (irc/xmpp/telegram/whatsapp/demo), Adapter path, Settings (JSON) and Secrets (JSON). It loads accounts.json/secrets.json through the runtime (label, protocol, adapter, settings, masked secrets), and Save builds the complete accounts/secrets documents for every account, extracts label/protocol/adapter and parses the two JSON fields, then calls the runtime's writer. The runtime saves via dc_store_save_accounts/_secrets (files 0600), swaps its stored JSON, removes deleted accounts from the model, and restarts all adapters from the new set; the UI data pointers are refreshed. Add/Delete/Save semantics are now file-backed. Verified through the real UI under Xvfb: Add filled (Label 'Fake via UI', adapter /tmp/opencode/fake_adapter, settings {"mode":"echo"}), Save wrote both files (0600) and started the fake adapter online; restarting dtchat shows the account and all fields again (screenshots dtchat-accounts-editor.png, dtchat-accounts-loaded.png). In-tree build and harness follow.
An incoming messageDocument is remembered with its TDLib file id; file-accept sends downloadFile (priority 1, whole file) and updateFile is followed until local.is_downloading_completed, then the local file is read in 4 KiB blocks and sent as file-data with a file-end carrying the SHA-256 computed with dc_file_sha256. Unknown offers answer file-error. The fake mode can offer a real local file through DTCHAT_TELEGRAM_FAKE_FILE and exercises the same read/hash/chunk/event path; tests/telegram_fake.py now uses a 9000-byte file, checks the offer size and SHA-256, reassembles the chunks byte-for-byte and verifies the file-end hash (25 checks, green stand-alone). The adapter links CRYPTOLIB for EVP/dc_file_sha256. The TDLib downloadFile/updateFile branch is compiled but not exercised without an account. Full build and harness follow.
Conversation > Join Channel opens a Motif prompt (channel on IRC or room on XMPP); the OK callback calls the new join hook with the current account. accounts_run sets the hook, sends dc_adapter_join, adds the conversation (channel for IRC, group otherwise) and shows it; the adapter's conversation event updates it later. The IRC adapter now handles the join and part commands (JOIN <conv>, PART <conv> :reason) instead of ignoring them; XMPP already implemented join. Tests: tests/irc_join.py checks JOIN #new on the wire, the self-JOIN conversation event, PART #new and a clean bye (10 checks, standalone built adapter green); the UI path was verified with the fake adapter under Xvfb (DTCHAT_TEST_JOIN=#new -> 'accounts fake: join #new' and conversation #new) and the dialog screenshot build/mcde-shots/dtchat-join-dialog.png. Harness entry added (51). In-tree build follows.
Telegram: updateUser becomes roster events (name and online from userStatus), the typing command sends sendChatAction (typing/cancel), file-send sends a document via inputFileLocal, an incoming messageDocument becomes a file-offer, and the fake mode emits two contacts, an offer, data/end on accept and file-sent. WhatsApp: Connected emits the address-book contacts as roster, the typing command uses SendChatPresence and incoming ChatPresence becomes typing events, file-send uploads and sends a DocumentMessage, an incoming DocumentMessage becomes a file-offer (download on accept), and the fake mode emits contacts, an offer with SHA-256, data/end on accept, a typing echo and file-sent. tests/telegram_fake.py (24 checks) and tests/whatsapp_fake.py (28 checks) cover all of it and pass with the stand-alone binaries. In-tree build and harness follow; real incoming downloads and accounts remain.
The Go adapter encodes every whatsmeow QR code with github.com/skip2/go-qrcode and sends both the text (qrText) and the module bitmap the UI's request dialog already understands: qr {width,height,data}, one byte per module, 1 = dark, quiet zone included, base64. The fake pairing goes through the same request function, so tests/whatsapp_fake.py now checks a square bitmap, one byte per module, both module values and the empty quiet-zone corner; all 17 checks pass with the stand-alone binary. go.mod/go.sum carry the new module. In-tree build and harness follow.
Telegram: telegram_adapter.c speaks protocol v1 with settings api_id/api_hash/phone/database, TDLib 1.8.57 through td_json (setTdlibParameters, phone/code/password as request/answer, updateNewMessage, sendMessage), states and disconnect; without TDLib it still answers hello and reports the missing library as a fatal error. Debian's versioned TDLib directories are found by configure (header and lib scan) and passed as TDLIB_CPPFLAGS/TDLIBLIB; the adapter is always built (stub without the library). WhatsApp: a Go program under whatsapp_adapter/ with go.mod/go.sum using whatsmeow from the module cache and modernc sqlite, QR pairing through whatsmeow, message events and SendMessage; without Go it is not built (MCDE_GO). Its QR is sent as qrText, which the request dialog now shows when there is no bitmap. Both adapters have DTCHAT_*_FAKE modes; tests/telegram_fake.py (15 checks) and tests/whatsapp_fake.py (13 checks) drive hello, configure, connect, the pairing request/answer, online, send echo and bye, all green stand-alone. The harness runs them when the binaries exist (50 entries with both). TDLib and golang-go were installed with apt; the WhatsApp module builds with GOPROXY=off from the cache. Real accounts, QR bitmap and files follow.
The adapter requests the message-tags capability when the server offers it (together with sasl when a password is set) and remembers the ACK. Incoming @+typing=active|paused tags on TAGMSG or PRIVMSG become typing events with conv (channel or sender), on and who; the typing command sends @+typing=active|paused TAGMSG <conv> through the output queue, and is ignored when the capability was not negotiated. tests/irc_typing.py offers message-tags, checks the CAP REQ, sends alice's active/paused TAGMSGs, and verifies the adapter's own TAGMSG lines for typing on/off; all checks pass. The four existing IRC fake-server suites (adapter, channels, messages, reconnect) still pass with the new binary. In-tree build and harness follow.
The UI gains a typing hook: XmNmodifyVerifyCallback sends typing on for the first change (and after a pause) with the current conversation, resets a 2.5 s timeout that sends off, finishes the old conversation when the selection changes, and ignores programmatic set_input (suppress flag). accounts_run sets the hook to dc_adapter_send_typing of the account that owns the conversation, so XMPP sends XEP-0085 composing/paused; the IRC adapter ignores the command it does not implement. DTCHAT_ACCOUNTS_DEBUG logs the on/off transitions. In-tree build and a focus-based check follow.
The file protocol now carries the sender's SHA-256: the adapter computes it with dc_file_sha256 for an outgoing transfer, puts it into the IBB open metadata (urn:dtchat:file:0 sha256 attribute) and into file-sent, and passes the attribute of an incoming open through in file-offer. The UI stores the offered hash, hashes the part file at file-end and only renames when it matches; a mismatch removes the part file, reports 'file rejected: checksum mismatch' in the status line and the transcript, and never exposes the bytes under the final name. The fake adapter offers the correct hash in mode files and a wrong one in mode badhash. tests/xmpp_ibb.py checks the SHA-256 in the outgoing open and in the incoming offer. Verified stand-alone under Xvfb: mode files writes the 11-byte hello world, mode badhash leaves no file and no .part; the XMPP IBB suite passes with the hash checks. In-tree build and harness follow.
accounts_run.c handles file-offer/file-data/file-end/file-reject/file-error: an offer creates the conversation and opens the existing file dialog, accepts send file-accept and write the base64 chunks into NAME.part (0600) in the state directory, file-end renames to a free name and adds a system line to the transcript, a reject sends file-reject and removes the part file; a file-sent confirms our own transfer. The runtime sets the UI file hook, so Conversation > Send File now works for an adapter account: send_file_cb falls back to the open conversation when there is no Nearby peer, and the hook sends file-send with the generated id. dc_adapter_send_file()/dc_adapter_file_answer() are the core side. The offer dialog was only 128x52 because its shell size was overridden before the popup; it now sets form and shell and repeats after 50 ms, and the timer is removed on destroy. The fake adapter gained a 'files' mode (offer, data, end on accept, reject on reject, file-sent on send). Verified under Xvfb: offer dialog 460x190, Accept by click writes hello world (11 bytes), Reject leaves no file, and DTCHAT_TEST_UI_SEND_FILE produces file-send/file-sent; screenshots build/mcde-shots/dtchat-file-offer.png and dtchat-file-received.png. In-tree build and harness follow.
xmpp_adapter.c uses EVP_EncodeBlock/DecodeBlock; the transitive -lcrypto of libDtChat.la is not enough for the program link (DSO missing from command line), so dtchat_xmpp_LDADD names CRYPTOLIB explicitly.
The adapter protocol gains additive file events: file-send (conv, id, name, path), file-accept/reject/cancel commands, and file-offer/file-data/file-end/file-sent/file-reject/file-error events, with a 32 MiB limit, 4 KiB blocks and an explicit accept before data flows; docs/reference/dtchat-adapter-protocol.txt defines them. xmpp_adapter.c implements XEP-0047: outbound open (with the name/size in a urn:dtchat:file:0 child), base64 data IQs acknowledged one by one and close, then file-sent; inbound open is held until file-accept answers the IQ, data chunks become file-data events, close becomes file-end, and a reject is an IQ error. libstrophe serialises a tag's text through a separate text stanza (set_text on a named tag returns -2), which the data blocks now do. tests/xmpp_ibb.py drives a minimal server: outgoing bytes arrive unchanged, an accepted incoming file yields offer/data/end with the right size, and a rejected offer becomes an IQ error; all 26 checks pass, exit 0, no stderr. The UI file path for adapter accounts (offer dialog, accept, writing the chunks) is the next piece; the adapter itself is complete.
conn_handler used to send a bye and exit 0 on any disconnect, which the core reads as an intentional stop. Now an unexpected end of the stream (or a failed connection) reports offline, sends no bye and exits 1: DcAdapter's existing restart policy starts the process again with backoff and the hello/configure/connect handshake repeats (the policy is covered by DtChat/test_adapter). A requested disconnect still leaves through handle_command with quitting set, bye and status 0. tests/xmpp_drop.py closes the stream after the bind and checks status 1, the offline state and no bye; xmpp_fake.py and xmpp_muc.py still pass, all with the standalone adapter. In-tree build/tests follow.
accounts_run.c loads accounts.json (id, protocol, label, adapter, settings, enabled) and secrets.json (per account id) and starts one DcAdapter per enabled account, pumping the DcLoop from an Xt timeout. Its events go into the model and the panel: state into the status line, conversation (direct/channel/group) and roster entries into the model (roster sets presence), messages into the transcript via dtchat_ui_message_added, presence/typing/errors into the status/dialog, request events into the existing request dialog with the answer routed to that adapter. The UI send hook resolves the selected account (dtchat_ui_current_account) or the account that owns the conversation and calls dc_adapter_send_text; dtchat_accounts_join/_typing expose join and XEP-0085 for menus and tests. Normal GUI runs (not --demo/--local/--perf/--smoke) start with an empty model and the configured accounts; the demo peers are gone in that mode. dtchat-irc is installed next to dtchat and listed in the PLIST; dtchat-xmpp and the demo adapter remain build artifacts. Verified with the fake adapter under Xvfb (accounts fake: starting/online/sent alice/message alice), including the real UI send path (DTCHAT_TEST_UI_SEND), screenshot build/mcde-shots/dtchat-accounts.png; --smoke-test still passes.
join sends a presence to room/nick with the http://jabber.org/protocol/muc <x/>; the room's self-presence is answered with a conversation event (kind group, title room), other occupants are reported as presence events with buddy=room/nick, groupchat messages are filed under the room with the sender's nick in from, and part sends an unavailable presence. The nick is the JID's local part. The hello caps gain muc. tests/xmpp_muc.py drives a minimal server through stream, SASL PLAIN, bind, join (checks the MUC element), self-presence, alice's presence, a groupchat message and the part; all 17 checks pass, exit 0, no stderr. UI wiring for adapter accounts is still open, as is the live test.
After the bind the adapter enables XEP-0280 carbons and unwraps sent/received forwarded messages: a message another of our resources sent becomes a normal message event with self=true and the contact as conv, a received one self=false. XEP-0085 chat states are handled before the body: composing emits typing on, paused/active/inactive/gone off. The typing command sends composing or paused to the conversation, and dc_adapter_send_typing() puts it on the core side. tests/xmpp_fake.py checks carbons were enabled, the forwarded message (self, conv bob, text), typing on/off from bob, and that a typing command reaches the server as <composing> addressed to bob. Standalone adapter: all checks ok. The UI does not send typing for adapter accounts yet (adapter account wiring is still open), which the commit documents.
After the bind the adapter sends <presence/> and asks for the roster (iq get, jabber:iq:roster) and handles the result and pushes: every item becomes a roster event with the contact's id, name, subscription and current online state. Presence from contacts is tracked per bare JID and emitted as presence events (online with the XMPP show and status, offline, subscribe/unsubscribe); libstrophe 0.14's get_text is used for child text. The hello caps gain roster and presence, and the event shapes follow docs/reference/dtchat-adapter-protocol.txt (buddy, contact, away). tests/xmpp_fake.py now checks that the client announces itself and asks for the roster, delivers bob (name/subscription) and carol, the online-with-show/status and offline presence, and still carries messages both ways. Run against the standalone adapter: 22 checks, all ok. In-tree build pending: make mcde-host is running after the configure change.