Commit Graph

10585 Commits

Author SHA1 Message Date
Robert Adam
e7000febd3 FIX(server): Stale user pointers in whisper cache
Since the whisper cache entry was computed while holding the read-lock,
it was possible for a user in that cache to get deleted while the voice
thread drops the read lock in order to upgrade it to a write lock. In
such a case, the cache entry would contain an invalid (stale) user
pointer, which can lead to crashes when using the cache later on.

By moving the cache entry computation into the block in which we already
hold a read lock, we turn computing the cache and adding it to the cache
store into an atomic operation. As soon as the cache entry is in the
store, deleting a user is no longer an issue as that will implicitly
clear all whisper caches (thereby preventing stale cache entries).
2024-04-01 14:50:54 +02:00
Davide Beatrici
d99bd47b28
Merge PR #6371: FIX(client): Correctly subscribe to both sink and source events in PulseAudioSystem 2024-03-31 13:29:31 +02:00
Davide Beatrici
f29e7d3173 FIX(client): Correctly subscribe to both sink and source events in PulseAudioSystem
The second call to pa_context_subscribe() was overriding the first, as a result we were only receiving sink events.

This caused hotplugging to fail with devices that don't have any output ports (e.g. USB microphones).
2024-03-31 01:09:15 +01:00
Hartmnt
23f7650904
Merge pull request #6350 from Hartmnt/fix_ipv4
FIX(client): Use IPv4 HostAddress representation where applicable
2024-02-28 22:01:01 +01:00
Hartmnt
0784673d4b FIX(client): Use IPv4 HostAddress representation where applicable
In 6c565689 the HostAddress was refactored. A check for isV6 when
creating a QHostAddress was removed. However, the QHostAddress
determines the (IPv4 vs IPv6) distinction at construction time.
This resulted in some regressions both visually and functional.

This commit reintroduces the distinction.

Fixes #6349
2024-02-28 20:36:46 +00:00
Hartmnt
6b08960a9a
Merge pull request #6348 from jlallas384/issue-6302
FIX(ui): Preserve other check-box states if All messages was checked
2024-02-27 18:29:21 +01:00
jlallas384
9d580cb4fe FIX(ui): Preserve other check-box states if All messages was checked
In the 'Messages' settings, when disabling a single notification method
for a single message type, all check-boxes will disappear in that
column if 'All messages' was checked to begin with. This is because the
automatic unchecking of the 'All messages' check-box is treated as
if the user actually clicked it. Using a QSignalBlocker before unchecking
the 'All messages' fixes the issue

