[ejabberd] Change MUC room subject on server

Badlop badlop at gmail.com
Mon Feb 20 18:56:43 MSK 2017

On 16 February 2017 at 17:17, Dominik George <nik at naturalnet.de> wrote:
> how can I set the subject of a room from the server? With ejabberdctl, I
> can set title and description, but not the subject.

Room title and description are room configurable fields.
but Subject (and recent history) are room state elements,
that are changed by sending messages to the room, see XEP-0045.

There's still a way to do it.

Let's use room1 at conference.localhost, and an existing occupant called
user2 at localhost/tka that can himself set the subject. Then you can
execute this:
$ ejabberdctl send_message groupchat user2 at localhost/tka
room1 at conference.localhost NewSubject12 ""

Of course, the problem here is that only room occupants can send
message to a room according to XEP-0045.

A solution to that restriction is to allow subscriptions in the room,
then subscribe user2 at localhost to the room events (see [1] or use a
command for that), and then the room will accept something like this,
even if the user is not occupant, or not logged in:
$ ejabberdctl send_message groupchat user2 at localhost
room1 at conference.localhost NewSubject123456 ""

[1] https://docs.ejabberd.im/developer/xmpp-clients-bots/proposed-extensions/muc-sub/#toc_7

> Cheers,
> Nik
> --
> PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296
> Dominik George · Hundeshagenstr. 26 · 53225 Bonn
> Mobile: +49-1520-1981389 · https://www.dominik-george.de/
> Teckids e.V. · FrOSCon e.V.
> Fellowship of the FSFE · Piratenpartei Deutschland
> Opencaching Deutschland e.V. · Debian Maintainer
> LPIC-3 Linux Enterprise Professional (Security)
> _______________________________________________
> ejabberd mailing list
> ejabberd at jabber.ru
> http://lists.jabber.ru/mailman/listinfo/ejabberd


More information about the ejabberd mailing list