Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 2bda8dca authored by Linus Jahn's avatar Linus Jahn

Fix spoiler messages with QXmpp master

Spoiler message support has been added to QXmpp recently (by me).
parent 16e5845e
Pipeline #4914 passed with stages
in 21 minutes and 3 seconds
......@@ -101,14 +101,21 @@ void MessageHandler::handleMessage(const QXmppMessage &msg)
message.setId(msg.id());
message.setBody(msg.body());
message.setMediaType(MessageType::MessageText); // default to text message without media
#if QXMPP_VERSION >= QT_VERSION_CHECK(1, 0, 1)
message.setIsSpoiler(msg.isSpoiler());
message.setSpoilerHint(msg.spoilerHint());
#else
for (const QXmppElement &extension : msg.extensions()) {
qDebug() << extension.tagName();
if (extension.tagName() == "spoiler" &&
extension.attribute("xmlns") == NS_SPOILERS) {
qDebug() << "SPOILER MESSAGE";
message.setIsSpoiler(true);
message.setSpoilerHint(extension.value());
break;
}
}
#endif
// check if message contains a link and also check out of band url
QStringList bodyWords = message.body().split(" ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment