Age | Commit message (Collapse) | Author |
|
Room: Use reverse iterators internally to deal with read markers
|
|
Turns out that because the read marker is positioned _after_ the last read message, a reverse iterator models it much better than the usual one. This commit switches the internal representation to reverse iterators (externally, we operate in terms of event id's, still).
|
|
Make events traceable
|
|
|
|
A new hashmap, eventsIndex, is provided, that allows you to find the event in the timeline if you have eventId. This hashmap uses the fact that deque iterators don't invalidate upon insertion of elements to either end of the deque. Thanks to that, promoteReadMarker() and doAddNewMessageEvents() have been considerably simplified; also, it should be easier now to calculate event indices without rolling back and forth over the timeline.
|
|
|
|
|
|
Crop avatar to ensure it has exactly the wanted size; Fixes memory leak #45
|
|
Unread messages implementation in the library
|
|
|
|
|
|
Room::Private::member() filters out non-members of the room, which is not the right thing when adding messages from a person that left the room, e.g.
|
|
Thanks to @maralorn for pointing out.
|
|
Cleanup upon code inspection in CLion
|
|
|
|
|
|
|
|
The first change allows to use the read marker from QML (hint to Tensor). The second change is actually a fix for a case when markMessagesAsRead() is called with an iterator behind the last read event (in that case markMessagesAsRead() would post a receipt for that older event, which is not quite right).
|
|
These parts are either deprecated or just unlikely to be reused in the current form. Breaks Quaternion master as of now (it #includes logmessage.h).
|
|
associated with Event objects anyway
|
|
This code is useful for any client that uses the Room class and needs to display the list of room members. Also removed an unused #include.
|
|
|
|
These changes are most harmless; a no more used Private class removed, and an incorrect signal specification in connect() fixed. Also, one explicit #include has been added, just in case.
|
|
Kicking markMessagesAsRead() at each mouse move is still a bad idea - I'm looking at you Quaternion.
|
|
The implementation allows further extension to actually counting unread messages (in their Room::isEventNotable() sense - see the code) but so far just replicates what Quaternion previously provided. The only difference from the Quaternion implementation is that last own message is not marked as read immediately - so that we can allow the local user to send messages while staying with the read marker well above. This implies, though, that the read marker won't reset to the timeline bottom at any movement of the user - rather that it resets to the bottom of the current view (which is the ultimately correct behaviour, anyway).
|
|
Qt Creator turns out to be watching for "at :" substring in logs to detect messages that refer to files - which is not our case. Removing a comma fixes the alarm.
|
|
CMake tweaks
|
|
That list was bound to become outdated every now and then.
|
|
Qt5Core_DIR shows a path to the .cmake file's directory, which is a little too much information. The same change will be made in Quaternion, with the Qt prefix having additional usage in installation.
|
|
|
|
|
|
Room: added setLastReadEvent accessor and a signal for it; don't post receipts for own messages to the server
|
|
|
|
Room::markMessagesAsRead: use the iterator to the message, not after the message.
Room::setLastReadEvent: moved to protected
|
|
setLastReadEvent() is called in any case (read marks a stored in a hashmap so it's a constant time operation anyway); postReceipt() is now called for the nearest previous non-local message.
|
|
QJsonObject stock constructors are boring anyway - using QJsonObject::QJsonObject wasn't really necessary.
|
|
receipts for own messages to the server
As discussed with Matthew in #quaternion: https://matrix.to/#/!PCzUtxtOjUySxSelof:matrix.org/$14768896199130qcJqe:matrix.org
|
|
Merged as amended.
|
|
|
|
data() in each job class
|
|
MediaThumbnailJob: Use QSize instead of two separate int's for size
|
|
Connection::getThumbnail() is now overloaded to provide compatibility with the previous interface.
|
|
Event objects leaks plugged
|
|
|
|
|
|
|
|
The previous code had no effect because QVector<Receipt> was instantiated before Q_DECLARE_TYPEINFO occurence.
|
|
|
|
Normally, this shouldn't happen anyway - just a double-check,
|
|
This fixes a case when another person mentions you by disambiguated name, and this is not highlighted because Riot uses () and Quaternion uses <> to decorate disambiguated names (as well as to check mentions).
|