Re: "muc_example.cpp" problems
From: Jakob Schroeter <js@xxxxxxxxxx>
Date: Sat, 4 Apr 2009 17:53:57 +0200 (CEST)
Hi,

Quoting Diego Donate <diego.donate@xxxxxxxxxxx>:

Hi,

I have the incoming mucInvitation event received in my function
virtual void handleMUCInvitation(...)

and then I need to accept or decline this invitation.

     1. If I try to decline, nothing seems to happen (I see nothing sent
from my machine)

That is because MUCRoom::declineInvitation() doesn't send anything. It is a static function that returns a pointer to a Message that you have to send yourself. That way you are able to decline an invitation even if you have no instance of MUCRoom floating around. The documentation is not clear about this, unfortunately.

     2. If I try to accept (joining the room, isn't it?), I send a message,
but I receive a 400 bad request.

What exactly gets sent and what exactly do you receive?

Have you tried using gloox' Loghandler? It should be more convenient than a sniffer.


When I try with another jabber client which works, and I accept the
invitation, I send from my machine:

------------------------------------------------
eXtensible Markup Language

<iq
id="RYWT6-43"
to="userA_zxc@xxxxxxxxxxxxxxxxx"
type="get">
<query
xmlns="http://jabber.org/protocol/disco#info";>
</query>
</iq>
------------------------------------------------

That client tries to get more info about the room first.


but with my code, if I accept I send:

------------------------------------------------
eXtensible Markup Language

<presence
to='userA_zjy@xxxxxxxxxxxxxxxxx'>
<x
xmlns='http://jabber.org/protocol/muc'/>
</presence>
------------------------------------------------

Any idea? Why a presence message is sent? I supponse I am doing something
wrong with the invitation, but I don't know what...

Because presence stanzas are used to join muc rooms.

cheers,
Jakob