aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2022-05-08 12:44:57 +0200
committerLinus Jahn <lnj@kaidan.im>2022-06-14 11:13:02 +0200
commit8978ee9f98a7c06825269d6fa2c99a0e706d2b7c (patch)
treeaa7017967f3c5d16cfab9d6413d5e8ed411d3e6d
parentd91cbade277d0803d5533f789324670ab1dc2c2c (diff)
Message: Initialize message type directly as 'chat'
Previously the type had been set to Normal first and then to Chat. There's no change in behviour. The changes to the unit test qxmppomemodata are just for consistency. Signed-off-by: Linus Jahn <lnj@kaidan.im>
-rw-r--r--src/base/QXmppMessage.cpp3
-rw-r--r--tests/qxmppomemodata/tst_qxmppomemodata.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp
index abae1123..cf361a95 100644
--- a/src/base/QXmppMessage.cpp
+++ b/src/base/QXmppMessage.cpp
@@ -151,7 +151,7 @@ public:
};
QXmppMessagePrivate::QXmppMessagePrivate()
- : type(QXmppMessage::Normal),
+ : type(QXmppMessage::Chat),
state(QXmppMessage::None),
stampType(DelayedDelivery),
receiptRequested(false),
@@ -175,7 +175,6 @@ QXmppMessagePrivate::QXmppMessagePrivate()
QXmppMessage::QXmppMessage(const QString &from, const QString &to, const QString &body, const QString &thread)
: QXmppStanza(from, to), d(new QXmppMessagePrivate)
{
- d->type = Chat;
d->body = body;
d->thread = thread;
}
diff --git a/tests/qxmppomemodata/tst_qxmppomemodata.cpp b/tests/qxmppomemodata/tst_qxmppomemodata.cpp
index dd4ef309..778e9cea 100644
--- a/tests/qxmppomemodata/tst_qxmppomemodata.cpp
+++ b/tests/qxmppomemodata/tst_qxmppomemodata.cpp
@@ -527,7 +527,7 @@ void tst_QXmppOmemoData::testOmemoElement()
void tst_QXmppOmemoData::testMessageOmemoElement()
{
const QByteArray xmlIn(QByteArrayLiteral(
- "<message id=\"send1\" to=\"juliet@capulet.lit\" from=\"romeo@montague.lit\" type=\"normal\">"
+ "<message id=\"send1\" to=\"juliet@capulet.lit\" from=\"romeo@montague.lit\" type=\"chat\">"
"<store xmlns=\"urn:xmpp:hints\"/>"
"<encrypted xmlns=\"urn:xmpp:omemo:2\">"
"<header sid=\"27183\">"
@@ -558,7 +558,7 @@ void tst_QXmppOmemoData::testMessageOmemoElement()
// needed since they are serialized in the reverse order in which they are
// deserialized.
const QByteArray xmlOut1(QByteArrayLiteral(
- "<message id=\"send1\" to=\"juliet@capulet.lit\" from=\"romeo@montague.lit\" type=\"normal\">"
+ "<message id=\"send1\" to=\"juliet@capulet.lit\" from=\"romeo@montague.lit\" type=\"chat\">"
"<store xmlns=\"urn:xmpp:hints\"/>"
"<encrypted xmlns=\"urn:xmpp:omemo:2\">"
"<header sid=\"27183\">"