aboutsummaryrefslogtreecommitdiff
path: root/events
AgeCommit message (Collapse)Author
2016-11-01Removed unused #includesKitsune Ral
2016-10-07Fixed leaks of RoomMessageEvent contentKitsune Ral
2016-10-07Use Q_DECLARE_TYPEINFO correctlyKitsune Ral
The previous code had no effect because QVector<Receipt> was instantiated before Q_DECLARE_TYPEINFO occurence.
2016-09-21Merge pull request #31 from Fxrh/kitsune-sender-in-all-eventsKitsuneRal
Push sender from RoomTopicEvent to Event
2016-09-21Push sender from RoomTopicEvent to EventKitsune Ral
Because it's supposed to exist in (at least) all events from /sync.
2016-09-16Room: change the way messages are orderedKitsune Ral
This replaces the one-by-one timestamp-ordering algorithm of adding new messages with copying the whole group of just-arrived messages to either the beginning or the end of the timeline. Since origin timestamps do not provide a reasonable order, findInsertionPos() is entirely deleted. processMessageEvent() is replaced by two functions: addNewMessageEvents() appends at messageEvents.end() while addHistoricalMessageEvents() inserts them at messageEvents.begin(). There's no official way to insert messages in the middle; cases when getPreviousContent() is called in parallel or a RoomMessagesJob runs on a gap somewhere in the middle of the timeline weren't considered before this commit and aren't considered in it. The new ordering requires you to understand where you have got your events from (or rather, where you want to insert them). In particular, updateData() that processes /sync results uses addNewMessageEvents(); getPreviousContent() calls addHistoricalMessageEvents(). In order to notify clients, a single newMessages() signal gives way to 3 new signals: 2 aboutToAdd*Messages() and a common addedMessages(). In addition, clients can derive from Room and use doAdd*Messages() virtual functions to alter/extend the behaviour.
2016-09-14Don't search for event_id and origin_server_ts in m.receipt eventsKitsune Ral
2016-09-07A generic lookup(), and its usage in Event and RoomMessageEventKitsune Ral
Feel free to use whenever you need to convert another JSON key to some C++ object, or dispatch anything based on a JSON key.
2016-09-07Event::fromJson(): made the code more compact (correctly this time)Kitsune Ral
That might be not as efficient as a solution on variadic templates; but arguably easier to understand. Doesn't have the typo bug the previous version of this commit had.
2016-09-07Temporarily revert "Event::fromJson(): made the code more compact" as it ↵Kitsune Ral
breaks highlighting This reverts commit 0fe83d59d76cd8f9c8f92d40cc58d9f5b082a84a.
2016-08-31QList<Event*> -> using Events=QVector<Event*>Kitsune Ral
2016-08-31Event::fromJson(): made the code more compactKitsune Ral
That might be not as efficient as a solution on variadic templates; but arguably easier to understand.
2016-08-29RoomTopicEvent: parse and provide sender informationKitsune Ral
2016-08-29Align AudioContent with the rest; special-case creation of VideoContent onlyKitsune Ral
The spec is told to allow any event to have a thumbnail in future, and the thumbnail will reside under "content" JSON key rather than "info".
2016-08-25Structured parsing, folded repetitive initialization codeKitsune Ral
2016-08-24Introduce TextContent + minor cleanupKitsune Ral
TextContent is a class to deal with formatted (HTML, RTF, Markdown) text messages. Right now it only supports Vector's non-standard "formatted_body".
2016-08-24Drop unused (by code and by spec) hsob_ts valueKitsune Ral
2016-08-24Move plain body from Base (former MessageEventContent) inside RoomMessageEventKitsune Ral
According to the spec, this key has the same status as msgtype: both should exist in any message. Besides, it's always supposed to be a plain text so there's no polymorphism allowed here.
2016-08-24Moved message content classes to a dedicated namespaceKitsune Ral
2016-08-22Replaced QList<> with QVector<> where appropriate + minor code cleanupKitsune Ral
See https://marcmutz.wordpress.com/effective-qt/containers/ for the background and http://lists.qt-project.org/pipermail/development/2015-July/022283.html for the relevant flamewar in Qt dev mailing list.
2016-08-22findInsertionPos: allow usage with polymorphic typesKitsune Ral
Basically, this commit allows the inserted item type to be different from those in the container, as in findInsertionPos(baseTypeContainer, derivedTypeItem). Of course both types should still provide timestamp() for comparison.
2016-08-15Fixed a typo in the enum definitionKitsune Ral
Fortunately, the clients don't seem to use it atm.
2016-05-27Enhance loggingKitsune Ral
1. Introduce QDebug manipulators and formatJson manipulator in particular - this allows to accommodate some changes in Qt's debug printing behaviour between versions. 2. Show JSON for some questionable objects (UnknownEvents, events with no event_id etc.) 3. Log the list of typing users and the user id when getting an avatar.
2016-05-27Use nullptrKitsune Ral
2016-05-26Introducing EventList class + minor fixKitsune Ral
Now you can parse a JSON array into a list of events with a one-liner. Also, fromMSecsSinceEpoch accepts a qint64, not quint64 - fixed the respective cast.
2016-04-11Merge pull request #2 from KitsuneRal/code-maintenanceFelix Rohrbach
Code maintenance
2016-04-11Factor out the code that searches an insertion point in a timeline.Kitsune Ral
This is used once in the library and, I guess, twice more in the Quaternion. Implemented as a template function that is equally suitable for Event and Message, and any container that supports STL-style iterators (QList and other Qt containers do).
2016-04-11Use a more telling log line than !!!!Kitsune Ral
2016-04-11Missing method in the last commitFelix Rohrbach
2016-04-09Implement different types of messagesFelix Rohrbach
2016-04-08Use class instead of struct to remove warningKitsune Ral
Originally by Felix Rohrbach (kde@fxrh.de)
2016-04-05Imported the current source tree from Quaternion/lib.Kitsune Ral