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

8212 Commits

Author SHA1 Message Date
Anthony Bilinski
71c3f997b4
refactor: Move FriendList global state into class 2022-03-30 19:04:11 -07:00
Anthony Bilinski
4a74b51bbc
refactor(main): Remove unused sodium_init
Was used by auto-updater which was removed in 7475ba4689
2022-03-30 06:04:57 -07:00
Anthony Bilinski
8a8a34ea64
chore(CI): Update checkout action to v3 2022-03-30 02:47:44 -07:00
Anthony Bilinski
ffbff0bfa8
refactor: Remove ContentDialogManager singleton
Remove some more global state.
2022-03-30 02:08:32 -07:00
Anthony Bilinski
e80db6a532
feat(macOS): Build deps from source, giving backwards compatibility
Keep second CI job building with deps from brew, to test the workflow of a user
building qTox from source, with deps from brew.

Fix #6260
2022-03-30 00:47:12 -07:00
Anthony Bilinski
f3420a0b8f
chore(CI): macOS CI script support for both full dep build or just qTox build 2022-03-30 00:47:12 -07:00
Anthony Bilinski
a877d7d841
chore(CI): Add build script for building all macOS deps 2022-03-30 00:47:12 -07:00
Anthony Bilinski
fbce81b5b1
chore(CI): Split brewfile between building all deps or only qTox 2022-03-30 00:47:12 -07:00
Anthony Bilinski
7565f8b350
fix(main): Construct ToxSave event handler
Bug introduced in 0c967725df, when the class
was added but never constructed.
2022-03-30 00:18:26 -07:00
Anthony Bilinski
16ac8a8eac
refactor(History): Split peers table into chats and authors
peers had combined meaning, both being referenced by history for which
chat a message was in, and being reference by aliases for who authored a
message. This means that peers had conceptually different sub-groups:
all friends are both a chat and an author, but self is an author but not
a chat. With the addition of group chats this is amplified by groups
themselves being chats but not authors, and group members being authors
but not chats. Instead of having four sub-groups all within peers,
splitting peers into chats and authors gives a clean mapping,
simplifying interactions with the data.

In the new chats and authors tables, store what used to be a public_key
string as a BLOB, since it’s inherently a 32-byte binary value in both
cases. Call the public_key a UUID for chats, since group IDs are not
defined as public keys by toxcore.

Even though the data change is quite minor, the upgrade is large because
of SQLite's lack of support for modifying foreign key constrains for
existing tables. This means when peers are moved to new tables, all
tables referencing peers need to be cloned with a new foreign key
constraint, as well as all tables referencing those, recursively.
2022-03-29 21:27:01 -07:00
Anthony Bilinski
f6dddf7c58
refactor(History): Move history upgrades to new directory
Upcoming upgrade is fairly large, and all the helper functions for each
upgrade are becoming ambiguous.
2022-03-27 23:33:38 -07:00
Anthony Bilinski
bf3e1ffdb7
refactor(cmake): Allow tests to define their own needed libs 2022-03-27 23:32:11 -07:00
Anthony Bilinski
f0a23bbb5d
refactor(tests): Move database test utilities to their own lib
So that we can have multiple db upgrade tests that can run in parallel,
instead of one monster test that runs independent test cases sequentially.
2022-03-27 23:32:11 -07:00
Anthony Bilinski
d1a8f5d6ae
refactor(test): Use temporary files in dbschema_test
Files are conceptually temporary, having extra conflict handling logic
is unnecessary, and having the test fail to run if it crashed on last
invocation is annoying.
2022-03-27 22:59:27 -07:00
Anthony Bilinski
f777aa885c
fix(history): Heal invalid resume_file_id's saved to history
Replace underlength resume_file_id's with arbitrary data. Loaded file IDs are
not used for anything at this time, but they should not be null nor invalid.
Any 32-byte value is valid, so use all 0's for consistency.

Fix #6553
2022-03-25 16:47:52 -07:00
Anthony Bilinski
47ee51c61d
fix(history): Don't cast file_id to QString before inserting
The implicit cast in addNewFileMessage's argument causes a conversion from the
binary data of file_id to be interpreted as UTF8 characters. On null bytes or
invalid UTF8, the resulting QString can be empty or truncated. Empty IDs causes
null file_restart_id's to be inserted into the database.

Fixes the cause of #6553, but the database damage still needs to be healed.
2022-03-25 16:47:52 -07:00
Anthony Bilinski
c6ee8d0654
refactor(Nexus): Remove Nexus::getCore
It relies on singleton state, instead just pass core to classes that need it.
2022-03-25 15:14:06 -07:00
Anthony Bilinski
2d6cc25405
fix(History): Correct SQL query for empty finished file transfer
"finished" is not a field in file_transfers. Bug has been present since
initially introduced in d9b39b3102.

