From 5ec472c036f33e5f863847596c0d8e3d9e9643ef Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 12 Feb 2020 21:24:43 +0100 Subject: Reapply "Implement MIX-PAM XEP-0405: Roster IQ extension" This reverts commit 4af8f27d6bcbb44d349f4637d4653ac6ca3de09c. On the XMPP summit the decision was made to stick to the roster extension now. The custom protocol would in the end be like a copy of the roster protocol. Thus, the roster iq extension should not be removed or replaced with another protocol. --- tests/qxmpprosteriq/tst_qxmpprosteriq.cpp | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'tests') diff --git a/tests/qxmpprosteriq/tst_qxmpprosteriq.cpp b/tests/qxmpprosteriq/tst_qxmpprosteriq.cpp index ae8e7f51..57839934 100644 --- a/tests/qxmpprosteriq/tst_qxmpprosteriq.cpp +++ b/tests/qxmpprosteriq/tst_qxmpprosteriq.cpp @@ -35,6 +35,8 @@ private slots: void testItem(); void testVersion_data(); void testVersion(); + void testMixAnnotate(); + void testMixChannel(); }; void tst_QXmppRosterIq::testItem_data() @@ -115,5 +117,45 @@ void tst_QXmppRosterIq::testVersion() serializePacket(iq, xml); } +void tst_QXmppRosterIq::testMixAnnotate() +{ + const QByteArray xml( + "" + "" + "" + "" + "" + ); + + QXmppRosterIq iq; + parsePacket(iq, xml); + QCOMPARE(iq.mixAnnotate(), true); + serializePacket(iq, xml); + + iq.setMixAnnotate(false); + QCOMPARE(iq.mixAnnotate(), false); +} + +void tst_QXmppRosterIq::testMixChannel() +{ + const QByteArray xml( + "" + "" + "" + ); + + QXmppRosterIq::Item item; + parsePacket(item, xml); + QCOMPARE(item.isMixChannel(), true); + QCOMPARE(item.mixParticipantId(), QString("123456")); + serializePacket(item, xml); + + item.setIsMixChannel(false); + QCOMPARE(item.isMixChannel(), false); + item.setMixParticipantId("23a7n"); + QCOMPARE(item.mixParticipantId(), QString("23a7n")); +} + QTEST_MAIN(tst_QXmppRosterIq) #include "tst_qxmpprosteriq.moc" -- cgit v1.2.3