1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

4187 Commits

Author SHA1 Message Date
Anthony Bilinski
ece26e4a4f
refactor: Remove some useless casts
Can't actually enable Wuseless-cast though because Qt's MOC-generated code is
full of them.
2022-03-11 10:22:13 -08:00
Anthony Bilinski
afe5d9d82a
refactor: Comply with Wformat 2022-03-11 10:22:13 -08:00
Anthony Bilinski
3a03c8f043
refactor: Comply with Wnull-dereference
* Add check before dereferencing return from qobject_cast
2022-03-11 10:22:13 -08:00
Anthony Bilinski
17043dbc45
refactor: Comply with Wmaybe-uninitialized 2022-03-11 10:22:09 -08:00
Anthony Bilinski
bda1a6a909
refactor: Comply with Wpedantic
* Remove semicolons after calling a macro
* Remove semicolons at the end of class declarations
* Remove semicolons at the end of namespaces
2022-03-11 10:08:02 -08:00
Anthony Bilinski
4b2cf53a55
refactor: Comply with Wundef
Don't try to read undefined macros.
2022-03-11 10:08:02 -08:00
Anthony Bilinski
adc0f0cca6
refactor: Comply with Wmissing-declarations
* Move free functions to the anonymous namespace
* Additionally move static free functions to the anonymous namespace
* Move functions that must be accessed externally to static class functions
2022-03-11 10:08:02 -08:00
Anthony Bilinski
b0bf3d77cb
refactor: Comply with Wdouble-promotion
Remove implicit float to double conversions.
2022-03-11 10:08:02 -08:00
Anthony Bilinski
02d5270dcc
refactor: Comply with Wmissing-field-initializers
Add explicit missing initializers.
2022-03-11 10:08:02 -08:00
Anthony Bilinski
809c695718
fix(ui): Pass NetCamView's parent pointer to base QWidget 2022-03-11 10:08:02 -08:00
Anthony Bilinski
48ad6cc17a
refactor: Comply with Wunused-parameter
Explicitly ignore unused parameters.

Also replace Q_UNUSED with std::ignore for consistency and to favour std
over Qt when equivalent.
2022-03-11 10:07:57 -08:00
Anthony Bilinski
288f44ba5a
refactor: Comply with Wdeprecated-copy
Remove implicitly declared copy constructors
2022-03-11 08:35:38 -08:00
Anthony Bilinski
919c6c9fe7
refactor: Comply with Wunused-but-set-variable
Remove unused variables.
2022-03-11 08:35:38 -08:00
Anthony Bilinski
ae8ffc42cf
refactor: Comply with Wreorder
Don't reorder constructor init from class claration order.
2022-03-11 08:35:38 -08:00
Anthony Bilinski
f25e855839
fix(ui): Use GenericChatItemWidget construction compact argument 2022-03-11 08:35:38 -08:00
Anthony Bilinski
b429e562e2
fix(widget): Update widget's core on core update
We no longer support changing cores, but might as well not leave it in a
clearly broken state.
2022-03-11 08:35:38 -08:00
Anthony Bilinski
fc2e445294
refactor: Comply with Wshadow
Avoid shadowing variables:
* Rename variables to something better if possible
* If not, postfix shadowing arguments with _. Favour leaving member
  variables without postfixes.
* Rename variables prefixed with _ to avoid library function collisions
* Avoid double underscore anywhere in names
* Make definition and declaration argument names match where seen
* Favour using class variable over argument variable, where equivalent
* Remove explicit this-> where equivalent
2022-03-11 08:35:38 -08:00
Anthony Bilinski
25c8904416
chore: Add Q_OBJECT macro to NotificationGenerator
Qt requires it for QObject-derived classes.
2022-03-11 08:27:33 -08:00
Anthony Bilinski
cb4af27791
refactor(history): Remove unused and undefined getPeerId 2022-03-11 03:12:32 -08:00
Anthony Bilinski
4f9ca0a411
feat(Core): Add support for retrieving self DHT ID and port
To allow qTox (but just tests for now) to be bootstrapped off of.
2022-03-10 17:29:02 -08:00
Anthony Bilinski
6e7cc6de40
chore: Remove undefined Core::sendFile
Files are handled by CoreFile.
2022-03-10 17:28:29 -08:00
Anthony Bilinski
e740859ef9
feat(history): Add self join/part messages
Makes it so that looking back in chat history, you can see which users you were
connected to for any message. Otherwise self client restarts are unseen.
Follows showGroupJoinLeaveMessages setting which defaults to false, so only
users who opt in will see the messages.

