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

4125 Commits

Author SHA1 Message Date
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
Anthony Bilinski
35c5e77a8a
revert(chatlog): "fix: data validation during the search"
This reverts commit acb91ed731.
2020-04-12 22:40:09 -07:00
Anthony Bilinski
6395ce3aae
revert(chatlog): "feat: check chat status before start a search"
This reverts commit ce570927b1.
2020-04-12 22:40:09 -07:00
Anthony Bilinski
c1d0624b5d
revert(chatlog): "feat: save selected search text after scrolling up"
This reverts commit dbf880078e.
2020-04-12 22:40:09 -07:00
Anthony Bilinski
83d5863bbe
revert(chatlog): "optimize load messages during the search"
This reverts commit 6de307e6b9.
2020-04-12 22:40:09 -07:00
Anthony Bilinski
306bbb424e
revert(chatlog): "update workerStb"
This reverts commit 177bf12f11.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
4cd443ae7b
revert(chatlog): "scroll bar stuck to bottom (fix #5755)"
This reverts commit 38df897e02.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
efff8d53c9
revert(chatlog): "add comments for functions that load history"
This reverts commit 5fc1afbab5.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
5d44cd773f
revert(chatlog): partially revert "prevent invalid history access"
This partially reverts commit e3e6e1d9c4.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
b04639c6d0
revert(chatlog): "fix stick to bottom behavior"
This reverts commit f2fa601073.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
5da1e4b9a8
revert(chatlog): "enable dynamic view range in chatlog with history disabled"
This reverts commit a7f3495956.
2020-04-12 22:40:08 -07:00
Anthony Bilinski
6e2ac12d84
fix(avatar): reject avatars that are larger than 64KB
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.
2020-04-10 15:32:35 -07:00
bodwok
d01fed92f0
fix(ui): updating friends list color at runtime 2020-04-09 15:53:02 +03:00
bodwok
1aad91944e
fix(chatlog): fixed rendering of new messages when scrolling up 2020-04-07 19:58:00 +03:00
Jimi Huotari
6a59f0fe4d refactor(Qt): fix build with Qt 5.15 again
A deprecated function was previously replaced with an overload that
also got recently deprecated [1].

1. https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.15&id=46ebd11e
2020-04-03 00:39:46 +03:00
Anthony Bilinski
ef8c2b7cb3
Merge branch 'v1.17-dev' 2020-03-28 01:43:40 -07:00
Anthony Bilinski
4f7056385f
refactor: remove dependency on libfilteraudio
The audio filtering/echo compensation didn't ever work reliably, so just
remove it.
2020-03-23 18:24:23 -07:00
Anthony Bilinski
ad042b09e0
chore(cleanup): don't add semicolon to Q_DECLARE_METATYPE
It is uneeded and prevents enabling of warnings for uneeded semicolons after
classes or namespaces

Fix #6007
2020-03-23 18:21:14 -07:00
Anthony Bilinski
5ae738f818
chore(cleanup): replace remaining deprecated toxcore enums with newer versions
Fix #5997
2020-03-23 18:20:39 -07:00
Anthony Bilinski
f373107f63
chore(cleanup): add Wunknown-pragmas, fix pragma typos
Fix #6035
2020-03-23 18:04:35 -07:00
Anthony Bilinski
715794f664
chore(build): fix implicit narrowing warning by making it explicit
Exact accuracy isn't needed for the normalized value, being off by one part per
quadrillion is ok.

Fix #6000
2020-03-22 04:06:45 -07:00
Anthony Bilinski
2b981d88a2
fix(interface): use virtual destructors for all interfaces
Avoids memory leak if derived classes are deleted through interface pointer.

Fix #6006
2020-03-22 01:59:24 -07:00
Anthony Bilinski
f53e44b62c
chore(cleanup): don't std::move for return statement
std::moveing prevents RVO, and even in cases where RVO can't take place, move
will be used if possible.

Fix #6011
2020-03-22 01:39:10 -07:00
Anthony Bilinski
70824729ff
chore(cleanup): don't use 0 as nullptr
Don't add Wzero-as-null-pointer-constant by default, since on older Qt
versions that we stil support and that our CI runs agains, Qt API themselves
cause warnings which lead to build errors all over the place.

Fix #6008
2020-03-21 23:20:03 -07:00
Anthony Bilinski
f756dbae2a
chore(cleanup): don't explicitly initialize std::unique_ptr to nullptr
Fix #6009
2020-03-21 22:15:03 -07:00
Anthony Bilinski
2c1a86482a
chore(style): remove old style casts and cross sign comparisons
Enable warnings for both. Favour casting to signed rather than casting to
unsigend for comparisons. Per isocpp's core guidelines ES.102, signed
arithmetic gives more expected results. If we need one extra bit of range,
using longer signed types achives that.

