//... void handleMessageReceived(Message::ref message) { //... // Echo back the incoming message message->setTo(message->getFrom()); message->setFrom(JID()); //... if (!message->getPayload<EchoPayload>()) { boost::shared_ptr<EchoPayload> echoPayload = boost::make_shared<EchoPayload>(); echoPayload->setMessage("This is an echoed message"); message->addPayload(echoPayload); client->sendMessage(message); } }
void handleMessageReceived(Message::ref message) { // Echo back the incoming message message->setTo(message->getFrom()); message->setFrom(JID()); client->sendMessage(message); }