RE: "muc_example.cpp" problems
From: Diego Donate <diego.donate@xxxxxxxxxxx>
Date: Thu, 2 Apr 2009 19:21:21 +0200 (CEST)
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)
     2. If I try to accept (joining the room, isn't it?), I send a message,
but I receive a 400 bad request.
 
My code is (with both options):
 
virtual void handleMUCInvitation( const JID& room, const JID& invitee, const
std::string& reason,
const std::string& body, const std::string& password, bool cont )
 {
     MUCRoom* pRoom = new MUCRoom( j, room, this, 0 );
 
 if (pRoom)
 {
      //pRoom->declineInvitation(room, invitee, "noooo");      // For
decline
      pRoom->join();
// For accept and join the room, is it the way?
      pRoom->registerMUCRoomHandler(this);
  }
 
What I see with a sniffer is:

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>
------------------------------------------------
 
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...
 
Thanks in advance 
 

  _____  

De: Diego Donate [mailto:diego.donate@xxxxxxxxxxx] 
Enviado el: jueves, 02 de abril de 2009 16:31
Para: gloox-dev@xxxxxxxxxx
Asunto: [gloox-dev] "muc_example.cpp" problems


 
Hi,
 
I am trying to make a small jabber client just with the muc feature. I have
firstly tested the muc_example, but with problems:
 
Once connected (client B sees me online), I have in 'onConnect()':
      m_room->join();      
      m_room->getRoomInfo();      
      m_room->getRoomItems();
 
With that, I receive the events in 'handleMUCInfo()' and 'handleMUCItems()'.
In 'virtual void handleMUCItems( MUCRoom * pRoom, const StringMap& items )',
I put:
      pRoom->registerMUCRoomHandler(this);
      pRoom->invite(JID("userB..."),"invitation");
 
and user B receives my invitation, BUT When user B accepts, I don't receive
anything... 
 
I also tried with no invitation from my client, waiting for B's invitation.
BUT when B started a conference with me, I didn't receive anything to accept
or decline it, no event...
 
What am I doing wrong with the simple example?
 
Thanks in advance
 
Diego