Fix #6010
Fix #6012
2020-03-21 20:29:10 -07:00
Anthony Bilinski
a7f3495956
fix(chatlog): enable dynamic view range in chatlog with history disabled
Message caching is handled by SessionChatLog in memory even when history is
disabled. ChatLog doesn't need to worry about how the messages its rendering
are being stored. Dynamic loading up and down in chatlog is sitll functional.
2020-03-21 19:41:22 -07:00
Anthony Bilinski
c906cdf57b
fix(history): check history settings when getting initial chatlog idx
Checking if history pointer is valid is not sufficient, the setting must also
be checked. This caused asserts in history when history was disabled in
settings.
2020-03-21 01:45:46 -07:00
sudden6
b5785a1b0c
fix: add missing type for Qt slot
(cherry picked from commit ad139d67c2)
2020-03-20 02:26:22 -07:00
sudden6
df7fe22398
fix(toxcall): move ToxCall ownership to correct Thread
Makes the CoreAV thread own all ToxCalls in order to prevent signals
from being emitted via a Direct connection from Audio to CoreAV.

(cherry picked from commit 6b468e41fa)
2020-03-20 02:26:18 -07:00
Mick Sayson
caf4f59fb2
feat(groups): Allow being in group call if only member
In other applications chatrooms allow you to idle in a call and have
people hop in and out as desired. If a user is the only one presently
online in a group but knows someone will be joining shortly they should
be able to join the call ahead of time.

(cherry picked from commit 46d57c6864)
2020-03-20 02:26:08 -07:00
sudden6
f02943c191
fix(toxcall): handle Null sink correctly
This was introduced in 82a4f1b412

(cherry picked from commit bf3921ce94)
2020-03-20 02:07:57 -07:00
Anthony Bilinski
3a5e28fffb
fix(model): take QObject receiver argument to interface signal connection macro
receiver QObject is used by Qt to automatically deregister the connection when
the receiver is destroyed. Forward it on to Qt's connect.

(cherry picked from commit 24e4ec3751)
2020-03-20 02:07:20 -07:00
Anthony Bilinski
b7062b2518
fix(model): stop interfaces from inheriting from QObject
Qt doesn't support QObject multiple inheritance, so use our existing interface
macros to declare signals in the interface without QObject, and implement them
in child classes.

(cherry picked from commit 82a4f1b412)
2020-03-20 02:07:20 -07:00
Anthony Bilinski
40e43586f1
fix(model): return connection from interface macro
connection is normally returned from Qt's connect, and the caller may want to
track the connection to manually disconnect it.

(cherry picked from commit 41b2b35ce3)
2020-03-20 02:07:19 -07:00
sudden6
dfeca3e906
fix(coreav): prevent racy access to call variable
(cherry picked from commit c507d2665d)
2020-03-20 02:07:19 -07:00
sudden6
26fcea0639
fix(coreav): change some lock to write locks
I missed some cases where data was written.

(cherry picked from commit dfcfb7d5e0)
2020-03-20 02:07:19 -07:00
sudden6
e340688b94
fix(coreav): fix assert because c-toxcore calls from unexpected thread
c-toxcore calls the groupCallCallback from it's main thread instead of
the ToxAV thread as expected, this was triggering an assertion.

Aditionally the destructors of Core and CoreAV were fixed, because they
now either crashed or deadlocked qTox when it was closed while a group
call was still running.

(cherry picked from commit 141cbf8870)
2020-03-20 02:07:18 -07:00
sudden6
723a8e5dc7
fix(coreav): avoid deadlock between CoreAV, main and Audio thread
This actually fixes two problems:

1) CoreAV and Audio thread both locked the callsLock and audioLock in
different orders, resulting in a deadlock of both threads. This fixed by
using a ReadWriteLock in the CoreAV thread.

2) Multiple functions were emitting signals while holding a lock. This
is unsafe, because the connected slot may acquire any other lock. This
is fixed by releasing the locks before emitting signals.

(cherry picked from commit 4b9e4a571d)
2020-03-20 02:07:18 -07:00
sudden6
a4ac6d67c7
fix(coreav): cleanup assertions
It doesn't really make sense to assert that the callbacks are coming
from any other thread than CoreAV, when we actually want to ensure the
callback is coming from Core thread.

Remove over agressive assert from sendGroupCallAudio(...), this function
should be callable from any thread.

(cherry picked from commit 9499925fb2)
2020-03-20 02:07:18 -07:00
sudden6
89400c91f7
refactor: properly lock against Core thread
We we're calling toxav_* functions without synchronizing to any of the
Tox threads.

Additionally remove the call timeout, it creates timers from different
threads, which causes errors.

(cherry picked from commit 98cfe9838f)
2020-03-20 02:07:17 -07:00
sudden6
8e54805e7d
feat(coreav): add assertions to check for threading errors 2020-03-20 02:06:49 -07:00
sudden6
cf402bd11c
refactor(coreav): simplify start sequence
(cherry picked from commit c332cc0cca)
2020-03-20 02:05:47 -07:00
sudden6
f72b3397a5
refactor(coreav): move threading of CoreAV to single mutex
Use a standard mutex instead of trying to build proper locking
ourselfes.

(cherry picked from commit 2bc0057bbd)
2020-03-20 02:05:47 -07:00
Anthony Bilinski
e5a6708877
Merge branch 'v1.17-dev' 2020-03-19 13:21:14 -07:00
sudden6
4345fafbc6
Merge pull request #6005
Jimi Huotari (1):
      refactor(Qt): fix build with Qt 5.15
