Hi,
When I receive an invitation in 'handleMUCInviteDecline()' function, what
should I do to accept and enter the conference, just to join?
That is my code and the error received:
-----------------------------------------------------------
virtual void handleMUCInvitation( const JID& room, const JID& invitee, const
std::string& reason,
const std::string& body, const std::string& password, bool cont )
{
printf( "\n handleMUCInviteDecline: Accept a conference?");
MUCRoom* pRoom = new MUCRoom( j, room, this, 0 );
pRoom->join();
}
-----------------------------------------------------------
And what I see with LogHandler (the '400' error):
-----------------------------------------------------------
handleMUCInviteDecline: Accept a conference?
log: level: 0, area: 16384, <presence to='userB_rnn@xxxxxxxxxxxxxxxxx'><x
xmlns='http://jabber.org/protocol/muc'/></presence>
log: level: 0, area: 8192, <presence to='userA@server/gloox'
from='userB_rnn@xxxxxxxxxxxxxxxxx' type='error'><x
xmlns='http://jabber.org/protocol/muc'/><error code='400'
type='modify'><bad-request
xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></presence>
handleMUCError: got an error, StanzaError= 1
-----------------------------------------------------------
*** And to decline the invitation, you said I must send a message myself,
could you give me more details, please? I get a Stanza* from the function:
Stanza* pStanza = pRoom->declineInvitation(room, invitee, "Busy...");
****************************************************************************
************************************************************
****************************************************************************
************************************************************
When I want to invite another user to a MUCRoom, I creates the room and
invites the user.
1. I receive the 'handleMessageSession' event (role 'moderator',
status=201, ...).
- I set 'room->registerMUCRoomHandler(this)' in this method.
2a. If he declines the invitation:
- I receive the 'handleMessageSession' event
2b. If he accepts the invitation:
- I don't receive anything
- He has the conference opened, but with no users...
What must I do in these cases? Any handler not set?
Thanks a lot
Diego
-----Mensaje original-----
De: Jakob Schroeter [mailto:js@xxxxxxxxxx]
Enviado el: sábado, 04 de abril de 2009 17:54
Para: gloox-dev@xxxxxxxxxx
Asunto: Re: [gloox-dev] "muc_example.cpp" problems
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