AtlatestRenderedmarkdown
Readme

sigil-xmpp

A 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.

Features

  • Connection management -- STARTTLS upgrade, SASL authentication (SCRAM-SHA-1, PLAIN)
  • JID handling -- parse and format JIDs, extract user/domain/resource
  • Stanza construction -- build and inspect messages, presence, and IQ stanzas
  • Roster management -- fetch, add, remove contacts, handle subscription requests
  • Presence tracking -- monitor availability by resource, set your own status
  • Multi-User Chat -- join/leave rooms, occupant tracking, group/private messaging (XEP-0045)
  • Cooperative I/O -- blocking (xmpp-run) or non-blocking (xmpp-tick) event loops

Usage

Add sigil-xmpp as a dependency in your package.sgl:

(from-git url: "codeberg:sigil/sigil-xmpp" package: "sigil-xmpp")

Then import and connect:

(import (sigil xmpp))

(define conn (make-xmpp-connection
               host: "xmpp.example.com"
               jid: "[email protected]"
               password: "secret"))

;; Install roster, presence, and MUC handling
(xmpp-install-features conn)

;; Set up message handler
(xmpp-on conn 'message
  (lambda (stanza)
    (display (stanza-body stanza))))

;; Connect and run
(xmpp-connect conn)
(xmpp-set-status conn "Online")
(xmpp-run conn)

Modules

ModuleDescription
(sigil xmpp)Top-level re-exports
(sigil xmpp stanza)JID parsing, stanza construction and inspection
(sigil xmpp sasl)SASL authentication (SCRAM-SHA-1, PLAIN)
(sigil xmpp connection)Connection lifecycle, event handling, I/O loop
(sigil xmpp roster)Roster management and subscription handling
(sigil xmpp presence)Presence tracking by resource
(sigil xmpp muc)Multi-User Chat rooms and occupant tracking

Dependencies

  • sigil-stdlib
  • sigil-socket
  • sigil-tls
  • sigil-crypto
  • sigil-sxml

Building

sigil deps install
sigil build
sigil test

License

BSD-3-Clause