Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--installer/Mumble.rtfbin2084 -> 2084 bytes
-rw-r--r--src/mumble/Log.cpp4
-rw-r--r--src/mumble/MainWindow.cpp18
-rw-r--r--src/tests/TestAudioReceiverBuffer/CMakeLists.txt2
-rw-r--r--src/tests/TestMumbleProtocol/CMakeLists.txt2
5 files changed, 20 insertions, 6 deletions
diff --git a/installer/Mumble.rtf b/installer/Mumble.rtf
index d28f9db3b..afc816bde 100644
--- a/installer/Mumble.rtf
+++ b/installer/Mumble.rtf
Binary files differ
diff --git a/src/mumble/Log.cpp b/src/mumble/Log.cpp
index 161d0492a..330dba748 100644
--- a/src/mumble/Log.cpp
+++ b/src/mumble/Log.cpp
@@ -509,7 +509,7 @@ QString Log::msgColor(const QString &text, LogColorType t) {
}
QString Log::formatChannel(::Channel *c) {
- return QString::fromLatin1("<a href='channelid://%1/%3' class='log-channel'>%2</a>")
+ return QString::fromLatin1("<a href='channelid://id.%1/%3' class='log-channel'>%2</a>")
.arg(c->iId)
.arg(c->qsName.toHtmlEscaped())
.arg(QString::fromLatin1(Global::get().sh->qbaDigest.toBase64()));
@@ -539,7 +539,7 @@ QString Log::formatClientUser(ClientUser *cu, LogColorType t, const QString &dis
if (cu) {
QString name = (displayName.isNull() ? cu->qsName : displayName).toHtmlEscaped();
if (cu->qsHash.isEmpty()) {
- return QString::fromLatin1("<a href='clientid://%2/%4' class='log-user log-%1'>%3</a>")
+ return QString::fromLatin1("<a href='clientid://id.%2/%4' class='log-user log-%1'>%3</a>")
.arg(className)
.arg(cu->uiSession)
.arg(name)
diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp
index 93fd921dd..47be29e12 100644
--- a/src/mumble/MainWindow.cpp
+++ b/src/mumble/MainWindow.cpp
@@ -829,6 +829,10 @@ ContextMenuTarget MainWindow::getContextMenuTargets() {
}
bool MainWindow::handleSpecialContextMenu(const QUrl &url, const QPoint &pos_, bool focus) {
+ // This method abuses QUrls for internal data serialization
+ // The protocol, host and path parts of the URL may contain
+ // special values which are only parsable by this method.
+
if (url.scheme() == QString::fromLatin1("clientid")) {
bool ok = false;
QString maybeUserHash(url.host());
@@ -839,8 +843,13 @@ bool MainWindow::handleSpecialContextMenu(const QUrl &url, const QPoint &pos_, b
ok = true;
}
} else {
+ // We expect the host part of the URL to contain the user id in the format
+ // id.<id>
+ // where <id> is the user id as integer. This is necessary, because QUrl parses
+ // plain integers in the host field as IP addresses
QByteArray qbaServerDigest = QByteArray::fromBase64(url.path().remove(0, 1).toLatin1());
- cuContextUser = ClientUser::get(url.host().toInt(&ok, 10));
+ QString id = url.host().split(".").value(1, "-1");
+ cuContextUser = ClientUser::get(id.toInt(&ok, 10));
ServerHandlerPtr sh = Global::get().sh;
ok = ok && sh && (qbaServerDigest == sh->qbaDigest);
}
@@ -855,9 +864,14 @@ bool MainWindow::handleSpecialContextMenu(const QUrl &url, const QPoint &pos_, b
}
cuContextUser.clear();
} else if (url.scheme() == QString::fromLatin1("channelid")) {
+ // We expect the host part of the URL to contain the channel id in the format
+ // id.<id>
+ // where <id> is the channel id as integer. This is necessary, because QUrl parses
+ // plain integers in the host field as IP addresses
bool ok;
QByteArray qbaServerDigest = QByteArray::fromBase64(url.path().remove(0, 1).toLatin1());
- cContextChannel = Channel::get(url.host().toInt(&ok, 10));
+ QString id = url.host().split(".").value(1, "-1");
+ cContextChannel = Channel::get(id.toInt(&ok, 10));
ServerHandlerPtr sh = Global::get().sh;
ok = ok && sh && (qbaServerDigest == sh->qbaDigest);
if (ok) {
diff --git a/src/tests/TestAudioReceiverBuffer/CMakeLists.txt b/src/tests/TestAudioReceiverBuffer/CMakeLists.txt
index a9d9a0558..5166b8436 100644
--- a/src/tests/TestAudioReceiverBuffer/CMakeLists.txt
+++ b/src/tests/TestAudioReceiverBuffer/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2020-2021 The Mumble Developers. All rights reserved.
+# Copyright 2020-2022 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
diff --git a/src/tests/TestMumbleProtocol/CMakeLists.txt b/src/tests/TestMumbleProtocol/CMakeLists.txt
index b6e3d2cd7..0cbcb4d6b 100644
--- a/src/tests/TestMumbleProtocol/CMakeLists.txt
+++ b/src/tests/TestMumbleProtocol/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2020-2021 The Mumble Developers. All rights reserved.
+# Copyright 2020-2022 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.