2020-03-19 01:22:31 +01:00
sudden6
ad139d67c2
fix: add missing type for Qt slot 2020-03-17 18:06:21 +01:00
Jimi Huotari
6d51971c6f refactor(Qt): fix build with Qt 5.15
This fixes compile-time warnings about deprecated functions when
building with Qt 5.15.
2020-03-17 13:31:36 +02:00
sudden6
6b468e41fa
fix(toxcall): move ToxCall ownership to correct Thread
Makes the CoreAV thread own all ToxCalls in order to prevent signals
from being emitted via a Direct connection from Audio to CoreAV.
2020-03-17 11:56:56 +01:00
sudden6
f2fa601073
fix(chatlog): fix stick to bottom behavior
This commit fixes the behavior when a message is received while the
chatlog is scrolled to the bottom. With this change, the chatlog will
stick to the bottom when it is scrolled all the way down. If it is
somewhere in the middle (e.g. for search) the chatlog will not change
its position.
2020-03-15 16:45:09 +01:00
Anthony Bilinski
0b5f751104
fix(core): message when peer changes group name
boolean inversion in getGroupPeerName caused it to always return empty string

Fix #6001
2020-03-15 01:29:11 -07:00
sudden6
bf3921ce94
fix(toxcall): handle Null sink correctly
This was introduced in 82a4f1b412
2020-03-03 19:49:13 +01:00
sudden6
7e4f7f0489
fix: remove unused variables 2020-03-03 00:38:53 -08:00
sudden6
1158faee07
chore: update copyright date in About 2020-03-03 00:38:45 -08:00
sudden6
e67cdadf3d
fix: remove unused variables 2020-03-01 16:59:14 +01:00
sudden6
1f4fee0e4c
chore: update copyright date in About 2020-03-01 00:42:52 +01:00
sudden6
08fda121f0
Merge pull request #5982
Mick Sayson (1):
      feat(groups): Allow being in group call if only member
2020-02-28 18:23:21 +01:00
Mick Sayson
46d57c6864 feat(groups): Allow being in group call if only member
In other applications chatrooms allow you to idle in a call and have
people hop in and out as desired. If a user is the only one presently
online in a group but knows someone will be joining shortly they should
be able to join the call ahead of time.
2020-02-23 11:48:35 -08:00
Anthony Bilinski
13cf04fad9
Merge branch 'v1.17-dev' 2020-02-22 14:18:26 -08:00
Anthony Bilinski
24e4ec3751
fix(model): take QObject receiver argument to interface signal connection macro
receiver QObject is used by Qt to automatically deregister the connection when
the receiver is destroyed. Forward it on to Qt's connect.
2020-02-06 16:48:56 -08:00
Anthony Bilinski
82a4f1b412
fix(model): stop interfaces from inheriting from QObject
Qt doesn't support QObject multiple inheritance, so use our existing interface
macros to declare signals in the interface without QObject, and implement them
in child classes.
2020-02-06 16:48:56 -08:00
Anthony Bilinski
41b2b35ce3
fix(model): return connection from interface macro
connection is normally returned from Qt's connect, and the caller may want to
track the connection to manually disconnect it.
2020-02-06 16:48:56 -08:00
sudden6
c507d2665d
fix(coreav): prevent racy access to call variable 2020-01-29 22:22:18 +01:00
sudden6
dfcfb7d5e0
fix(coreav): change some lock to write locks
I missed some cases where data was written.
2020-01-29 22:22:18 +01:00
sudden6
141cbf8870
fix(coreav): fix assert because c-toxcore calls from unexpected thread
c-toxcore calls the groupCallCallback from it's main thread instead of
the ToxAV thread as expected, this was triggering an assertion.

Aditionally the destructors of Core and CoreAV were fixed, because they
now either crashed or deadlocked qTox when it was closed while a group
call was still running.
2020-01-29 22:22:18 +01:00
sudden6
4b9e4a571d
fix(coreav): avoid deadlock between CoreAV, main and Audio thread
This actually fixes two problems:

1) CoreAV and Audio thread both locked the callsLock and audioLock in
different orders, resulting in a deadlock of both threads. This fixed by
using a ReadWriteLock in the CoreAV thread.

2) Multiple functions were emitting signals while holding a lock. This
is unsafe, because the connected slot may acquire any other lock. This
is fixed by releasing the locks before emitting signals.
2020-01-29 22:22:18 +01:00
sudden6
9499925fb2
fix(coreav): cleanup assertions
It doesn't really make sense to assert that the callbacks are coming
from any other thread than CoreAV, when we actually want to ensure the
callback is coming from Core thread.

Remove over agressive assert from sendGroupCallAudio(...), this function
should be callable from any thread.
2020-01-29 22:22:18 +01:00
sudden6
98cfe9838f
refactor: properly lock against Core thread
We we're calling toxav_* functions without synchronizing to any of the
Tox threads.

