- C 98.3%
- Makefile 1.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| libtacky@65a31465ce | ||
| tacky-motif | ||
| .gitignore | ||
| .gitmodules | ||
| README.md | ||
| screenshot.png | ||
tacky-motif
A proof-of-concept XMPP client: libtacky behind a Motif window. It does
what libtacky's reference client (libtacky/examples/tacky-tk) does, call
for call: accounts, the chat list, a conversation, sending text. It also
unlocks an encrypted store and answers an untrusted certificate.
Written for old toolchains: C89 (it builds clean under
-std=c89 -pedantic -Wall -Wextra), Motif 1.2's API only, plain POSIX
make.
Files
| file | what |
|---|---|
main.c |
the window, the accounts, chats and conversation, the events |
proto.c |
the wire: request tokens and their callbacks, events |
link.c |
the way to the backend: tackyd-json or libtacky.a |
json.c |
a small JSON parser and argument builder |
buf.c |
a growable buffer |
Two ways to the backend
tacky-motif(default) runstackyd-jsonas a child process and speaks its frames (<byte count>\n<json>) over pipes. It needs no threads, no C++ and no Tcl: just a C compiler and Motif. The daemon can come from another machine's build of libtacky.tacky-motif-liblinkslibtacky.ain process (embed/tacky.h). libtacky's emit callback runs on its own thread, so it queues frames and wakes the Xt loop through a pipe. It needs a C++ linker and pthreads.
Building
cd tacky-motif
make # tacky-motif
make tacky-motif-lib LIBTACKY=../libtacky
make CC=gcc X_CFLAGS=-I/usr/X11R6/include X_LIBS="-L/usr/X11R6/lib -lXm -lXt -lX11"
tackyd-json and libtacky.a come from libtacky's own build, done in its
container (make tackyd-json MEDIA_BACKEND=none there).
Running
./tacky-motif -tackyd ../libtacky/dist/tackyd-json # a profile on disk
./tacky-motif -tackyd ../libtacky/dist/tackyd-json -transient # nothing written
TACKYD_JSON=/opt/tacky/tackyd-json ./tacky-motif -app-name work
The profile is libtacky's $XDG_CONFIG_HOME/libtacky/tacky-motif (-app-name
changes the last part). The daemon's log goes to the terminal's stderr.
Text is UTF-8 and wants a UTF-8 locale (the client warns on stderr
otherwise). The built-in font list is a font set over misc-fixed, the
bitmap fonts of xfonts-base (Debian) or xorg-x11-fonts-misc (Fedora),
so Cyrillic and the like draw as characters rather than as Latin-1 bytes.
Fonts and colours are X resources. On Motif 2.3 with Xft, for example:
TackyMotif*renderTable: rt
TackyMotif*rt*fontType: FONT_IS_XFT
TackyMotif*rt*fontName: DejaVu Sans
TackyMotif*rt*fontSize: 10
Not done
This is a POC. Not done: rooms, files, calls, OMEMO controls, paging older
history, removing an account after <AuthError>, and sign-up.
