Commit 0f35b957 authored by Linus Jahn's avatar Linus Jahn 🍙

media-sharing: Include out of band data url

parent e7aaa26f
Pipeline #319 passed with stages
in 4 minutes and 22 seconds
......@@ -104,8 +104,11 @@ void MessageHandler::handleMessage(const QXmppMessage &msg)
entry.message = msg.body();
entry.type = MessageType::MessageText; // default to text message without media
// check if message contains a link
// check if message contains a link and also check out of band url
QList<QString> bodyWords = msg.body().split(" ");
#if QXMPP_VERSION >= QT_VERSION_CHECK(1, 0, 0)
bodyWords.prepend(msg.outOfBandUrl());
#endif
for (const QString &word : bodyWords) {
bool isLink = word.startsWith("https://") || word.startsWith("http://");
if (!isLink)
......
......@@ -125,6 +125,9 @@ void UploadManager::handleUploadSucceeded(const QXmppHttpUpload *upload)
m.setId(originalMsg->id);
m.setReceiptRequested(true);
m.setStamp(QXmppUtils::datetimeFromString(originalMsg->timestamp));
#if QXMPP_VERSION >= QT_VERSION_CHECK(1, 0, 0)
m.setOutOfBandUrl(upload->slot().getUrl().toEncoded());
#endif
// TODO: check return code
client->sendPacket(m);
......
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