haydenwu/xmpp

Library for XMPP protocol (Jabber) connections

dev-main 2025-05-16 04:58 UTC

This package is auto-updated.

Last update: 2025-08-11 08:02:52 UTC


README

This is my fork of zorn-v/xmpp, which is a fork of fabiang/xmpp, a PHP library for XMPP protocol connections (Jabber).

The original README can be found in README.OLD.md.

Changes in this fork

Explicit MUC presence

A Presence stanza must be sent to a MUC before the client can chat in it. Previously, you must call setPassword(string) to imply the Presence's to is a MUC, no matter there's a password or not. Now you'll do that explicitly with setToChannel(bool).

Max history returned by room

$presence->setHistoryLimit(int|null) allows you to set maximum number of previous messages provided when joining a room room. When it's null, it'll follow the room's default.

Getting messages

A few updates on message buffer and $client->getMessages()'s return:

  • Fixed body being empty when message is a reply. Now the body will be similar to "> FOO\nBAR" when so.
  • Added type field which will be either 'chat' (Message::TYPE_CHAT) or 'groupchat' (Message::TYPE_GROUPCHAT).
  • Added boolean meta field which will be true when the message is not an actual chat message, e.g. when it notifies room subject or description.

LICENSE

BSD-2-Clause. See the LICENSE.