void tst_QXmppMessage::testForwarding() { const QByteArray xml("<message type=\"normal\">" "<body>hi!</body>" "<forwarded xmlns=\"urn:xmpp:forward:0\">" "<delay xmlns=\"urn:xmpp:delay\" stamp=\"2010-06-29T08:23:06Z\"/>" "<message xmlns=\"jabber:client\" " "type=\"chat\" " "from=\"[email protected]/QXmpp\" " "to=\"[email protected]/QXmpp\">" "<body>ABC</body>" "</message>" "</forwarded>" "</message>"); QXmppMessage message; parsePacket(message, xml); QCOMPARE(message.hasForwarded(), true); QXmppMessage fwd = message.forwarded(); QCOMPARE(fwd.stamp(), QDateTime(QDate(2010, 06, 29), QTime(8, 23, 6), Qt::UTC)); QCOMPARE(fwd.body(), QString("ABC")); QCOMPARE(fwd.to(), QString("[email protected]/QXmpp")); QCOMPARE(fwd.from(), QString("[email protected]/QXmpp")); }