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.
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.
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
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.
* 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.
* 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.
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.
* 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
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
CI has very flaky network causing everything to take way longer than expected.
None of the tests are actually checking that something happens quickly, so just
set a stupidly long timeout to avoid flakiness.
* Fix statusMessage -> userName mixup in change_status_message
* Create named constant for sleep interval waiting for friend's message to arrive
* Elaborate on comments around the sleeps a bit more, I was confused by them still
* Increase bootstrap timeout to 120s, it expired in CI at 65s
* Move static function variables from core to be class member variables,
allowing two Core instances to run at once
* Replace deprecated QLatin1Literal with QLatin1String
* qvariant_cast slot argument to ToxPk, rather than trying to convert variant
to bytes directly which is invalid
* Fix "wait for both to come online" accidentally waiting for Bob twice
* Move all sleeps to QTRY_VERIFY_WITH_TIMEOUT to speed up test
* Update settings* -> settings& based on Core API change
* Update Mock to match API change of IBootstrapListGenerator
* Register metatype of ToxPk, uint32_t, Status::Status
* Correct Alice's spy looking for Bob's pk
Due to an old bug that has since be fixed, old history dbs can contain both a
Tox ID version and Tox public key version of the same friend, and always
themselves. They could have n more duplicates if they've updated their nospam.
Tox ID is an invalid length to be stored in strongly typed ToxPk, and in
general having multiple entries belonging to the same user effectively violates
our UNIQUE constraint on public_key.
Introduced in 7168d2b858Fix#6485
* Fix compile error on macOS by marking GroupWidget::widgetIsVisible as
override
* Mark mock functions override for consistency
* Change QWARN to QVERIFY since logs will be missed in CI
* Uncomment add of offline and online friends in testSortByActivity
* Add out-of-line method definition to anchor vtable
std::atomic disallows copy construction and the default constructor disables
the parameterized constructor.
Additionally the case where paths aren't writable isn't handled and would just
segfault in Settings previously, so no safety is lost.
As part of #1532 it was identified that long running file transfers
could get lost deep in the chatlog. This could result in unexpected use
of bandwidth over time if users lose track of old/large transfers. This
commit updates the files form to show in progress file transfers and
offer a way to control them.
* FilesForm now works on ToxFiles instead of finished file paths
* FilesForm widgets have been replaced with an MV tree view with depth
1. The existing QListWidget did not provide us the controls to render
more complex items. The use of delegates allows us to efficiently draw
progress bars and controls
* getHumanReadableSize has been extracted from FileTransferWidget into a
more general utils file
* Refactor/test ToxFileProgress to ensure that when it's moved it
behaves well
* Notice problems with speed averaging. We were average speeds without
keeping track of the times they were over. Adding samples of different
lengths would result in incorrect speeds. Refactor whole class to correct
* Move ToxFileProgress to be a member of ToxFile
* Remove duplicated members between ToxFile and ToxFileProgress
* Move sample addition into CoreFile
* Replace lines/messages with helper class to synchronize state between
IChatLog and ChatLog more easily
* selection indexes have been replaced with ChatLine::Ptrs, this is to
ensure consistency while the view slides around
* This has another benefit of removing all the code that has to
manually slide the selection boxes around
* Replaced all insertion/removal functions with single "insertAtIdx".
This helps ensure that mappings between ChatLogIdx and position within
the view are captured correctly as items in the view slide around
* workerTimeout replaced with more generic name "renderFinished" that is
used in synchronous and asynchronous paths
* Removed unused function ChatForm::insertChatMessage
* Re-implemented "Go to current date" with new ChatLog APIs
* Removed unused GenericChatForm::addSystemDateMessage. This is handled
by ChatLog now
* Resolves#6223
* Resolves#5878
* Resolves#5940
Define at least one virtual method in polymorphic class cpp files to
improve link efficiency. Do so by defining a defaulted destructor or
another overridden virtual method in the class cpp file.
Also add explicitly defaulted copy/move constructors and assignment
operators to follow the rule of five and to avoid compiler suppression
of these functions due to the addition of a user-provided destructor.
Where neccessary, create new cpp files and add them to CMakeLists and
Testing.cmake. Set the -Wweak-vtables by default when compiling with
clang to issue warnings for new classes that do not comply with this
pattern.
See http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers.
Fixes#6036.
* Resolves#6221
* System message schema designed to take enum of message base + args
* New table layout required many updates to the queries executed by
history
* Bonus reduction of history signals/slots by issuing some file transfer
insertions directly when possible
v0.0.2 of toxext_extended_messages brought in a user configurable max
message size. This changeset implements the minimum work required for
qTox to work sanely under the new API.
* Hardcode a max message size for all friends
* If a friend negotiates a max message size below the hardcoded value
pretend they do not have the extension
* Move splitMessage out of Core to MessageProcessor
* Updates to allow for extended messages to be split
* Added new negotiating friend state to allow delayed sending of offline
messages
* Added ability to flag currently outgoing message as broken in UI
* Reworked OfflineMsgEngine to support multiple receipt types
* Moved resending logic out of the OfflineMsgEngine
* Moved coordination of receipt and DispatchedMessageId into helper
class usable for both ExtensionReceiptNum and ReceiptNum
* Resending logic now has a failure case when the friend's extension
set is lower than the required extensions needed for the message
* When a user is known to be offline we do not allow use of any
extensions
* Added DB support for broken message reasons
* Added DB support to tie an faux_offline_pending message to a required
extension set