diff options
| author | Linus Jahn <lnj@kaidan.im> | 2019-04-27 21:37:31 +0100 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2019-09-06 18:04:40 +0200 |
| commit | 8ab56c2cf1ff490b78def3f9799d4b8a99965d47 (patch) | |
| tree | 3b363feee85fd10a59b684c3e9067f1f1cde3eb4 /tests | |
| parent | 499b6567a9b3f9838a0d0f082d8baabd05414ff9 (diff) | |
| download | qxmpp-8ab56c2cf1ff490b78def3f9799d4b8a99965d47.tar.gz | |
Implement XEP-0367: Message Attaching
This adds parsing and serialization for XEP-0367: Message Attaching in
version 0.3.0.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/qxmppmessage/tst_qxmppmessage.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/qxmppmessage/tst_qxmppmessage.cpp b/tests/qxmppmessage/tst_qxmppmessage.cpp index 49666168..9441acef 100644 --- a/tests/qxmppmessage/tst_qxmppmessage.cpp +++ b/tests/qxmppmessage/tst_qxmppmessage.cpp @@ -48,6 +48,7 @@ private slots: void testPrivateMessage(); void testOutOfBandUrl(); void testMessageCorrect(); + void testMessageAttaching(); void testMix(); void testSpoiler(); }; @@ -618,6 +619,23 @@ void tst_QXmppMessage::testMessageCorrect() QCOMPARE(message.replaceId(), QString("someotherid")); } +void tst_QXmppMessage::testMessageAttaching() +{ + const QByteArray xml( + "<message to=\"foo@example.com/QXmpp\" from=\"bar@example.com/QXmpp\" type=\"normal\">" + "<body>This is the corrected version.</body>" + "<attach-to xmlns=\"urn:xmpp:message-attaching:1\" id=\"SD24VCzSYQ\"/>" + "</message>"); + + QXmppMessage message; + parsePacket(message, xml); + QCOMPARE(message.attachId(), QString("SD24VCzSYQ")); + serializePacket(message, xml); + + message.setAttachId("someotherid"); + QCOMPARE(message.attachId(), QString("someotherid")); +} + void tst_QXmppMessage::testMix() { const QByteArray xml( |
