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

146 Commits

Author SHA1 Message Date
sudden6
b0295b7c0a
refactor(chatlog): remove getInstance from ChatlogItem 2020-08-24 23:24:24 +02:00
sudden6
5fdadadfb5
refactor: remove getInstance() from friendchatroom.cpp 2020-08-16 12:47:33 +02:00
sudden6
c5e21be0f8
refactor: remove getInstance() from groupchatroom.cpp 2020-08-16 12:47:33 +02:00
Anthony Bilinski
431fd7bfa2
Merge pull request #6073
Anthony Bilinski (1):
      fix(notification): hide snore warning log spam

Mick Sayson (2):
      feat(notification): Notification string generator for multiple messages
      feat(notification): Notifications now always replace the previous one
2020-07-02 01:34:34 -07:00
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
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
bodwok
1bc97ef219
fix(chathistory): file transfers sometimes show wrong author name 2020-05-24 20:23:28 +03:00
Mick Sayson
6e163ca5ed
feat(notification): Notifications now always replace the previous one
This is a feature/fix to improve notification behavior when we receive
over 3 messages.

SnoreNotify prevents over 3 notifications from being displayed before a
user clears the notification. This is presumably to avoid infinite
notification spam.

Unfortunately this results in the notifications just coming in _after_
the user clears them. This means if there are 100s of messages built up
the user has to clear their notifications N messages / 3 times.

This feature/fix folds all notifications into a single notification
representing the current qTox notification state. See
notificationgenerator_test.cpp for what the new messages look like.
2020-05-17 00:00:53 -07:00
Mick Sayson
a9f6543e43
feat(notification): Notification string generator for multiple messages 2020-05-17 00:00:48 -07: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
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
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
Anthony Bilinski
c748b5a8d0
Merge branch 'v1.17-dev' 2020-04-24 18:35:00 -07: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
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
Anthony Bilinski
ef8c2b7cb3
Merge branch 'v1.17-dev' 2020-03-28 01:43:40 -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
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
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
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
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
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
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
Anthony Bilinski
f252816f55
Merge branch 'v1.17-dev' 2019-12-02 08:46:04 -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
f7d82a425d
Merge branch 'v1.17-dev' 2019-10-21 23:49:36 -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
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
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
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
TriKriSta
dbf880078e
feat: save selected search text after scrolling up 2019-08-28 14:26:08 -07:00
TriKriSta
acb91ed731
fix: data validation during the search (fix: #5791, #5723) 2019-08-28 14:25:57 -07:00
sudden6
834baff556
Merge pull request #5793
TriKriSta (5):
      fix: data validation during the search (fix: #5791, #5723)
      feat: check chat status before start a search
      feat: save selected search text after scrolling up
      refactor: optimize load messages during the search
      fix: update workerStb
2019-08-28 21:13:38 +02:00
sudden6
db802822f3
fix: empty username causes mention on ever message
This fixes #2119 and additionally introduces the possibility to mention
users by their public key.
2019-08-26 23:22:17 -07:00
sudden6
641fba3553
fix: empty username causes mention on ever message
This fixes #2119 and additionally introduces the possibility to mention
users by their public key.
2019-08-26 19:08:34 +02:00
TriKriSta
a6a0481ddc feat: save selected search text after scrolling up 2019-08-22 15:11:18 +03:00
TriKriSta
e3c35c9153 fix: data validation during the search (fix: #5791, #5723) 2019-08-21 15:26:18 +03:00
TriKriSta
5aeac56b76 feat: prohibition to remove messages in group chat 2019-07-22 21:16:26 +03:00