Had no real effect since file transfers are inserted with initial state
CANCELLED, which is usually the case for a 0-length finished file, but
it still logged an SQL error.
2022-03-24 15:51:10 -07:00
Anthony Bilinski
0d366a5790
chore(build): Enable all warnings on qTox libraries as well
warnings interface was only being linked to qtox_static, so were not being
applied to e.g. util. Link it to each library as well as qtox_static so that
they all inherit all the warnings.
2022-03-24 04:19:41 -07:00
Anthony Bilinski
9da8ec9926
chore(build): Comply with Wshadow in audio lib 2022-03-24 04:19:41 -07:00
Anthony Bilinski
270286b38c
refactor(audio): Move getVolume and volumeAvailable to qreal from float
Reduces casting back and forth between types.
2022-03-24 04:19:41 -07:00
Anthony Bilinski
8337b935f9
refactor(audio): Remove unused OpenAL::outputVolume 2022-03-24 04:19:41 -07:00
Anthony Bilinski
27f19ec2fa
fix(History): Deep copy QByteArrays from SQL selects
We already deep copy all other data types. Especially with Qt types like
QByteArray, having a deep copy to start is important since it shallow
copies on any subsequent copy, so the callback provider only gets a
shallow copy in the QByteArray of the temporary data from SQLite.
2022-03-24 03:09:12 -07:00
Anthony Bilinski
efc641efd7
feat(Settings): Add GUI notice for global settings upgrade failure
Due to new MessageBoxManager, Settings now has the ability to show errors
during init.
2022-03-24 02:14:21 -07:00
Anthony Bilinski
b24faabf42
refactor(GUI): Move remaining messsage box functionality to new class
* Pass MessageBoxManager instantiation around instead of relying on a singleton
* Mock MessageBoxManager for unit tests when needed, since they don't have a
  QApplication which is required for creating QWidgets
* Remove GUI class, which didn't have a clear purpose
2022-03-24 02:14:20 -07:00
Anthony Bilinski
3bd85452da
refactor(GUI): Remove GUI::getMainWidget
It was just dispatching to Nexus::getDesktopGUI - call it directly instead,
for now.
2022-03-24 02:14:20 -07:00
Anthony Bilinski
b57e6c6fc4
refactor(GUI): Remove GUI setWindowTitle
Widget is the only caller, let it set its own title. Wrap inherited setTitle to
prepend "qTox". Check for thread is not needed since it is only called
from Widget's slots.
2022-03-24 02:14:20 -07:00
Anthony Bilinski
94d0f29603
refactor(GUI): Remove GUI::themeReload, give responsibility to Style
Style already has themeChanged, which was unused. GUI's themeReload just
dispatches to Style, which is already piped to GUI classes. Give the signal
to Style itself so that classes can connect to that, rather than relying on
GUI's singleton.
2022-03-24 02:14:20 -07:00
Anthony Bilinski
3444fed0ac
refactor(GUI): Remove GUI setEnabled, call on Widget directly
Nexus is the only caller and has access to Widget. Because only Nexus
calls it, and Nexus runs on GUI thread, remove check and queued
connection.
2022-03-24 02:14:20 -07:00
Anthony Bilinski
e4552cf905
chore(CI): Add support for building toxcore and toxext for macOS
CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.
2022-03-21 20:02:15 -07:00
Anthony Bilinski
02f384a7d2
chore(CI): Add support for building qrencode for macOS
CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.
2022-03-21 19:16:49 -07:00
Anthony Bilinski
e6075c278d
chore(CI): Add support for building msgpack-c for macOS
CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.
2022-03-21 19:16:49 -07:00
Anthony Bilinski
f9b8a8a05f
chore(CI): Add support for building ffmpeg for macOS 2022-03-21 19:16:49 -07:00
Anthony Bilinski
a94304148e
chore(CI): Add support for building libexif for macOS 2022-03-21 19:16:41 -07:00
Anthony Bilinski
b4636c8174
chore(CI): Add support for building openal for macOS
CMAKE_OSX_DEPLOYMENT_TARGET has no effect when not building for macOS.

MACOSX_RPATH must be set explicitly for OpenAL to be found. It is default using newer cmake, but OpenAL is using cmake 2.6.
2022-03-21 19:16:41 -07:00
Anthony Bilinski
ad862ca50e
chore(CI): Add support for building openssl for macOS 2022-03-21 19:16:41 -07:00
Anthony Bilinski
c7ac0fdc3f
chore(CI): Add support for building opus for macOS 2022-03-21 19:16:41 -07:00
Anthony Bilinski
59fb97e2a3
chore(CI): Add support for building sodium for macOS 2022-03-21 19:16:41 -07:00
Anthony Bilinski
d3bebab0b7
chore(CI): Add support for building sqlcipher for macOS 2022-03-21 19:16:37 -07:00
Anthony Bilinski
35d35a33f2
chore(CI): Add support for building VPX for macOS
Manually set library id name because it defaults to "libvpx.7.dylib",
for some reason, which is not found by qTox or tests.
2022-03-21 17:45:08 -07:00
Anthony Bilinski
b067aae207
refactor: Move Style global shared state into class 2022-03-19 21:28:21 -07:00
Anthony Bilinski
d7b67081e5
refactor(history): Separate db upgrade logic from History
Allows for cleaner testability of upgrade logic and reduces the overall size
and clutter of History.
2022-03-19 21:27:40 -07:00
Anthony Bilinski
2a2b079992
feat(core): Add error parsing for Tox_Err_Options_New 2022-03-18 22:20:13 -07:00
Anthony Bilinski
a5660fb6e3
feat(core): Add error parsing for Toxav_Err_Bit_Rate_Set 2022-03-18 22:20:13 -07:00
Anthony Bilinski
47a05c7592
feat(core): Add error parsing for Toxav_Err_Call 2022-03-18 22:20:13 -07:00
Anthony Bilinski
47a20f6061
feat(core): Add error parsing for Toxav_Err_Call_Control 2022-03-18 22:20:12 -07:00
Anthony Bilinski
6c9c380915
feat(core): Add error parsing for Tox_Err_File_Send_Chunk 2022-03-18 22:20:12 -07:00
Anthony Bilinski
978bcde572
feat(core): Add error parsing for Tox_Err_File_Control 2022-03-18 22:20:12 -07:00
Anthony Bilinski
040beae56a
feat(core): Add error parsing for Tox_Err_File_Get 2022-03-18 22:20:12 -07:00
Anthony Bilinski
aff5663351
feat(core): Extend and deduplicate Tox_Err_File_Send error parsing 2022-03-18 22:20:12 -07:00