AtlatestRepositorysigil-xmpp
sigil-xmpp / treeREADME.md
1
# sigil-xmpp3
A [Sigil](https://codeberg.org/sigil/sigil) library for XMPP (Jabber) messaging. Provides a full-featured client with STARTTLS, SASL authentication, roster management, presence tracking, and Multi-User Chat (MUC) support.5
## Features7
- **Connection management** -- STARTTLS upgrade, SASL authentication (SCRAM-SHA-1, PLAIN)8
- **JID handling** -- parse and format JIDs, extract user/domain/resource9
- **Stanza construction** -- build and inspect messages, presence, and IQ stanzas10
- **Roster management** -- fetch, add, remove contacts, handle subscription requests11
- **Presence tracking** -- monitor availability by resource, set your own status12
- **Multi-User Chat** -- join/leave rooms, occupant tracking, group/private messaging (XEP-0045)13
- **Cooperative I/O** -- blocking (`xmpp-run`) or non-blocking (`xmpp-tick`) event loops15
## Usage17
Add `sigil-xmpp` as a dependency in your `package.sgl`:19
```scheme20
(from-git url: "codeberg:sigil/sigil-xmpp" package: "sigil-xmpp")21
```23
Then import and connect:25
```scheme26
(import (sigil xmpp))28
(define conn (make-xmpp-connection29
host: "xmpp.example.com"30
jid: "[email protected]"31
password: "secret"))33
;; Install roster, presence, and MUC handling34
(xmpp-install-features conn)36
;; Set up message handler37
(xmpp-on conn 'message38
(lambda (stanza)39
(display (stanza-body stanza))))41
;; Connect and run42
(xmpp-connect conn)43
(xmpp-set-status conn "Online")44
(xmpp-run conn)45
```47
## Modules49
| Module | Description |50
|--------|-------------|51
| `(sigil xmpp)` | Top-level re-exports |52
| `(sigil xmpp stanza)` | JID parsing, stanza construction and inspection |53
| `(sigil xmpp sasl)` | SASL authentication (SCRAM-SHA-1, PLAIN) |54
| `(sigil xmpp connection)` | Connection lifecycle, event handling, I/O loop |55
| `(sigil xmpp roster)` | Roster management and subscription handling |56
| `(sigil xmpp presence)` | Presence tracking by resource |57
| `(sigil xmpp muc)` | Multi-User Chat rooms and occupant tracking |59
## Dependencies61
- sigil-stdlib62
- sigil-socket63
- sigil-tls64
- sigil-crypto65
- sigil-sxml67
## Building69
```bash70
sigil deps install71
sigil build72
sigil test73
```75
## License77
BSD-3-Clause