void PrivateChat::handleMessage(const gloox::Message& msg, gloox::MessageSession* session) { if(msg.subtype() == gloox::Message::Chat) emit reciveMessage(QString().fromUtf8(msg.body().c_str()), QString().fromUtf8((msg.from().full().c_str()))); else emit reciveNotPrivateMessage(QString().fromUtf8(msg.body().c_str()), QString().fromUtf8((msg.from().full().c_str())), QString().fromUtf8((msg.from().resource().c_str()))); }
void MDMessageCenter::handleMessage( const gloox::Message& msg,gloox::MessageSession* session) { // stanza.subject(); // CCLOG("%s",stanza.suboptarg); // const gloox::JID from(stanza.from()); // gloox::Message msg(stanza.from(), "hello world","test" ); // j->send( msg ); CCLOG( "type: %d, subject: %s, message: %s, thread id: %s\n", msg.subtype(), msg.subject().c_str(), msg.body().c_str(), msg.thread().c_str() ); }