aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/qxmppmessage/tst_qxmppmessage.cpp18
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(