Additionally remove the call timeout, it creates timers from different
threads, which causes errors.
2020-01-29 22:22:18 +01:00
sudden6
29f659c659
feat(coreav): add assertions to check for threading errors 2020-01-29 22:22:18 +01:00
sudden6
c332cc0cca
refactor(coreav): simplify start sequence 2020-01-29 22:22:17 +01:00
sudden6
2bc0057bbd
refactor(coreav): move threading of CoreAV to single mutex
Use a standard mutex instead of trying to build proper locking
ourselfes.
2020-01-29 22:22:17 +01:00
Anthony Bilinski
5b31effdb4
fix(group): don't display netcam view for group voice calls
This is a minimal fix to reduce risk for the release. A more complete
re-architecture will be made.

The netcam covers much of the chat in groups, and has nothing to show since
group video calls aren't possible. Who is speaking in call is already shown by
the bold names at the top of the group, taking much less space.

Fix #5918
2020-01-27 15:05:54 -08:00
Anthony Bilinski
92e51b05ac
fix(db): fix schema log to display correct version 2020-01-27 01:21:29 -08:00
Anthony Bilinski
981ecfcaeb
refactor(chatform): combine toggleVideoPreview implementations 2020-01-26 04:29:56 -08:00
Anthony Bilinski
89913e0f9a
refactor(netcam): remove GenericNetCamView, merge into NetCamview
Without GroupNetCamView, the split in arbitrary.
2020-01-26 04:29:55 -08:00
Anthony Bilinski
41d8f66e08
refactor(chatform): change ChatForm's netcam to NetCamView
Unlike GenericChatForm, ChatForm knows that it always has a NetCam
2020-01-26 04:29:55 -08:00
Anthony Bilinski
600993b43a
refactor(chatform): move netcam ownership to ChatForm from GenericChatForm
Since now only ChatForm uses the NetCamView.
2020-01-26 04:29:55 -08:00
Anthony Bilinski
8d8e75b800
refactor(chatform): move onMessagesClicked, onSplitterMoved to ChatForm
These API are only relevant for NetCamView, which is only used by ChatForm.
2020-01-26 04:29:55 -08:00
Anthony Bilinski
4c816b1bff
refactor(chatform): move create/show/hide NetCamView API to ChatForm
Since NetCamView is now only used by ChatForm, GenericChatForm shouldn't have
any of its functionality.
2020-01-26 04:29:54 -08:00
Anthony Bilinski
91bcd211a7
refactor(netcam): remove GroupNetCamView class
Fix #5918
2020-01-26 04:05:39 -08:00
Anthony Bilinski
366478fca9
chore: remove "Hardware" from issue template
For the grand majority of bug reports, user hardware isn't relevant. Figuring
out what to write isn't always trivial.
2020-01-26 02:33:20 -08:00
Anthony Bilinski
49abc996ae
Merge branch 'v1.17-dev' 2020-01-19 16:16:57 -08:00
accelsao
bdb3b61ee0
fix(net): check if the node has all needed fields
Fixes ##5766
2020-01-19 16:06:19 -08:00
Anthony Bilinski
cf672375be
revert(toxme): remove toxme from qTox - the service is offline permanently
As of 2019-10-09, toxme.io was taken offline permanently. Remove UI and code
in qTox relating to it. Revert this commit if it comes back online in the
future.

Fix #5897
2020-01-16 13:28:41 -08:00
accelsao
ca4f14cc4c fix(net): check if the node has all needed fields
Fixes ##5766
2020-01-14 09:04:55 +08:00
sudden6
547a038e48
refactor: remove AppImage update bridge
When re-evaluating our dependencies we decided that the update bridge
has a high potential for security issues because it's not widely used.
Additionally similar functionality is already present in qTox.
2020-01-13 11:19:01 -08:00
sudden6
5b3c8aec11
refactor: remove AppImage update bridge
When re-evaluating our dependencies we decided that the update bridge
has a high potential for security issues because it's not widely used.
Additionally similar functionality is already present in qTox.
2020-01-12 20:44:21 +01:00
Anthony Bilinski
f252816f55
Merge branch 'v1.17-dev' 2019-12-02 08:46:04 -08:00
Mick Sayson
e3e6e1d9c4
fix(history): Prevent invalid history access
* When the DB schema was too new we were accessing history anyways. This
has potential to just completely corrupt the DB
* When history was disabled there was a chance we would attempt to write
to history anyways. Added more checks in this area
* Chatform was accessing invalid iterators when there were no displayed
messages. Added a guard for this case
2019-12-02 03:04:53 -08:00
Katherine Mantel
8c5cab935c
fix(ui): fix auto-accept directory setup display
Fixes #5917
2019-12-02 00:54:19 -08:00
Anthony Bilinski
88d10b1249
refactor(widget): remove uneeded check of if message is targetted
It's only relevant for group messages, where the check already exists.
2019-11-27 08:26:59 -08:00
Anthony Bilinski
9b23abc6de
fix(core): avoid using stack allocated memory past end of scope
tox_file_send was using a pointer to memory that was out of scope. Extend
lifetime of avatarHash to avoid this.
2019-11-27 07:28:47 -08:00
Anthony Bilinski
1f80173b2d
fix(offlinemsg): don't invalidate iterator before use
QMap::erase invalidates the iterator, meaning our usage of it on the
next line was unsafe.
2019-11-27 07:28:47 -08:00
Anthony Bilinski
479b39f536
fix(offlingmsg): only dipatch offline messages on friend online change
Before if the new status was online, we would dipsatch, which could cause
double sends in the case of a friend going from e.g. busy -> away
2019-11-25 20:52:06 -08:00
Anthony Bilinski
239dfdc65c
refactor(status): move isOnline into Status from Friend
Allows checking if a status if equivalent to Online without needing a Friend
class.
2019-11-25 20:52:06 -08:00
Anthony Bilinski
e9570eafdf
Merge branch 'v1.17-dev' 2019-11-25 16:56:50 -08:00
Anthony Bilinski
edd72906fb
perf(history): enable sql index on chat_id in history table
This makes every query with a "WHERE history.chat_id" clause quicker,
improving history load time by 50% on my profile.