Fixes #6302
2024-02-27 17:09:01 +08:00
Hartmnt
8833542dc7
Merge pull request #6309 from dexgs/scrollfix2
FIX(client, ui): Fix log scroll position after loading resources
2024-02-18 23:22:43 +01:00
Dexter Gaon-Shatford
e126925401 FIX(client, ui): Fix log scroll position after loading resources
In my previous PR (#6290) addressing this bug, I wrote:
> The issue seems to be caused by the scrollbar sometimes being in an
> inconsistent state immediately after a message is sent, but not any
> longer.
>
> My workaround is to add a call to QApplication::processEvents before
> setting the scrollbar to its maximum position to avoid the inconsistent
> state.

I have found that this change only reduces the likelihood of the
incorrect scroll behaviour from happening: it is still reproducible
after the log grows past a certain size.

In my testing since then, the cause of the "inconsistent state" described
previously seems to be the following: When images (whose contents are
stored in a base64-encoded data URL) are inserted into the log, they are
not loaded immediately. Instead, they are "fetched" (although no actual
network request occurs) by the `loadResource` implementation on
`LogDocument`. The "fetching" is triggered by the call to `setHtml` in
the `Log::validHtml` method. However, the code which sets the scroll bar
to stay at the bottom runs immediately (i.e. not asynchronously) in the
`Log::log` method. There also seems to be a hack that forces a re-layout
by sending a "font changed" event.

The intended behaviour appears to be that when a log entry is added the
log will scroll to the bottom if the entry is a message sent by the user
themselves, OR if the log was already scrolled to the bottom before
the entry was added.

The previous solution in place addressing the asynchronous image loading
was dispatching a `LogDocumentResourceAddedEvent` when the image is
loaded whose handler scrolls the log to the bottom, but this causes 2
problems:

First, the handler for this event always scrolls the log to the bottom
no matter what, which means messages containing images are handled
differently from the intended scrolling behaviour, i.e. messages
containing images ALWAYS cause the log to scroll to the bottom instead
of obeying the rules described above.

Second, it seemingly causes the issue described in #2504. It looks like
there's a race condition when the scroll position is set from the main
thread as well as in an event handler. I couldn't get to the bottom of
the exact source of the issue because there is so much deferred
execution going on, but I am confident that adding resources/forcing
re-layout events from an event handler is to blame.

My current solution is to remove as much of this asynchronous code as
possible. The use of a `QNetworkReply` seems to be leftover from when
Mumble supported remote images in chat. As described above, this
implementation was problematic and its complexity is no longer needed,
so I changed the implementation of `LogDocument::loadResource` to simply
check that the image URL is valid and has the `data://` scheme and then
just fall back to QTextDocument::loadResource`.

Implementing the solution this way eliminates the need for
`LogDocumentResourceAddedEvent` because everything happens in order as
expected and there is no need to "correct" the scroll value after the
image gets loaded. I therefore removed this class and the associated
code.

The default behaviour of `QTextEdit` is that it scrolls to the bottom
whenever contents are added. `LogTextBrowser::scrollLogToBottom` seems
to be a workaround to try to get the log to stay at the bottom despite
the scroll bar jumping issue. With my solution, this method can be
removed, and we only need to worry about "restoring" the previous scroll
value when a message from another user arrives and the log isn't already
scrolled to the bottom.
2024-02-18 15:25:08 -05:00
Robert Adam
25f060082f
Merge PR #6270: TRANSLATION: Translations update from Hosted Weblate 2024-02-18 17:44:45 +01:00
Robert Adam
a0751b76bf TRANSLATION: Update translation files 2024-02-18 17:13:37 +01:00
Hosted Weblate
16634cb7ea
TRANSLATION: Update Chinese (Simplified) translation
Currently translated at 100.0% (2156 of 2156 strings)

TRANSLATION: Update Chinese (Simplified) translation

Currently translated at 100.0% (2156 of 2156 strings)

TRANSLATION: Update Chinese (Simplified) translation

Currently translated at 100.0% (2150 of 2150 strings)

TRANSLATION: Update Chinese (Simplified) translation

Currently translated at 100.0% (2150 of 2150 strings)

Co-authored-by: Eric <zxmegaxqug@hldrive.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: deluxghost <deluxghost@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/zh_Hans/
Translation: Mumble/Mumble Client
2024-02-14 09:50:54 +01:00
Hosted Weblate
9f8ed9dfb6
TRANSLATION: Update Finnish translation
Currently translated at 100.0% (2156 of 2156 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: janne ojanperä <janne.ojanpera@iki.fi>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/fi/
Translation: Mumble/Mumble Client
2024-02-14 09:50:53 +01:00
Hosted Weblate
3534f942cb
TRANSLATION: Update Swedish translation
Currently translated at 100.0% (2156 of 2156 strings)

TRANSLATION: Update Swedish translation

Currently translated at 100.0% (2150 of 2150 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: bittin1ddc447d824349b2 <bittin@reimu.nl>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/sv/
Translation: Mumble/Mumble Client
2024-02-14 09:50:52 +01:00
Hosted Weblate
9ef39e19a4
TRANSLATION: Update French translation
Currently translated at 100.0% (2156 of 2156 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: John Doe <thraex@numericable.fr>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/fr/
Translation: Mumble/Mumble Client
2024-02-14 09:50:52 +01:00
Hosted Weblate
1ea79401cb
TRANSLATION: Update Spanish translation
Currently translated at 100.0% (2156 of 2156 strings)

TRANSLATION: Update Spanish translation

Currently translated at 100.0% (2153 of 2153 strings)

TRANSLATION: Update Spanish translation

Currently translated at 99.1% (2135 of 2153 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/es/
Translation: Mumble/Mumble Client
2024-02-14 09:50:51 +01:00
Hosted Weblate
3fa1163622
TRANSLATION: Update Italian translation
Currently translated at 97.3% (2098 of 2156 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Simone <roughnecks@gmx.com>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/it/
Translation: Mumble/Mumble Client
2024-02-14 09:50:51 +01:00
Hosted Weblate
de421f8879
TRANSLATION: Update Polish translation
Currently translated at 100.0% (2156 of 2156 strings)

TRANSLATION: Update Polish translation

Currently translated at 100.0% (2153 of 2153 strings)

TRANSLATION: Update Polish translation

Currently translated at 100.0% (2150 of 2150 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Matthaiks <kitynska@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/pl/
Translation: Mumble/Mumble Client
2024-02-14 09:50:50 +01:00
Hosted Weblate
d84519af78
TRANSLATION: Update Russian translation
Currently translated at 100.0% (2110 of 2110 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: oneofthehorses <oneofthehorses+weblate@proton.me>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/ru/
Translation: Mumble/Mumble Client
2024-02-14 09:50:49 +01:00
Hosted Weblate
0b970ce5f2
TRANSLATION: Update Esperanto translation
Currently translated at 39.7% (857 of 2156 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Piggy NL <piggynl@outlook.com>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/eo/
Translation: Mumble/Mumble Client
2024-02-14 09:50:49 +01:00
Hosted Weblate
2c1ccedc84
TRANSLATION: Update German translation
Currently translated at 99.7% (2150 of 2156 strings)

TRANSLATION: Update German translation

Currently translated at 98.2% (2118 of 2156 strings)

TRANSLATION: Update German translation

Currently translated at 98.1% (2117 of 2156 strings)

TRANSLATION: Update German translation

Currently translated at 98.3% (2115 of 2150 strings)

TRANSLATION: Update German translation

Currently translated at 100.0% (2110 of 2110 strings)

Co-authored-by: David <dawin@users.noreply.hosted.weblate.org>
Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Robert Adam <dev@robert-adam.de>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/de/
Translation: Mumble/Mumble Client
2024-02-14 09:50:48 +01:00
Hosted Weblate
66ea2a16b6
TRANSLATION: Update Turkish translation
Currently translated at 100.0% (2156 of 2156 strings)

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: John Doe <thraex@numericable.fr>
Translate-URL: https://hosted.weblate.org/projects/mumble/mumble-client/tr/
Translation: Mumble/Mumble Client
2024-02-14 09:50:48 +01:00
Hartmnt
348f81ca95
Merge pull request #6339 from Hartmnt/fix_token_channel
FIX(server): Allow unregistered users to transmit access tokens
2024-02-14 09:50:40 +01:00
Hartmnt
19e55daabb FIX(server): Allow unregistered users to transmit access tokens
In 635d71960f cache invalidation for access tokens was added.
A check for ``uSource->iId >= 0`` was added which was intended
to only parse access tokens, if the ``authenticate`` method was
not returning an error code.

As it turns out though, ``uSource->iId`` will be -1 for unREGISTERED
users instead of unAUTHENTICATED users which lead to a bug
where unregistered users would not have the correct channel access
when connecting to the server. A subsequent update of their tokens
would fix that.

This commit moves the respective code block down and changes the
condition to ``ok``, which should now behave as originally intended.

Fixes #6334
2024-02-13 14:50:16 +00:00
Robert Adam
11d3f2bdb7
Merge PR #6338: REFAC(client): Streamline function naming
The function was called "toggle*" and yet it didn't toggle anything but instead only acted as a setter for the respective property. Therefore, the naming has been adjusted accordingly.
2024-02-13 09:41:19 +01:00
Robert Adam
9b9d88c9c6 REFAC(client): Streamline function naming
The function was called "toggle*" and yet it didn't toggle anything but
instead only acted as a setter for the respective property. Therefore,
the naming has been adjusted accordingly.
2024-02-13 09:07:04 +01:00
Robert Adam
df2b949e4f
Merge PR #6329: FIX(client): Fix the size_t type for QT invoke functions in API
QT invoke functions use the size_t type from std:: and some of the API functions that calls these invoke functions using the size_t type from the global namespace.This commit fixes the size_t type as std::size_t for these QT invoke functions.
2024-02-12 12:16:21 +01:00
Robert Adam
f154f3b21b
Merge PR #6333: BUILD: Set timezone on release date for reproducibility 2024-02-10 22:21:35 +01:00
Chris Lamb
af46c1a909
BUILD: Set timezone on release date for reproducibility
To make the build reproducible, it's needed to set the timezone as
otherwise the date could vary based on the timezone of the build server.

Link: https://bugs.debian.org/1060254
2024-02-10 17:08:31 +01:00
Abdullah Ömer Yamaç
96bbda5848 FIX(client): Fix the size_t type for QT invoke functions in API.
QT invoke functions use the size_t type from std:: and some of the API
functions that calls these invoke functions using the size_t type from
the global namespace.This commit fixes the size_t type as std::size_t
for these QT invoke functions.

Co-Authored-By: Abdullah Ömer Yamaç <aomeryamac@gmail.com>
2024-02-07 07:57:46 +03:00
Hartmnt
c40c9654e4
Merge pull request #6325 from mryamac/code_refact
REFAC(client): Refactor the code repeated in the main.cpp
2024-02-04 14:35:23 +01:00
Abdullah Ömer Yamaç
298da31822 REFAC(client): Refactor the code repeated in the main.cpp
This commit refactors the code repeated in the main.cpp file.
Three connect functions were called with same parameters.

Co-Authored-by: Abdullah Ömer Yamaç aomeryamac@gmail.com
2024-02-03 14:36:09 +03:00
Davide Beatrici
c4b5858d14
Merge PR #6321: FIX(shared): Crash in HostAddress::toIPv4() 2024-01-30 13:50:13 +01:00
Davide Beatrici
3731007915 FIX(shared): Crash in HostAddress::toIPv4()
Bug introduced in 6c565689ae.
2024-01-30 01:04:29 +01:00
Hartmnt
6a48c04784
Merge pull request #6316 from Hartmnt/fix_pulseaudio
FIX(client): Fix PulseAudio regression by nulling buffer
2024-01-24 19:31:22 +01:00
Hartmnt
85f3ef1543 FIX(client): Fix PulseAudio regression by nulling buffer
In b5a67c05f a buffer in the PulseAudio backend was made static, but
at the same time the memset(0) was removed.
In combination, that lead to a bug where the last few frames
of any given audio played back was repeated until something
else filled the buffer.

This commit adds a simple fill to the buffer where the memset(0)
previously was fixing the bug.
2024-01-24 16:42:23 +01:00
Robert Adam
2f47f3e556
Merge PR #6314: BUILD: Detect arm64 / aarch64 architecture 2024-01-21 11:48:26 +01:00
Robert Adam
910c2aa074
Merge PR #6307: FIX(client): Crash when opening connect dialog
When selecting new public servers, we randomize their order. The random number used for that is an unsigned integer from which we compute the modulus with the list size in order to get a random index into the list.

This involved an implicit conversion from an unsigned integer (the random number) to a signed integer (the list index - as Qt uses signed integers for that). Thus, b5a67c0 added an explicit cast to a signed integer. However, it did this to the random number before the modulus operation, meaning that if a large enough random number is drawn, the cast would actually create a negative integer, yielding a negative list index after the modulus. This caused a crash of the application.

The fix consists in switching to using the bounded() function that has an overload for signed integers and which can directly generate numbers in the desired range, making all of the above superfluous.

Fixes #6306
2024-01-21 11:22:03 +01:00
Robert Adam
41fac28709 FIX(client): Crash when opening connect dialog
When selecting new public servers, we randomize their order. The random
number used for that is an unsigned integer from which we compute the
modulus with the list size in order to get a random index into the list.

This involved an implicit conversion from an unsigned integer (the
random number) to a signed integer (the list index - as Qt uses signed
integers for that). Thus, b5a67c05fb added
an explicit cast to a signed integer. However, it did this to the random
number before the modulus operation, meaning that if a large enough
random number is drawn, the cast would actually create a negative
integer, yielding a negative list index after the modulus. This caused a
crash of the application.

The fix consists in switching to using the bounded() function that has
an overload for signed integers and which can directly generate numbers
in the desired range, making all of the above superfluous.

Fixes #6306

Co-authored-by: Thomas Lange <thomas-lange2@gmx.de>
2024-01-21 10:48:33 +01:00
Quertin
f996b3d706 BUILD: Detect arm64 / aarch64 architecture 2024-01-21 10:42:55 +01:00
Robert Adam
4fa4c654e9
Merge PR #6315: CI(freebsd): Build with C++17
The protobuf version on the FreeBSD CI image that we are using requires
C++17.
2024-01-21 10:42:47 +01:00
Robert Adam
473e69cca8 CI(freebsd): Build with C++17
The protobuf version on the FreeBSD CI image that we are using requires
C++17.
2024-01-21 10:17:49 +01:00
Robert Adam
a090f8e164 BUILD: Allow overwrite of cpp standard
If CMAKE_CXX_STANDARD is specified on the command line when invoking
cmake, its value will be respected instead of being overwritten by
the project.
2024-01-21 10:17:22 +01:00
Robert Adam
84e881dcff
Merge PR #6303: BUILD(mach-override): Make use of standard C headers 2024-01-07 20:11:18 +01:00
Robert Adam
307cabdd8a BUILD(mach-override): Make use of standard C headers 2024-01-07 19:47:04 +01:00
Robert Adam
3df6d631e9
Merge PR #5960: BUILD(cmake): Use external module for compiler flags 2024-01-07 18:51:12 +01:00
Robert Adam
6b4b50f8f2 BUILD: Use LTO by default for everything but Debug builds
Instead of relying on explicitly having to use the "Release" target, we
now enable LTO for everything but the special "Debug" target. That is,
we assume that every configuration other than "Debug" is likely meant as
some sort of release build (potentially with external flags) and thus
we want to make use of LTO.
2024-01-07 17:41:25 +01:00
Robert Adam
b5a67c05fb REFAC: Fix tons of warnings and non-portable code
In various places we relied on compiler extensions such as
variable-length arrays on the stack or using non-standard escape
sequences. In order to make our code as portable as possible, these
parts of the code have been refactored to only use standard C++.

Furthermore, the new warning settings triggered a bunch of new warnings
all over the place that have been addressed by this commit.
2024-01-07 17:10:11 +01:00
Robert Adam
ded91ed2c8 FIX(client): Migration of GKey shortcuts
The migration path was implemented in
0e17c5394c but the QUuid object created
for the GKey keyboard shortcuts had an error in the constructor
arguments (wrong pairing of bytes) which would lead to some bytes being
discarded and thus to a different (invalid) QUuid.
This has been fixed.
2024-01-07 17:10:11 +01:00
Robert Adam
6c565689ae REFAC: Get rid of union in HostAddress
The way this union was accessed is not covered by the C++ standard and
was therefore undefined behavior. Therefore, the code was rewritten to
stick to standard C++.
2024-01-07 17:10:11 +01:00