Exemplo n.º 1
0
	void EntryBase::SetClientVersion (const QString& variant, const QXmppVersionIq& version)
	{
		qDebug () << Q_FUNC_INFO << variant << version.os ();
		Variant2Version_ [variant] = version;

		emit entryGenerallyChanged ();
	}
Exemplo n.º 2
0
void TestPackets::testVersionResult()
{
    const QByteArray xmlResult(
    "<iq id=\"version_1\" to=\"[email protected]/orchard\" "
    "from=\"[email protected]/balcony\" type=\"result\">"
    "<query xmlns=\"jabber:iq:version\">"
        "<name>qxmpp</name>"
        "<os>Windows-XP</os>"
        "<version>0.2.0</version>"
    "</query></iq>");

    QXmppVersionIq verIqResult;
    parsePacket(verIqResult, xmlResult);
    QCOMPARE(verIqResult.id(), QLatin1String("version_1"));
    QCOMPARE(verIqResult.to(), QLatin1String("[email protected]/orchard"));
    QCOMPARE(verIqResult.from(), QLatin1String("[email protected]/balcony"));
    QCOMPARE(verIqResult.type(), QXmppIq::Result);
    QCOMPARE(verIqResult.name(), QString("qxmpp"));
    QCOMPARE(verIqResult.version(), QString("0.2.0"));
    QCOMPARE(verIqResult.os(), QString("Windows-XP"));

    serializePacket(verIqResult, xmlResult);
}