Scrap generic numArg handling. It somewhat increases complexity and doesn't
reduce code either.
2022-03-10 16:23:46 -08:00
Anthony Bilinski
9145dc1cae
refactor(history): Remove unused friendPk from FileDbInsertionData 2022-03-08 23:26:18 -08:00
Anthony Bilinski
ac4f01cf7f
feat(logging): Hide toxcore spam when using IPv4 2022-03-07 23:30:02 -08:00
Anthony Bilinski
a96deb7bc0
refactor(settings): Remove unused Settings::getFriendAddress 2022-03-07 16:40:30 -08:00
Anthony Bilinski
4580d3f106
fix(core): One time reset of user bootstrap node list to default
Due to poor design, bootstrapNodes.json was saved the same if manually set by
user, or if just storing qTox defaults. Because of this, for users using
defaults, they would be stuck with stale defaults indefinitely without this one
time reset.

The user list that's removed is backed up to bootstrapNodes.backup.json.

Going forward, the user list and default list will be stored separately.

Fix #6452
2022-03-06 06:00:13 -08:00
Anthony Bilinski
08fdd3a2c7
feat(core): Store default bootstrap list separate from user list
Allows qTox to tell the difference between a default list that should be
upgraded when defaults are changed, ora user list that should never be changed.
2022-03-06 06:00:13 -08:00
Anthony Bilinski
2b41a06b55
feat(Settings): Add system for versioning and upgrading Settings
Similar to how History handles SCHEMA_VERSION. Run separately on global and
personal settings, since some state in global, and personal settings can’t be
done globally since they require the passkey.

Restrict a user from downgrading past the saved settings version, due to
possible compatibility breaks or old qTox versions re-introducing corrupt state
that was already healed.

Pass in new profile state for personal settings rather than relying on settings
file presence because personal settings can be stored in either the personal
settings file or global settings file. This was introduced in
aea9eea8a4e2f95a7175954183959c1070bcc315 when personal settings were first
moved to their own file.
2022-03-06 06:00:13 -08:00
Anthony Bilinski
7a3474bf55
feat(chatlog): Add support for ed2k file links 2022-03-05 01:00:08 -08:00
Anthony Bilinski
e426994e5f
test: Fix issues with core_online_test
* Move static function variables from core to be class member variables,
  allowing two Core instances to run at once
* Replace deprecated QLatin1Literal with QLatin1String
* qvariant_cast slot argument to ToxPk, rather than trying to convert variant
  to bytes directly which is invalid
