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

8141 Commits

Author SHA1 Message Date
Anthony Bilinski
b894531cdb
fix(tests): Mock Settings for SmileyPack test
Settings upgrades global settings on construction, which can cause the
SmileyPack test to be inconsistent based on file system state.

Fix #6530
2022-03-15 01:32:16 -07:00
Anthony Bilinski
e5f16d812e
chore(macOS): Remove support for old AvFoundation
We no longer need conditional support for the older API since our minimum supported version is now 10.15.
2022-03-14 14:48:41 -07:00
Anthony Bilinski
16aeb5f572
refactor(model): Rename Contact and ContactId to Chat and ChatId
* Referring to groups generically as contacts is confusing.
* Friends are referred to as contacts in many places either as more
  neutral wording, or to avoid using the keyword friend as a variable
  name. Calling Contact Chat allows contact to be used for Friends.
2022-03-14 12:44:37 -07:00
Anthony Bilinski
cf5be40511
refactor(Style): Move fonts storage from array to std::map
Strongly enforces ordering instead of being based off comments, and logically
represents the relation better.
2022-03-14 10:43:26 -07:00
Anthony Bilinski
b9c4b0075c
refactor(Style): Move Style enums to enum class 2022-03-13 16:00:48 -07:00
Anthony Bilinski
0c967725df
refactor: Remove Settings singleton
* Make main.cpp's toxSave free functions into a ToxSave class so that it can be
  given Settings on construction.
* Add void* to IPC callbacks so that classes can get back to themselves.
2022-03-13 16:00:48 -07:00
Anthony Bilinski
61b3cb528a
refactor: Remove CameraSource singleton
Grossly expose it publicly from Nexus for the time being since Profile is
sometimes constructed from main, while Nexus is also a singleton. So
CameraSource can't be constructed in main and be passed in to Nexus on
construction. This should be temporary, until Nexus's singleton is
removed as well.
2022-03-13 16:00:48 -07:00
Anthony Bilinski
9bf17acca6
chore(CI): Handle build scripts called with relative paths with spaces
foo=dirname "$0" only works if the script is called with an absolute path and
that path contains no spaces. Add quotes everywhere to contain spaces in
directory names or file names, and add realpath to get the absolute path
regardless of call path.

Not necessarily needed, but like in e405868037
it can avoid some annoying issues when e.g. that script was called with a
relative path in CI.
2022-03-13 06:20:44 -07:00
Anthony Bilinski
3c7ee98bc1
chore(CI): Set bash flags at start of scripts 2022-03-13 06:20:44 -07:00
Anthony Bilinski
69514319fd
chore(CI): Rename Windows build scripts to be used commonly by macOS 2022-03-13 06:20:25 -07:00
Anthony Bilinski
b82580c814
fix(chat): Undo removing of chat message insertion
Inadvertently removed in 919c6c9fe7
2022-03-13 06:05:25 -07:00
Anthony Bilinski
dd9524085f
fix(settings): Heal invalid ToxPk saved to Personal Settings
Fix #6506
2022-03-13 05:28:44 -07:00
Anthony Bilinski
1206da2b05
refactor(ToxPk): Don't define model's ToxPk, ToxId, GroupId from tox.h
Since they exist in saved settings and the chat database, they are their own
size. assert that it matches tox.h's size in Core constructor, though.
2022-03-13 05:28:41 -07:00
Anthony Bilinski
813643adbf
fix(chat): Stop spellcheck from leaking messages to logs 2022-03-13 04:46:46 -07:00
Anthony Bilinski
ba17b5130c
Revert "chore(CI): Disable online tests in all but one CI job"
This reverts commit fd2997c2db.

Core tests are no longer online, so no longer are flaky nor tie up many
minutes of test runner time. So re-enable for all jobs.
2022-03-13 03:21:27 -07:00
Anthony Bilinski
7d773930c1
feat(tests): Merge core and core_online tests
Re-use tox instances between tests to avoid re-bootstrapping or re-requesting
friendship, saving time. Test case order within core_test is now important.
2022-03-13 03:21:09 -07:00
Anthony Bilinski
5f870c28e5
feat(test): Bootstrap core_test off second local tox instance
Allows core_test to be run without internet, and makes it much faster
and less flaky in CI.

Also split socks5 and http tests.
2022-03-13 03:21:05 -07:00
Anthony Bilinski
6f3fb30f24
feat(test): Add mock bootstrap list generator 2022-03-13 01:50:47 -08:00
Anthony Bilinski
7395c1cb3f
refactor(model): Fix case of IBootstrapListGenerator::getBootstrapNodes 2022-03-13 00:42:33 -08:00
Anthony Bilinski
faa72d567e
fix(core): Correct getSelfDhtId's toxcore API 2022-03-13 00:42:07 -08:00
Anthony Bilinski
47328cc6bf
refactor: Remove SmileyPack singleton 2022-03-12 16:28:06 -08:00
Anthony Bilinski
7d40bcf43d
refactor: Remove DocumentCache singleton
Leaf of our evil singleton tree.
2022-03-11 11:26:14 -08:00
Anthony Bilinski
0afc11fafc
chore(build): Migrate existing warning handling to new warnings project 2022-03-11 10:22:13 -08:00
Anthony Bilinski
df58c35998
chore(build): Remove redundant warnings 2022-03-11 10:22:13 -08:00
Anthony Bilinski
aa2e253674
chore(build): Enable lots of compile-time warnings
Taken directly from 9777aa619d/warnings

* Remove Wuseless-cast, because Qt's MOC-generated code hits it.
* Remove Wduplicated-branches, Wduplicated-branches, Wformat-truncation
because they aren't supported on our oldest CI job.
2022-03-11 10:22:13 -08:00
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
a99735d0e0
feat(docs): Add a security policy for disclosing vulnerabilities 2022-03-10 17:42:23 -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
be3e8997c4
chore(CI): apt-get update in gitstats runner
Package cache is stale and causing a failure to install.
2022-03-09 19:31:40 -08:00
Anthony Bilinski
9145dc1cae
refactor(history): Remove unused friendPk from FileDbInsertionData 2022-03-08 23:26:18 -08:00