Commit Graph

6083 Commits

Author SHA1 Message Date
Robert Adam
84d49d5c9b
Merge PR #5531: CHANGE(client): Use JSON file for storing settings
This PR streamlines the settings format on all OS and (hopefully) increases the readability
of the settings file A LOT (more or less self-explaining settings identifiers instead of some
weird terms or variable names only understood by the core devs themselves (if at all)).

In addition to and surrounding this feature, several changes, improvements and fixes on
the general topic of handling settings are included as well. See individual commit messages
for details.

Fixes #1940

As an aside: This change is an important step towards being able to provide portable Mumble
installations.
2022-02-11 18:47:11 +01:00
issue
727049c526 FIX(client): Percent encoded links not clickable
If a link contains any percent encoded characters (e.g. umlauts),
the markdown parser sets a wrong offset, thus resulting in a cut off
link in the log.

This is fixed by adjusting the url parsing regex to include a percent
symbol.
2022-02-10 19:32:19 +01:00
Robert Adam
f4d8e01b6d REFAC(client): Convert Screen to namespace
The Screen struct has only been used as a namespace anyway and thus, it
is now converted into a proper namespace. This has the nice side-effect
of fixing name-clash issues with e.g. the X11 headers that also define a
Screen struct.
2022-02-07 20:22:34 +01:00
Robert Adam
2a97bc219f TRANSLATION: Update translation files 2022-02-07 20:22:30 +01:00
Robert Adam
c06bdbca3c FIX(client): Save shortcuts in a single DB transaction
The server-specific shortcuts, which are saved to the DB, were
previously saved in two steps: First deleting all old shortcuts that are
stored in the DB for that server and then inserting the new shortcuts
afterwards.