* Fix "wait for both to come online" accidentally waiting for Bob twice
* Move all sleeps to QTRY_VERIFY_WITH_TIMEOUT to speed up test
* Update settings* -> settings& based on Core API change
* Update Mock to match API change of IBootstrapListGenerator
* Register metatype of ToxPk, uint32_t, Status::Status
* Correct Alice's spy looking for Bob's pk
2022-03-02 23:30:04 -08:00
Devan Carpenter
355dfb7a7f feat(chatlog): Add gemini:// to hyperlink regex 2022-03-02 20:19:42 +00:00
Anthony Bilinski
aeb8a9aca1
refactor(bootstrap): Use std::shuffle instead of custom not fully random logic
Simplifies logic and naming.
2022-02-24 16:28:59 -08:00
Anthony Bilinski
0cb222c056
feat(i18n): Handle English plural forms in translations
Special case that only needs plurals translated.
2022-02-23 21:12:16 -08:00
Anthony Bilinski
0df98ce64f
fix(group): Change join leave message setting default to false
Matches the similar status change notification for 1:1 chats, and was the
original plan for this feature.
2022-02-23 04:48:19 -08:00
Anthony Bilinski
6f9123705a
fix(core): Fix logic error retrieving TCP port
Introduced in e7e30ada8cd33f0dd4adfdb3c021b75e28232057
2022-02-21 05:19:03 -08:00
Anthony Bilinski
7aa8d7178e
refactor(bootstrap): Store public key as ToxPk rather than QString 2022-02-21 02:51:41 -08:00
Anthony Bilinski
e7e30ada8c
fix(core): Use node's TCP ports when connecting to TCP relay
Allows connecting to TCP relays that aren't acting as bootstrap nodes, and
connecting to TCP relays that have different or additional TCP ports compared
to UDP ports.
2022-02-21 02:51:34 -08:00
Anthony Bilinski
3d36cf47e8
refactor(bootstrap): Rename UDP port from port to udpPort 2022-02-21 02:49:23 -08:00
Anthony Bilinski
de924cfdc7
feat(chatlog): Disable join and leave system messages based on setting 2022-02-20 18:15:00 -08:00
Anthony Bilinski
069ab92fd0
feat(UI): Add UI For controlling group join and leave system messages setting 2022-02-20 18:14:55 -08:00
Anthony Bilinski
1be5b99d17
feat(Settings): Add setting for hiding group join and leave system messages
Messages can become spammy is long lasting quiet groups, drowning out real user
messages
2022-02-20 17:32:23 -08:00
Anthony Bilinski
e5df648e1a
refactor(settings): Use IGroupSettings in GroupChatForm
Move interface signals from Settings to be declared by the interface itself
2022-02-20 17:32:23 -08:00
Anthony Bilinski
0adf4a00f3
refactor(chatform): Remove useless static cast 2022-02-20 17:32:23 -08:00
Anthony Bilinski
18643da271
refactor(chatform): Pass Settings to GroupChatForm instead of calling getInstance()
One small step away from propagating singleton use
2022-02-20 17:32:22 -08:00
Anthony Bilinski
3180d23ee2
fix(core): Don't apply Windows file transfer rename on other platforms
Filename cleaning was originally introduced for Windows
https://github.com/qTox/qTox/issues/1304. It's unneeded on other platforms, so
leave file names as they're sent there.

Fix #5242
2022-02-20 17:14:10 -08:00
Anthony Bilinski
9ac44ee09c
fix(history): Replace invalid Tox ID saved in peers table with Tox public key
Due to an old bug that has since be fixed, old history dbs can contain both a
Tox ID version and Tox public key version of the same friend, and always
themselves. They could have n more duplicates if they've updated their nospam.

Tox ID is an invalid length to be stored in strongly typed ToxPk, and in
general having multiple entries belonging to the same user effectively violates
our UNIQUE constraint on public_key.

Introduced in 7168d2b8589a3670f9b5c5d88d5a5d20f1bf5966

Fix #6485
2022-02-20 14:27:33 -08:00
Anthony Bilinski
56eed63fde
fix(core): Fix missed ToxId to ToxPk constructions 2022-02-19 05:37:01 -08:00
Anthony Bilinski
ddebf6ee7a
fix(crash): Handle nightly tag name in update check
We didn't use to have a nightly tag, so git describe would include the
verison of the last release even for nightly or dev builds. Now that the
nightly tag exists, which is required for github release craeation, it
breaks out git describe parsing, and there's no way for us to tell if a
user is behind the next release or not.

Instead just don't check update status if the user isn't on a release
tagged version.
2022-02-19 03:28:21 -08:00
Anthony Bilinski
4b3f50a0c0
chore(l10n): Fix ordering of languages in code 2022-02-19 03:26:11 -08:00
Anthony Bilinski
188fe340f2
feat(l10n): Add Urdu and Icelandic translations 2022-02-19 03:26:11 -08:00