Home

fsky / j2i

public
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Add XEP-0153 bot avatar support

2 months ago

d2288f6
Authored
Kruno7/21/2026, 5:08:09 PM
Give the bridge bot a vCard-based avatar in MUCs, in both client and
component mode. New Pillow-based avatar module decodes, downscales, strips
metadata, and fits the image under a configurable byte budget so the
base64 vcard-temp stanza stays under the server's max stanza size.

- Client mode publishes via xep_0153 (its filter stamps the join presence)
- Component mode caches the master vCard (xep_0054 serves gets) and stamps
  presence via an outgoing filter; _avatar_for is the seam for Phase 2
  per-puppet avatars
- Config: XMPPConfig.avatar (path/URL, unset=bundled default, ""=off) and
  Settings.avatar_byte_cap / avatar_target_px
- Bundled default at src/j2i/data/default-avatar.png

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Parent8cebcea

11 files changed
  • CHANGELOG.md+1−0
  • config.example.toml+14−0
  • pyproject.toml+1−0
  • src/j2i/bridge.py+31−0
  • src/j2i/config.py+10−0
  • src/j2i/data/default-avatar.png——
  • src/j2i/xmpp/avatar.py+213−0
  • src/j2i/xmpp/client.py+18−0
src/j2i/xmpp/component.py
+51
−0
  • tests/test_avatar.py+81−0
  • uv.lock+90−1