However, if Mumble was to crash or forcefully quit for another reason
between these two steps, the server-specific shortcuts would be lost
completely (the old ones have been intentionally deleted from the DB and
the new ones haven't been saved yet).

Therefore, this commit now wraps these two steps into a single
transaction, which will execute atomically. So either the full
transaction succeeds (in which case the new shortcuts are saved as
expected) or it fails (or is aborted) in which case it will undo all
changes made so far (thus, in this case at least the old shortcuts that
have been stored previously are retained).
2022-02-07 20:20:10 +01:00
Robert Adam
6fa909f7f0 FIX(client): DB transactions not effective
In the DB code at some places several SQL statements where packed in a
transaction to ensure atomicity of these instructions. However, instead
of accessing our created DB instance directly, they started the
transaction on the DB returned by the static function
QSqlDatabase::database(), which returns a DB with a default name. Since
we are using an explicit name for our DB, this default DB does not exist
and therefore starting the transaction on it will do nothing.

This commit fixes this by starting and committing the transaction on our
created DB instance directly.
2022-02-07 20:17:53 +01:00
Robert Adam
db5fd27a71 REFAC(client): Use in-class initialization for settings
Previously the default values for the member fields in the Settings
struct (and related structs) have been performed explicitly in the
corresponding constructor (if there even was one).

Besides the constructors not using initialization lists but instead
assigning a value in the constructor body (supposedly slower than member
initialization lists), this also blew up the constructor's size and
required to duplicate all variables in there (and not forget any, which
could in turn cause UB due to uninitialized memory).

For these reasons, this commit refactors these structs to us in-class
initialization of all member variables. Some of these values might get
overwritten in the corresponding constructor (e.g. if the value depends
on a preprocessor flag) but for most variables, this is not the case.

The script for generating the Settings JSON serialization was adapted
accordingly.
2022-02-07 20:15:32 +01:00
Robert Adam
2480e1342e TEST(client): Settings JSON serialization 2022-02-07 20:10:23 +01:00
Robert Adam
900378756c BUILD(cmake): Use object-library for client-sources
Previously all source files were added to a single executable file
(library on Windows). This makes reusing the source files (e.g. linking
them to test cases) close to impossible.

Therefore, this commit changes this by compiling all source files into
an object library that can be used for the aforementioned
executable/library but also be reused (e.g. in tests).
2022-02-07 20:07:58 +01:00
Robert Adam
20f47f1bbf FEAT(client): Immediately save settings
Previously settings were only saved upon Mumble's exit. This commit
makes sure that the settings are also saved to file every time, the user
accepts the settings window. That way settings are guaranteed to survive
potential crashes or other hard-exits of Mumble (e.g. Ctrl+C, Task
manager, etc.).
2022-02-07 20:05:35 +01:00
Robert Adam
d0628628d3 REFAC(client): Don't delete shortcuts on save
The Database::setShortcut function is used to save server-specific
shortcuts to the DB. However, at the same time it also deletes these
shortcuts from the passed list. This is a very unintuitive side-effect
of this function that also prevents saving shortcuts intermediately
instead of only upon disconnecting from a server (at which point we
indeed want to remove server-specific shortcuts).

Therefore, this commit removes this side-effect and instead explicitly
removes these shortcuts on disconnecting from a server.
2022-02-07 20:03:03 +01:00
Robert Adam
fe9f48331b FEAT(client): Prompt to load backup settings after crash
We save a flag into our settings that indicates whether Mumble has quit
normally at the time the settings were saved. If upon loading, we don't
find this flag set, we have to assume that this may be because Mumble
has crashed the last time. Since the crash may be caused by changed
settings, we offer the user the possibility to load the backup settings
instead.
2022-02-07 20:00:43 +01:00
Robert Adam
2002e6d668 CHANGE(client): Use JSON file for storing settings
Previously we used different formats on different platforms (registry on
Windows, plists on macOS, ini files on Linux). This commit makes sure
that the same format is used on all platforms, regardless of the used
OS.

In this process a few unneeded settings have been removed and the
settings migration path has been tidied up as well (the code from
main.cpp was moved to Settings.cpp and the original uiUpdateCounter
variable was completely removed and replaced with logic inside the
routines handling the JSON (de)serialization of settings.

The old settings should be overtaken without issues and converted into
the new format on-the-fly without the user taking any notice of this.
From that on, the JSON settings file will be used instead.

Fixes #1940
2022-02-07 20:00:41 +01:00
Felix Singer
b4fe92dee0 MAINT(manpages): Replace murmur with mumble-server
The name `murmur` is deprecated and shouldn't be used anymore, as
decided by the Mumble project. While the server binary already uses the
"new" name, the man pages don't. Thus, rework the man pages so that its
successor `mumble-server` instead `murmur` is used and rename the
filenames of the man pages accordingly.

Also, rename the script `murmur-user-wrapper` to
`mumble-server-user-wrapper`, since also its man page is renamed.

This does not affect the configuration file `murmur.ini`.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
2022-02-07 08:32:23 +01:00
Robert Adam
450bd1c459
Merge PR #5509: BUILD(client): Remove USE_OPUS define
CELT support will be removed, so Opus will not be optional any longer.
2022-02-06 20:44:31 +01:00
Robert Adam
06c51e6638
Merge PR #5540: DOCS: Fix typos 2022-02-06 20:43:35 +01:00
Klemens Nanni
64cbb954dd BUILD(client): Remove USE_OPUS define
CELT support will be removed, so Opus will not be optional any longer.

Remove all code outside of `USE_OPUS` scope with
```
$ git grep -w -l USE_OPUS -- '**/*'.{h,hpp,cpp} |
	xargs unifdef -B -D USE_OPUS -M ''
```

This is a no-op since it has already been defined unconditionally.

Supersedes #5505.
2022-02-06 18:38:36 +01:00
Robert Adam
355987eff0
Merge PR #5530: FIX(client): Fix PipeWire not being usable in Flatpaks
PipeWire is correctly built and enabled in a Flatpak runtime, but does not properly intialize because the .so filename of the library is named slightly differently there.

See also flathub/info.mumble.Mumble#19 (comment)

After this, I can select PipeWire as back end in the Flatpak build. As mentioned in the above issue, it doesn't actually work yet after selecting it (no input or output is generated), but it's a first step. I'll do some digging to see if I can fix the second issue as well in a separate PR.
2022-02-06 18:31:56 +01:00
luz paz
b0016256af DOCS: Fix typos
Found via `codespell -q 3 -S *.ts,./3rdparty,./3rdPartyLicenses -L
aci,ba,crypted,datas,doubleclick,feld,hsi,ist,keypair,ro,unknwn`
Includes misc. fixes to .github/ and cmake files
2022-02-06 18:27:12 +01:00
Robert Adam
31a0225e40
Merge PR #5550: BUILD(client,server): Include time.h instead of sys/time.h
Including sys/time.h instead of time.h was causing compile errors in
certain environments.

Related: f6a546b

Fixes #5546
2022-02-06 18:23:25 +01:00
Robert Adam
a870610409 BUILD(client,server): Include time.h instead of sys/time.h
Including sys/time.h instead of time.h was causing compile errors in
certain environments.

Related: f6a546b7f6

Fixes #5546
2022-02-04 20:06:09 +01:00
issue
fa88a20312 FIX(client): Icon not used on Plasma Wayland session
In a Plasma Wayland session the Mumble icon was not used in the task bar,
instead the generic Wayland icon shows up.
Setting the desktop file name resolves this.

Fixes #4851
2022-01-29 17:22:47 +01:00
Gert
29eb97cf1d FIX(client): Fix PipeWire not being usable in Flatpaks
PipeWire is correctly built and enabled in a Flatpak runtime, but does
not properly intialize because the .so filename of the library is named
slightly differently there.

See also https://github.com/flathub/info.mumble.Mumble/issues/19#issuecomment-1023001248
2022-01-27 20:38:08 +01:00
Robert Adam
0e204e1d61
Merge PR #5438: FEAT(client): Industry standard for hold time
As request in #2453, this commit implements the industry standard
for microphone hold time for voice activation detection. The calculation
that yields hold time (s) from the iVoiceHold setting is described and
comments are added to describe the function of related fields.

Implements #2453.
2022-01-25 17:22:16 +01:00
Robert Adam
5a93c1d5ec
Merge PR #5504: MAINT(client): Remove SBCELT leftovers
This is dead code since c5644c7.
2022-01-23 15:24:06 +01:00
Klemens Nanni
bceec3dbfe MAINT(client): Remove SBCELT leftovers
This is dead code since
```
commit c5644c7d73
Author: Robert Adam <dev@robert-adam.de>
Date:   Thu May 7 08:14:09 2020 +0200

    3rdparty: Removed sbcelt submodule as it is not used and broken
```
2022-01-22 11:36:52 +03:00
Klemens Nanni
22f1fa8752 BUILD(client): CELT: Require version 0.7.x when using the system library
The bundled version is 0.7.0 and versions >0.7.x are NOT supported.

At least on OpenBSD (only packaging 0.11.x), the built would fail.
Yield and error at configure time with this fix.

CMake's `find_package()` function accepts an optional `version` argument
but Mumble's `find_pkg()` wrapper does not (treating it as package), so
roll our own check/error:

```
-- celt found | Version: 0.11.1
CMake Error at src/mumble/CMakeLists.txt:677 (message):
  CELT 0.7.x is required, found 0.11.1!
```

Relates to #4476.
2022-01-22 03:07:20 +03:00
Robert Adam
db3a280585
Merge PR #5487: BUILD(client): Enable XInput2 support on OpenBSD by default 2022-01-21 21:20:54 +01:00
Klemens Nanni
904bae159d BUILD(client): Enable XInput2 support on OpenBSD by default
The library is readily available in OpenBSD's version of X[0].
Follow suit with Linux in enabling.

Noticed by the warning upon startup:

```
-<W>2022-01-21 02:30:40.548 GlobalShortcutX: No XInput support, falling back to polled input. This wastes a lot of CPU resources, so please enable one of the other methods.
+<W>2022-01-21 02:34:00.159 GlobalShortcutX: Using XI2 2.4
```

0: https://xenocara.org/
2022-01-21 22:06:53 +03:00
Robert Adam
e504c9711c
Merge PR #5468: Improve appstream metadata
This changes the appstream id to info.mumble.Mumble, which is correct in regards to the specification.

This mostly upstreams the appstream metadata that was previously used for flatpak.
2022-01-21 19:54:09 +01:00
Robert Adam
27ad2debec
Merge PR #5479: BUILD: Fix -Wunused-function when compiling without rnnoise
The clampFloatSample function is only used when rnnoise support is enabled, when it isn't this the presence of the function (since it is static) causes a -Wunused-function warning which ultimately ends up causing a build error due to -Werror.
2022-01-21 19:02:23 +01:00
Jonah Brüchert
36e6592603
FIX(client): Improve appstream metadata
This changes the appstream id to info.mumble.Mumble, which is correct in regards to the specification.

Fixes #5441
2022-01-19 19:23:28 +01:00
Jameson Wright
5a3f6780c8 FEAT(client): Industry standard for hold time
As request in #2453, this commit implements the industry standard
for microphone hold time for voice activation detection. The calculation
that yields hold time (s) from the iVoiceHold setting is described and
comments are added to describe the function of related fields.

Implements #2453.
2022-01-19 12:25:19 -05:00
Sören Tempel
930aa1a532 BUILD: Fix -Wunused-function when compiling without rnnoise
The clampFloatSample function is only used when rnnoise support is
enabled, when it isn't this the presence of the function (since it is
static) causes a `-Wunused-function` warning which ultimately ends up
causing a build error due to `-Werror`.
2022-01-19 00:32:08 +01:00
Sören Tempel
f6a546b7f6 BUILD: include poll.h for poll(3) (instead of sys/poll.h)
As per POSIX.1-2008, the correct header to include for poll(3) is
poll.h. Including sys/poll.h instead of poll.h causes the following
warning message on Alpine Linux:

	/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
	    1 | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>

Due to `-Werror`, this ultimately causes the build to fail.
2022-01-19 00:19:46 +01:00
Robert Adam
37c33fe01b
Merge PR #5443: FIX(server): Add missing line breaks to --help output 2022-01-18 12:03:36 +01:00
Felix Singer
00983b8be0 FIX(server): Add missing line breaks to --help output
Signed-off-by: Felix Singer <felixsinger@posteo.net>
2022-01-17 17:05:25 +01:00
Timo Gurr
d2838e2731 BUILD: Use GNUInstallDirs to install resources into share
GNUInstallDirs is already used in cmake/install-paths.cmake. This fixes
arch-independent files ending up in $prefix/share instead of /usr/share.
This is required on multiarch/cross layouts setting the prefix to e.g.
/usr/x86_64-pc-linux-gnu or /usr/i686-pc-linux-gnu.
2022-01-17 16:29:05 +01:00
Klemens Nanni
d45318d649 BUILD(client): RNNoise: Support linking against the system library
OS packages (at least on Linux and BSDs) prefer prepackaged libraries to
bundled/statically linked versions where possible.

Introduce `rnnoise` (default `ON`) and make `bundled-rnnoise` default to
it's value;  this retains current behaviour.

This way, `rnnoise=OFF` disables use of RNNoise completely and a simple
`bundled-rnnoise=OFF` requires the system's library.

Tested on OpenBSD 7.0-CURRENT.
2022-01-13 09:57:28 +01:00
Robert Adam
d5cb83f32d
Merge PR #5417: BUILD(audiowizard): Fix build with -Dspeechd=OFF -Dwarnings-as-errors=ON
Move the declaration/definition of `iMessage` to where it is used,
otherwise the build fails with

```
src/mumble/AudioWizard.cpp:95:10: error: variable 'iMessage' set but not used [-Werror,-Wunused-but-set-variable]
        quint32 iMessage = Settings::LogNone;
                        ^
1 error generated.
```

Build-tested on OpenBSD 7.0-CURRENT using
```
$ cc --version
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.0
Thread model: posix
InstalledDir: /usr/bin
```
2022-01-12 14:33:38 +01:00
Klemens Nanni
a707213aa1 BUILD(client): Plugin framework: Use correct struct kinfo_proc members on NetBSD/OpenBSD
`struct kinfo_proc` members are prefixed with `p_` in
OpenBSD (http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/sysctl.h?annotate=1.220) and
NetBSD  (cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/sysctl.h?annotate=1.236)

FreeBSD (https://cgit.freebsd.org/src/tree/sys/sys/user.h?id=01cad731921bb60b4f6e04c1cac987eea7af9d08#n121)and presumably Linux (I did not check) use the `ki_` prefix.

Build-tested on OpenBSD 7.0-CURRENT.
2022-01-11 22:32:15 +01:00
Klemens Nanni
ccbacbf0ab BUILD(client): Plugin framework: Pass element size to kvm_getprocs(3) on OpenBSD
There is an additional `elemsize` argument
(https://man.openbsd.org/kvm_getprocs.3):

	Only the first elemsize bytes of each array entry are returned.

Complete OpenBSD signature:
```
struct kinfo_proc *
kvm_getprocs(kvm_t *kd, int op, int arg, size_t elemsize, int *cnt);
```

Linux, FreeBSD and NetBSD have the same four-argument signature:
```
struct kinfo_proc *
kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt);
```

Build-tested on OpenBSD 7.0-CURRENT.
2022-01-11 22:32:15 +01:00
Klemens Nanni
42ad5edf5a BUILD(client): Plugin framework: Use KVM_PROC_ALL on NetBSD/OpenBSD
kvm_getprocs(3) on Linux and FreeBSD
(https://www.freebsd.org/cgi/man.cgi?kvm_getprocs) has
```
	KERN_PROC_PROC	all processes, without threads
	...
```

OpenBSD (https://man.openbsd.org/kvm_getprocs.3) and
NetBSD  (https://man.openbsd.org/kvm_getprocs.3) however only know
```
	KERN_PROC_KTHREAD
		all processes (user-level plus kernel threads)
	KERN_PROC_ALL
		all user-level processes
	...
```
and
```
	KERN_PROC_ALL	all processes
	KERN_PROC_PID	processes with process id arg
	...
```
respectively, thus fall back to KERN_PROC_ALL where needed.

Build-tested on OpenBSD 7.0-CURRENT.

NB:  The first hunk around kvm_openfiles(3) is from `clang-format`.
(should've have happened in the commit introducing this line, I guess.)
2022-01-11 22:29:54 +01:00
Klemens Nanni
0c769d87a1 BUILD(audiowizard): Fix build with -Dspeechd=OFF -Dwarnings-as-errors=ON
Move the declaration/definition of `iMessage` to where it is used,
otherwise the build fails with

```
src/mumble/AudioWizard.cpp:95:10: error: variable 'iMessage' set but not used [-Werror,-Wunused-but-set-variable]
        quint32 iMessage = Settings::LogNone;
                        ^
1 error generated.
```

Build-tested on OpenBSD 7.0-CURRENT using
```
$ cc --version
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.0
Thread model: posix
InstalledDir: /usr/bin
```
2022-01-11 22:25:09 +01:00
Robert Adam
4ad90046b1 FEAT(client): Improve handling of IP masks in BanEditor
When using the BanEditor to manually create a new Ban entry, it was
really easy to get the "mask" property wrong, which had the effect of
apparently not performing any action at all, when clicking on the "Add"
button.

The underlying problem was most likely that the "mask" field defaults to
128, which is only valid for IPv6 addresses. When entering an IPv4
address, the mask would be considered invalid (through some internal
wizardry) and thus the Ban would not be added.
However, the user was not presented with any kind of error message that
would have hinted at the problem.

This commit tackles this issue by first of all validating that the
entered IP address is valid. If it is not, then the respective input
field will be colored red. If it is, the mask spin box's maximum value
will automatically be set to the correct maximum value for the used IP
address flavor (32 for IPv4 and 128 for IPv6).

That way the user can only ever press "Add", if they entered a valid IP
address alongside a valid mask. Thus, pressing "Add" should now always
add the respective ban.

Fixes #3986
2022-01-07 19:17:36 +01:00
Robert Adam
d100ff1467 MAINT: Update copyright to 2022 2022-01-04 20:17:33 +01:00
Robert Adam
ef045be7fe
Merge PR #5400: BUILD: Remove concept of an RELEASE_ID
Having a separate RELEASE_ID just unnecessarily complicates drafting
releases. Plus, now that we are using different build numbers for every
new build anyway, a separate release ID is really not necessary.
2022-01-02 12:12:46 +01:00
Robert Adam
6caa808e67 BUILD: Remove concept of an RELEASE_ID
Having a separate RELEASE_ID just unnecessarily complicates drafting
releases. Plus, now that we are using different build numbers for every
new build anyway, a separate release ID is really not necessary.
2022-01-01 20:38:40 +01:00
Robert Adam
e2622fe453
Merge PR #5397: CHANGE(client): Remove channel listener persistence
This is done, since the underlying framework for how channel listeners
are handled (more specifically: where they are stored) will be changed
in an upcoming PR. This upcoming change will cause listener persistence
to only apply to registered users. Thus, if the current persistence
feature was to be retained, that would mean that when introducing this
change, we'd remove a feature from Mumble.

As that is not a great thing to do, we'll remove the feature now that it
is still unreleased and then the upcoming change will introduce
persistence for some users instead of taking it away from others.

Furthermore, this PR fixes a little bug that made it possible for channel listeners
to be shown multiple times in the UI.
2021-12-29 19:25:08 +01:00
Robert Adam
db57b63241
Merge PR #5396: FEAT(server): Add support for the tracy profiler
Tracy (wolfpld/tracy) is a profiler that is aimed at
having a very low impact on the runtime performance and is thus suitable
to be used in production systems to figure out what is going on and how
the code is performing.

For the time being, this commit instruments only the server code.
Furthermore, the instrumentation is performed in a rather minimalistic
way that should suffice to start profiling audio and control message
processing but is definitely far from being complete. Further
instrumentation will be added on-demand.
2021-12-29 18:52:42 +01:00