Example #1
0
		//...
		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);
			}
		}
Example #2
0
		void handleMessageReceived(Message::ref message) {
			// Echo back the incoming message
			message->setTo(message->getFrom());
			message->setFrom(JID());
			client->sendMessage(message);
		}