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

4002 Commits

Author SHA1 Message Date
Anthony Bilinski
535b01a841
fix(preview): handle libexif missing fields, don't accept 0-value orientation
Last fix was a hack when the error was actually us using the default 0 value of
orientation since the returned ExifData was null.
2020-07-01 12:52:47 -07:00
Anthony Bilinski
5dcea74db5
fix(core): read proxy type after personal settings are loaded
Profile is required to load personal settings, and Profile was creating the
bootstraplist using personal settings. Instead create the bootstraplist in
initCore, after personal settings have been loaded. This avoids using an
uninitialized proxy type on every profile load.
2020-07-01 12:49:24 -07:00
sudden6
811a754edd
refactor: remove getInstance from toxuri.cpp 2020-06-30 22:09:26 +02:00
sudden6
8768f6be37
refactor: remove unused OSX platform code 2020-06-22 01:12:35 +02:00
Maxim Biro
f5f42233ca
fix: Usage of random
- Seed random in Core Thread. Core Thread didn't seed random, resulting
  in always using the same bootstrap nodes, even when you restart qTox
  or change profiles.

- Use QDateTime::currentMSecsSinceEpoch() for seeding random. It
  provides a bigger range of numbers than QTime::currentTime().msec()
  does, and the latter somehow managed to result in approximately the
  same first random number being generated, within a certain range.

- Use something a it more sensible than a mod operation to bound random
  numbers within a range. It's not perfect either, but a lot better.
  Using mod on random skews its distribution too much.

- Use QRandomGenerator's bounded() function to generate random values
  within a range.

- Enable QRandomGenerator's usage starting with Qt 5.10.0.
  QRandomGenerator is present since Qt 5.10.0, not 5.15.0.

- Bootstrap off every 5th node instead of two consecutive nodes. It's
  likely that two consecutive nodes will have the same owner, which
  makes some attacks more likely. The node selection algorithm should be
  scraped and redone from scratch to be honest though.
2020-06-04 15:58:17 -04:00
Anthony Bilinski
9da1e3bbdf
fix(preview): Don't log a warning on missing exif orientation metadata
libexif returns 0 for the orientation when orientation metadata isn't present.
Treat this the same as 1, i.e. no orientation change.
2020-05-27 22:17:29 -07:00
sudden6
0f4dc940ce
refactor: remove Core dependency from Group
Replace the direct call with a signal connection in Widget, this keeps
Group clean.
2020-05-27 10:39:02 +02:00
sudden6
445340a0e9
refactor: remove getInstance from ContentDialog
This UI element probably should never depend on Core, but this is to fix
for a later time.
2020-05-27 10:39:02 +02:00
sudden6
19f4a6c4e0
refactor: remove getInstance from AddFriendForm 2020-05-27 10:38:57 +02:00
bodwok
1bc97ef219
fix(chathistory): file transfers sometimes show wrong author name 2020-05-24 20:23:28 +03:00
sudden6
8e7ae808a3
Merge pull request #6079
bodwok (3):
      fix(ui): updating friends list color at runtime
      fix(ui): using a separate css file
      style: placing files in alphabetical order
2020-05-23 10:59:30 +02:00
Mick Sayson
99c1753a76 fix(preview): Fix exif orientations
Previous exif transformations were not valid. The exif spec defines the
orientations as where the 0th row and the 0th column should end. The
previous mappings used in qTox did not respect these mappings and needed
to be updated.
2020-05-16 16:53:14 -07:00
sudden6
a90f0762d9
refactor(cmake): change folder structure
The new folder structure will be like this:

/<module>/CMakeLists.txt
/<module>/src/file.cpp
/<module>/include/<module>/file.h
/<module>/<subdir>/<...>
2020-05-11 16:45:52 +02:00
sudden6
f3a10815ed
refactor: remove Core::getInstance from AvatarBroadcaster
During this process, make AvatarBroadcaster a non-static class.
2020-05-11 10:28:26 +02:00
sudden6
82e0852f3c
refactor: remove Core::getInstance from grouplist 2020-05-11 10:28:26 +02:00
Anthony Bilinski
365a452fb8
feat(core): use user editable bootstrap node list
Fix #5767
2020-05-10 21:40:04 -07:00
Anthony Bilinski
e5f33608c4
refactor(core): pass Paths into BootstrapNodeUpdater
In preparation of loading local bootstrap list files.
2020-05-10 21:40:04 -07:00
Anthony Bilinski
5a877d742b
refactor(core): pass bootstrap list interface to Core 2020-05-10 21:39:58 -07:00
Anthony Bilinski
5d56a3c039
refactor(paths): move Settings path functions into Paths 2020-05-10 18:03:47 -07:00
Anthony Bilinski
062ba03fb8
refactor(db): map foreign key dependency in db schema
Reorder deletion of history to avoid violating constraint.
2020-05-03 18:06:10 -07:00
Anthony Bilinski
f37f9a9492
refactor(history): enforce using PK instead of ToxId in history
We need to be lenient when reading from db because of ToxIds being saved in the
db from a bug introduced in e07d8d358f, which
used self ID rather than self Pk. Was subsequently fixed in
033f28e67e.
2020-05-03 16:22:12 -07:00
Anthony Bilinski
8abd4e47e9
refactor(style): use #pragma once rather than include guards 2020-05-03 15:51:52 -07:00
sudden6
9306e946f8
refactor: remove Core::getInstance() from ChatForm classes 2020-05-02 23:36:38 +02:00
sudden6
ea46c0caf2
refactor: remove Core::getInstance from AvForm 2020-05-02 20:08:11 +02:00
sudden6
ef18afcbf1
refactor: remove Core::getInstance from PrivacyForm 2020-05-02 20:08:11 +02:00
sudden6
2809cd91f5
refactor: remove Core::getInstance from SettingsWidget 2020-05-02 20:08:11 +02:00
sudden6
c1ec6bc649
refactor(widget): remove usage of Core::getInstance 2020-05-02 20:08:06 +02:00
Anthony Bilinski
6105af8279
fix(ipc): allow IPC under windows by not using std::random_device with mingw
https://en.cppreference.com/w/cpp/numeric/random/random_device
"A notable implementation where std::random_device is deterministic is old
versions of MinGW (bug 338, fixed since GCC 9.2)."