Related to #5812
2019-11-25 16:21:17 -08:00
Anthony Bilinski
af19c0d73b
Merge pull request #5875
Mick Sayson (1):
      fix(chatform): Prevent date line oscillations maxing CPU
2019-11-23 17:27:36 -08:00
Anthony Bilinski
0055c7760c
fix(ui): fix reversed mute/unmute hover text 2019-11-18 13:56:56 -08:00
Igor Kushnir
f9f634b326 fix(ui): quit qTox on Ctrl+Q when "Close to tray" is enabled
Fixes #5925.
2019-11-17 15:26:49 +02:00
Mick Sayson
3205c2c407
fix(groups): Correct color of labels in group call
Group calls are supposed to show the name of each member under their
avatars. The color of the text was previously fixed to white regardless
of the background ignoring the color of the background.

This fix ensures that the background color is not the same color as the
label text
2019-11-16 14:33:28 -08:00
Mick Sayson
ce9e820b37
fix(groups): Avoid segfault when resizing group audio window
Avatars for group members currently in a call are resized depending on
the area they are displayed in. Previously a scrollbar would appear and
disapear based on the size of the contents. This resulted in
oscillations that ended in a SIGSEGV.

This fix avoids the oscillations by fixing the scrollbar to always be
shown
2019-11-16 14:33:27 -08:00
sudden6
22787a7f3c
Merge pull request #5920
Mick Sayson (2):
      fix(groups): Avoid segfault when resizing group audio window
      fix(groups): Correct color of labels in group call
2019-11-15 21:51:54 +01:00
Mick Sayson
f27eb5b76c
fix(groups): Correct color of labels in group call
Group calls are supposed to show the name of each member under their
avatars. The color of the text was previously fixed to white regardless
of the background ignoring the color of the background.

This fix ensures that the background color is not the same color as the
label text
2019-11-12 02:44:42 -08:00
Mick Sayson
d4d4308e28
fix(groups): Avoid segfault when resizing group audio window
Avatars for group members currently in a call are resized depending on
the area they are displayed in. Previously a scrollbar would appear and
disapear based on the size of the contents. This resulted in
oscillations that ended in a SIGSEGV.

This fix avoids the oscillations by fixing the scrollbar to always be
shown
2019-11-12 02:44:42 -08:00
Anthony Bilinski
6179250458
Merge branch 'v1.17-dev' 2019-11-11 17:38:02 -08:00
Mick Sayson
836718aa26
fix(groups): Fix invalid group list on group member join
The call to Core::getGroupPeerNames is expected to return a list where
the index in the list is the group member id. In any error case we were
previously breaking this constraint. It turns out that every time
someone joins a group we call this function before they have a valid
name resulting in their id not being added to the list.

This fix ensures that the list coming out of Core::getGroupPeerNames
always has a full list.

Fixes #5838
2019-11-11 17:36:53 -08:00
Mick Sayson
87eed97ab3
fix(calls): Fix SIGSEGV on quit while in call
On application close we used to access invalid memory associated with
the audio subsystem. This was because on destruction of static variables
we tried to access state associated with an already destructed item.

These variables seem to have no good reason to be static. They should be
tied to a single CoreAV instance and are only accessed through an
existing CoreAV instance.
2019-11-11 17:19:21 -08:00
Mick Sayson
64bae38b99 fix(chatform): Prevent date line oscillations maxing CPU
The previous implementation of hiding the date line would cause 100% cpu
usage. When the date line was shown it would hide the top line, causing
the date line to be hidden again due to a state change in which dates
was visible.

This is a minimal patch to work around the issue by pretending the line
covered by the date line is the first visible line when the dateline is
shown

Fixes #5620
2019-11-09 15:00:36 -08:00
Mick Sayson
fd243738c1 fix(groups): Fix invalid group list on group member join
The call to Core::getGroupPeerNames is expected to return a list where
the index in the list is the group member id. In any error case we were
previously breaking this constraint. It turns out that every time
someone joins a group we call this function before they have a valid
name resulting in their id not being added to the list.

This fix ensures that the list coming out of Core::getGroupPeerNames
always has a full list.

