how to notify the MessageEventCancel?
From: Federico Rossi <f.rossi@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Mar 2007 17:52:08 +0100 (CET)
Hi,
I can't correctly send the MessageEventCancel event.
(I use gloox 0.9-pre5 in Windows VS environment).
For example in the message_example.cpp if I modify the handleMessage method in this way:

virtual void handleMessage( Stanza *stanza, MessageSession * /*session*/ )
   {
printf( "type: %d, subject: %s, message: %s, thread id: %s\n", stanza->subtype(), stanza->subject().c_str(), stanza->body().c_str(), stanza->thread().c_str() );

std::string msg = "You said:\n> " + stanza->body() + "\nI like that statement.";
     std::string sub;
     if( !stanza->subject().empty() )
       sub = "Re: " +  stanza->subject();

     m_messageEventFilter->raiseMessageEvent( MessageEventDisplayed );

#ifdef WIN32
     Sleep( 1000 );
#else
     sleep( 1 );
#endif

     m_messageEventFilter->raiseMessageEvent( MessageEventComposing );
     m_chatStateFilter->setChatState( ChatStateComposing );

#ifdef WIN32
     Sleep( 2000 );
#else
     sleep( 2 );
#endif

     m_messageEventFilter->raiseMessageEvent( MessageEventCancel );
     m_chatStateFilter->setChatState( ChatStatePaused );

#ifdef WIN32
     Sleep( 2000 );
#else
     sleep( 2 );
#endif

     m_session->send( msg, sub );

     if( stanza->body() == "quit" )
       j->disconnect();
   }

no <paused> message is sent. You can find as attachment the trace of a message exchanging.
I sent the "Hello" message to my test application from a Gaim Client.
thank you in advance
Cheers

Federico

Attachment: message_exchange.cap
Description: Binary data