Although time is less random off Windows, we don't need a strongly random
number for this, and using time avoids having to use platform specific code.

Fix #2917
2020-04-30 19:26:18 -07:00
Anthony Bilinski
82547263f8
fix(ui): don't notify of available update if local version is newer
This could happen between the time when the release tag is pushed and the time
when the release binaries are published.

Fix #6112
2020-04-28 03:58:18 -07:00
iphydf
25a7817229
chore(videosurface): Use UNIX line endings. 2020-04-27 23:11:59 +00:00
Anthony Bilinski
00d08d9887
Merge branch 'v1.17-dev' 2020-04-24 18:37:27 -07:00
Anthony Bilinski
c748b5a8d0
Merge branch 'v1.17-dev' 2020-04-24 18:35:00 -07:00
iphydf
58b4c19709
chore: remove extra ;
These are misleading in some cases, or at least not useful in others.
Most cases of Q_UNUSED in qtox don't have a ;, so this seems acceptable.
2020-04-22 23:55:51 +00:00
Anthony Bilinski
2c59c92030
fix(db): Support opening and upgrading to any of three SQLCipher params
Fix #5952
2020-04-18 14:39:41 -07:00
bodwok
03124454cd fix(ui): using a separate css file 2020-04-18 20:51:51 +03:00
iphydf
e71225268f
chore: Various code cleanups.
* 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.
2020-04-16 19:07:40 +00:00
Anthony Bilinski
deb7fbb67c
fix(db): Add half-upgraded cipher params
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.
2020-04-14 23:38:44 -07:00
Anthony Bilinski
2fe1918083
feat(ipc): make IPC user specific
This allows multiple users on a system each running qTox to use IPC at once.

Fix #6076
2020-04-14 20:32:12 -07:00
Anthony Bilinski
d028f9e394
chore(cleanup): replace remaining deprecated toxcore enums
Some were missed in 5ae738f818.

Fix #5997
2020-04-13 09:25:20 -07:00
TriKriSta
c13ede85df
fix(ui): add vertical spacer to profileform 2020-04-13 00:56:39 -07:00
Anthony Bilinski
7b7950e7f7
revert(chatlog): "load messages from the database after date"
This reverts commit b705ac8060.
2020-04-12 22:40:11 -07:00
Anthony Bilinski
c75d8c8d3e
revert(chatlog): "edit function "Load chat history""
This reverts commit 6de1173c17.
2020-04-12 22:40:11 -07:00
Anthony Bilinski
8e03aa4b17
revert(chatlog): "edit load history in search"
This reverts commit 8c4b1e00a1.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
5efb0ba020
revert(chatlog): "add action "Go to current date""
This reverts commit 2a9648d12c.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
8c3f3199ef
revert(chatlog): "edit position chat after load history"
This reverts commit c2d5b422b3.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
ccc7107f92
revert(chatlog): "remove part messages from chat"
This reverts commit 4c7ecb6024.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
3f36b31f8b
revert(chatlog): "simple edit code"
This reverts commit b807998fe9.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
8f167f45a3
revert(chatlog): "edit load history when scrolling"
This reverts commit 0a9e72020e.
2020-04-12 22:40:10 -07:00
Anthony Bilinski
bd0ef5de82
revert(chatlog): "prohibition to remove messages in group chat"
This reverts commit 5aeac56b76.
2020-04-12 22:40:09 -07:00
Anthony Bilinski
3ac6b578df
revert(chatlog): "fix a crash when there are no messages to load"
This reverts commit 040c6b95ae.
2020-04-12 22:40:09 -07:00