Fixes #5838
2019-11-09 14:21:12 -08:00
Anthony Bilinski
17bbe24ec5
chore: log schema version when we error due to future db 2019-11-04 14:42:20 -08:00
Anthony Bilinski
f7d82a425d
Merge branch 'v1.17-dev' 2019-10-21 23:49:36 -07:00
Anthony Bilinski
746314baf2
fix(history): move stuck action messages to broken_messages table
Before a bug in qTox would make it possible for a user to try to send an empty
action type message. This would fail to send at toxcore, but still be persisted
in history, causing it to fail every time FauxOfflineEngine tried to resend
it. Moving these stuck messages into the broke_messages table will stop qTox
from attempting to deliver them on each connect, and display in the GUI to
users that the messages aren't really pending anymore.
2019-10-20 02:35:20 -07:00
Anthony Bilinski
89e94b6f89
fix(chatform): don't try to send empty action messages
Otherwise sending just "/me " calls down to core with 0-length action, which
causes a toxcore send error.

There may be messages that are stuck in history as pending with "/me " content,
causing them to fail to send on every start. Those should be moved to the new
broken_messages table, similar to stuck pending messages from #5776. There's no
reason this fix to stop adding more broken messages needs to wait on the
history fix, though.
2019-10-20 02:35:20 -07:00
Anthony Bilinski
1a726b54cd
fix(history): display broken messages UI with error icon
Allows users to still see their broken messages in the chatlog, but in a way
that's clear that they haven't been delivered and won't be sent.
2019-10-20 02:34:48 -07:00
Anthony Bilinski
527c7d2d3c
refactor(history): represent message state as enum class
ensures that only one state is set at a time, avoids managing multiple bools
2019-10-20 02:34:48 -07:00
Anthony Bilinski
f6a15366ef
fix(history): select broken messages from History, track in ChatLogMessage 2019-10-20 02:34:48 -07:00
Anthony Bilinski
cd75618e38
refactor(history): rename pending message variables
"Sent" to "Delivered", since that's what we're tracking also rename "isOffline"
to "isPending", which is boolean the same, but "isOffline" was opposite of its
correct value before, so boolean reverse the assignment.
2019-10-20 02:34:47 -07:00
Anthony Bilinski
b28dc30061
fix(history): move stuck pending message into broken_messages table
Fix #5776

Due to a long standing bug, faux offline message have been able to become stuck
going back years. Because of recent fixes to history loading, faux offline
messages will correctly all be sent on connection, but this causes an issue of
long stuck messages suddenly being delivered to a friend, out of context,
creating a confusing interaction. To work around this, this upgrade moves any
faux offline messages in a chat that are older than the last successfully
delivered message, indicating they were stuck, to a new table,
`broken_messages`, preventing them from ever being sent in the future.
2019-10-20 02:34:47 -07:00
Anthony Bilinski
f72f3f714d
fix(history): handle errors during db upgrade 2019-10-20 02:34:47 -07:00
Anthony Bilinski
dacfcdadac
refactor(history): apply db schema upgrade one version at a time
This allows upgrade steps to query the db at the last version and run C++ code
on the results, then do a single transaction to make the upgrade, instead of
all actions of each upgrade step being required to be part of the overall
upgrade transaction.
2019-10-20 02:34:47 -07:00
Mick Sayson
dbef0b7508
fix(offlinemsg): fix offline message dispatching on history load
* Fix callback hookup order in ChatHistory
* Add correct call to SessionChatLog to insert an unfinished message
* Fix incorrect logic in parsing History database response
2019-10-20 02:34:47 -07:00
Anthony Bilinski
86b55a0fb0
fix(db): show full sqlite error message 2019-10-20 02:34:46 -07:00
Anthony Bilinski
d98fe85a58
fix(db): prepare and execute queued statements one at a time
* Allows for queued preparations to depend on the execution of previous statements
2019-10-20 02:34:46 -07:00
Anthony Bilinski
1ad561ca4c
refactor(style): use only one of override, virtual, or final
following https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-override

virtual means exactly and only "this is a new virtual function."
override means exactly and only "this is a non-final overrider."
final means exactly and only "this is a final overrider."

Nothing was changed from e.g. override to final, just reduced duplication of
these labels.
2019-10-19 12:26:50 -07:00
jenli669
b4bc09345c
fix(loginScreen): make loginScreen return values comply with Qt standards
This commit makes LoginScreen return QDialog::Rejected (0) and
QDialog::Accepted (1) instead of C standard return values. This should be more
robust with regards to special cases in Qt implementation.

Fixes #5781
2019-10-18 16:24:53 -07:00
Anthony Bilinski
524a6b8722
Merge branch 'v1.17-dev' 2019-10-18 11:18:39 -07:00
Anthony Bilinski
e85d3f522a
fix(icon): use Qt tray icon in all cases, remove platform specific backends
qTox added specialized tray icon backends over time to work around bugs with
the default implementation, since then our GTK+2 backend has stopped working,
our appindicator backend was never selected by default by cmake, and
statusnotifier was never selected at SystemTrayIcon construction, leaving us
only ever using the broken GTK+2 backend, or theoretically the Unity backend,
which I didn't see selected on Ubuntu 16.04 Unity. In all other cases we would
fall back to the Qt backend.

