* Reorder class data members and/or constructor initialisers to match,
reducing confusion about when members will be initialised.
* Remove (most) unused variables. Not removed: some global variables with
`TODO(sudden6)` on them for using them in the future. I don't know how
far into the future sudden6 wants to use them, so I left them there for
now.
* Distinguish different bootstrap nodes in the logs by index in the
bootstrap node list. Originally, we used to log the address/port of the
node we're bootstrapping to. This was removed out of privacy concerns
(even though the bootstrap nodes are public). This made the logs much
less useful when debugging why the client isn't connecting. Having
indices makes it easier to see that different nodes are being selected,
and makes it possible to determine which node was selected.
* Explicitly cast unused results of Tox API functions to `void` when all
we want is to know whether the function succeeds or not.
* Don't try to `#include <unistd.h>` on Windows. It does not exist on
MSVC.
* Remove extra `;` after function definitions.
* Remove reference indirection of QJsonValueRef, since a copy of that ref
(small pointer-like object) has to be made anyway when iterating over
QJsonArrays.
* Make some file-scope global state `static`.
* Use `nullptr` instead of `NULL`.
* Add `#if DESKTOP_NOTIFICATIONS` around the code that implements desktop
notifications, so it becomes a bit easier to compile everything with a
single compiler command - useful for manually running static analysers.
* Fix an error on MSVC where `disconnect` is looked up to be a non-static
member function and the `this` capture is missing.
* Consistently use `struct` and `class` tags for types.
* Use references in ranged-for where it reduces copies.
* Move private static data members out of the Style class and into
file-local scope. There is no need for them to be in the class. Also
marked them `const` where possible.
* Removed unused lambda capture.
* Ensure qTox can compile under NDEBUG with `-Wunused-variable` by
inlining the unused variable into the `assert` that was its only
target.
* Minor reformatting in core_test.cpp.
NSCameraUsageDescription and NSMicrophoneUsageDescription are needed on
newer macOS versions (10.14+) to get access to camera/microphone. This
text is shown to the user when they need to press the "allow" button.
Our previous SQLCiper upgrade code attempted to set SQLCipher 4.0
default params. If SQLCipher 3.x was used at that time, it would result
in only half upgrading the params, since SQLCipher 3.x doesn't support
PRAGMA cipher_hmac_algorithm or PRAGMA cipher_kdf_algorithm. This means
that our databases could be saved with any of three sets of SQLCipher
params.
When doing a short clone, like travis does, git can't tell if the
oldest commit is a merge of not. Just allow either commit message
format for all commits, and rely on reviewers and common sense to not
name normal commits "Merge.*"
Fix#6051
This will prevent qTox from auto-accepting arbitrarily large avatars. Avatars
are already limited by TCS 2.2.4 to 64KB, so we would only receive larger
avatars from badly behaving clients.
Switch from `pkg_search_module` to `pkg_check_modules` to find .pc and
evaluate .pc files of dependencies. Now, in case of any errors, a clear
message is issued about what is wrong, making it obvious what to do.
As of c-toxcore-0.2.11, my system's toxcore.pc file contains this line:
```
Requires.private: libsodium opus vpx
```
Previously, with opus missing, cmake/Dependencies.cmake through an error
about toxcore not being found, but never actually told why (also it was
misleading, because opus was missing, not toxcore).
Before:
```
<...>
-- Checking for one of the modules 'toxcore'
-- TOXCORE not found
-- Checking for one of the modules 'toxav'
-- TOXAV not found
<...>
```
After:
```
<...>
-- Checking for module 'toxcore'
-- Package 'opus', required by 'toxcore', not found
-- TOXCORE not found
-- Checking for module 'toxav'
-- No package 'toxav' found
-- TOXAV not found
<...>
```