Qt icon has improved over time, and our platform specific icons have become
stale, with GTK+2 becoming deprecated and GTK+3 not having a similar feature,
QSystemTrayIcon has been tested on a variety of DEs and works as well or better
in all cases, as shown in the table at
https://github.com/qTox/qTox/issues/5881#issuecomment-541892457

Fix #5881
Fix #5859
2019-10-16 13:27:29 -07:00
Anthony Bilinski
73fedbba79
Merge branch 'v1.17-dev' 2019-10-10 03:11:19 -07:00
Jimi Huotari
c20e1c20e3
refactor(Qt): use 'storeRelaxed()' and 'loadRelaxed()'
This fixes build with Qt 5.14 by replacing the deprecated
QAtomic::load() and store() functions with the new ones.

- https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=79bdc7cf
2019-10-09 23:19:27 -07:00
Jimi Huotari
f9488bf966
refactor(Qt): use 'asprintf' instead of 'sprintf'
Deprecated since Qt 5.14.

- https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=f8f592d5
2019-10-09 23:19:26 -07:00
Jimi Huotari
7f74d41586
refactor(Qt): use 'QLatin1String' instead of 'QLatin1Literal'
This is an undocumented Qt 2/3/4 remnant, deprecated in Qt 5.14.

- https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=3e75c296
- https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=45373c19
2019-10-09 23:19:26 -07:00
Anthony Bilinski
731a49854a
fix(core): avoid logging which bootstrap node is being connected to
Errors are parsed and printed, but which specific node is being connected to
isn't very relevant to any errors that would occur, and the nodes list is
already updated to prune offline nodes based on nodes.tox.chat periodically.
This provides some extra privacy about which connections are being made,
even though the bootstrap nodes are already public.
2019-10-09 23:18:34 -07:00
Anthony Bilinski
64ebe01f9b
refactor(core): change hideous error parsing macro to overload
Reduce type duplication by caller, and stop calling functions based on string
concatenation
2019-10-03 19:44:35 -07:00
Anthony Bilinski
11ef88a8ac
refactor(core): use automatic memory for toxcore string buffers
Avoid reinterpret_casts in Core, offload reinterpretation to model classes
2019-10-02 02:15:21 -07:00
Anthony Bilinski
f77396a09e
refactor(core): parse and log all toxcore errors
Use a macro to embed line number of call sight, instead of just using line
number of log site, since logger functions can be called from different
toxcore API usages.
2019-10-02 02:15:21 -07:00
Anthony Bilinski
2e173ec6ad
refactor(core): move stateless parsing functions to anonymous namespace 2019-10-02 02:15:21 -07:00
sudden6
ffcf501ba4
Merge pull request #5850
Jimi Huotari (2):
      refactor(Qt): use 'QLatin1String' instead of 'QLatin1Literal' part 2
      refactor(Qt): use 'storeRelaxed()' and 'loadRelaxed()'
2019-09-29 14:00:45 +02:00
Anthony Bilinski
b95bac238d
fix(chatlog): update precise selection when chatlog content changes
Fix #5769. Precise selections (within one chatline) need to be invalidated when
the line they are apart of is removed from the chatlog.
2019-09-28 18:00:20 -07:00
Anthony Bilinski
08b2c848e2
refactor(chatlog): use enum class instead of enum to avoid implicit casts 2019-09-28 17:07:06 -07:00
sudden6
0e3cd7fe6b
Merge pull request #5829
jessica181920 (1):
      fix(i18n): Various English fixes
2019-09-28 14:25:18 +02:00
Jimi Huotari
82b61d416f refactor(Qt): use 'storeRelaxed()' and 'loadRelaxed()'
This fixes build with Qt 5.14 by replacing the deprecated
QAtomic::load() and store() functions with the new ones.

- https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.14&id=79bdc7cf
2019-09-25 13:48:08 +03:00
Mick Sayson
4b691f9392 fix(chatlog): Remove invalid usages of raw chatlog indexes
ChatLogIdx is a strong type where the underlying data is only supposed
to be used in very rare circumstances. The ChatLog providing the indexes
provides no guarantees about what the first ChatLogIdx or last
ChatLogIdx will be. This commit removes unnecessary casts to underlying
data and fixes assumptions made about the underlying data
2019-09-21 14:26:14 -07:00
Anthony Bilinski
af02542e05
fix(db): prepare and execute queued statements one at a time
* Allows for queued preparations to depend on the execution of previous statements
2019-09-17 00:49:27 -07:00
Anthony Bilinski
e4f73011f9
fix(core): don't log critical on every group join
It's expected behaviour that the peer is unknown when first joining a group.

Fix #5118
2019-09-17 00:45:17 -07:00
Anthony Bilinski
7cd20f0e28
Merge branch 'v1.17-dev' 2019-09-16 13:22:15 -07:00
Anthony Bilinski
9e70dbff4b
Merge pull request #5837
jessica181920 (1):
      fix: Remove unnecessary null pointer check
2019-09-16 13:09:38 -07:00
jessica181920
20f948bc08 fix: Remove unnecessary null pointer check
Fixes #5785
2019-09-16 14:22:40 -04:00
Anthony Bilinski
3d7a872f1a
fix(core): save tox profile when updating group or friend states
Makes sure persistent groups are stored in the case of a qTox crash.
2019-09-15 19:04:02 -07:00
Anthony Bilinski
f7a2a7d648
fix(widget): only change group title once
Before we were connecting the same signal to the same slot for each group we created.
2019-09-15 19:04:02 -07:00
Anthony Bilinski
602671c9dc
fix(core): don't set core status on connect, just update UI 2019-09-15 19:04:02 -07:00
TriKriSta
bbbbc6aade
fix: hide current date at the top of the chat 2019-09-15 17:31:45 -07:00
jessica181920
11b34c84ef fix(i18n): Various English fixes
Consistency, typos, grammatical corrections, capitalization, punctuation,
etc.
2019-09-14 15:00:59 -04:00
jessica181920
e6381861c8 fix: Remove empty file
Removed an unused file
2019-09-14 02:24:59 -04:00
Mick Sayson
74d0b47ceb fix(chatlog): Prepare geometry changes on chatline proxy
Closes #5818. If output of boundingRect() changes for a QGraphicsItem
prepareGeomeotryChange() must be called.
2019-09-13 14:41:10 -07:00
bodwok
c37a05f40c
fix(login): fix a crash when many dialogs are open 2019-09-10 23:57:55 +02:00
Anthony Bilinski
8a210d524b
Merge branch 'v1.17-dev' 2019-09-02 21:22:04 -07:00
jenli669
bd034e130d
docs(usermanual): Add information about commandline options 2019-09-02 21:05:04 -07:00
jenli669
31fec7488f
feat(proxy): provide commandline tools for proxy settings 2019-09-02 21:05:01 -07:00
sudden6
2dea6d2c1f
Merge pull request #5789
jenli669 (2):
      feat(proxy): provide commandline tools for proxy settings
      docs(usermanual): Add information about commandline options
2019-09-02 18:29:06 +02:00
jenli669
79128b445d
docs(usermanual): Add information about commandline options 2019-09-02 17:28:02 +02:00
sudden6
2ea5030958
fix(widget): don't try to play audio if it's disable 2019-08-30 14:07:19 +02:00
Anthony Bilinski
2bba12175e
fix(chatlog): update multi line selection on chatlog change
Fixes crash due to out of bound access. Fixes selection box jumping on history load.

Fix #5769
2019-08-30 03:50:25 -07:00
Anthony Bilinski
badef48c3a
Merge pull request #5777
TriKriSta (2):
      fix: scroll bar stuck to bottom (fix #5755)
      docs: add comments for functions that load history
2019-08-29 15:09:06 -07:00
Anthony Bilinski
9dd083978e
fix(ipc): handle ipc failure gracefully
Allows running qTox inside jails that block IPC.

Fix #5740
2019-08-29 13:55:54 -07:00
TriKriSta
5fc1afbab5 docs: add comments for functions that load history 2019-08-29 21:34:03 +03:00
Anthony Bilinski
64aa3eae4d
fix(history): select only pending history for the requested friend 2019-08-29 10:39:06 -07:00
jenli669
3e1e1f6087
feat(proxy): provide commandline tools for proxy settings 2019-08-29 13:43:27 +02:00
Anthony Bilinski
fd0a98fd90
Merge branch 'v1.17-dev' 2019-08-29 00:47:32 -07:00
TriKriSta
38df897e02
fix: scroll bar stuck to bottom (fix #5755) 2019-08-28 18:07:55 -07:00
sudden6
909deb0feb
fix: remove reconnect button
The button didn't work that well and caused all kinds of issues inside
the code, so I replaced it by a notice that changes to the Advanced
settings only apply after a restart of qTox.

In the process I also removed all code that was exclusively used for
that feature.

We may add it back later when qTox's internal architecture makes it less
cumbersome.
2019-08-28 16:36:09 -07:00
Anthony Bilinski
9819aefc44
fix(chatform): fix stuck spinner on messages not at end of chatform
Fix #5763

remove restriction to not update messages not in last slot in chatform,
allowing completed messages to be timestamped at any position. Fixes
stuck spinner in cases where a second message was sent quickly, or an
incoming message was received before the last send message was completed.
2019-08-28 14:46:44 -07:00
TriKriSta
177bf12f11
fix: update workerStb 2019-08-28 14:26:20 -07:00
TriKriSta
6de307e6b9
refactor: optimize load messages during the search 2019-08-28 14:26:14 -07:00
TriKriSta
dbf880078e
feat: save selected search text after scrolling up 2019-08-28 14:26:08 -07:00
TriKriSta
ce570927b1
feat: check chat status before start a search 2019-08-28 14:26:03 -07:00
TriKriSta
acb91ed731
fix: data validation during the search (fix: #5791, #5723) 2019-08-28 14:25:57 -07:00
sudden6
0a30c1b1c0
fix(profile): load settings before starting Core
This is a quick fix to load settings before Core is started. Ideally
this would not need to be inside the Profile, but at the moment the
decryption key is not available before starting Core.
2019-08-28 14:25:06 -07:00