aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
AgeCommit message (Collapse)Author
2018-07-22Change order data type.Black Hat
2018-07-21Overload Room:addTag.Black Hat
2018-07-11Room: (optionally) keep redaction events in the timelineKitsune Ral
If KEEP_REDACTIONS_IN_TIMELINE is defined, the library adds redaction events to the timeline as well. If not, the legacy behaviour is used: redaction events themselves are dropped from the timeline and only stored as parts of redacted events. Closes #220. Closes #196 (requires KEEP_REDACTIONS_IN_TIMELINE for that).
2018-07-11Room::isRedaction: disallow empty pointersKitsune Ral
They should not come anywhere around Room.
2018-07-10Room::postHtmlMessage() - a facility method to send HTML messagesKitsune Ral
2018-07-09Room: Revert from visit() to a combination of ifs and eventCastsKitsune Ral
Easier to read, and also easier compiler diagnostics if things go wrong. Still using visit() for state events processing though - it maintains that all lambdas return some value.
2018-07-08visit<>(): drop the overload for pointer-like objectsKitsune Ral
It confuses compilers and adds a mostly unneeded null check; it's dead easy to just dereference a pointer before passing it to visit<>().
2018-07-04Events: use a template structure instead of template variables; rearrange ↵Kitsune Ral
code into blocks A template member variable in it seemed to cause internal compiler error in MSVC 2017, let alone MSVC 2015...
2018-07-04Event types system remade to be extensibleKitsune Ral
There were two common points that had to be updated every time a new event is introduced: the EventType enumeration and one of 3 doMakeEvent<> specialisations. The new code has a template class, EventFactory<>, that uses a list of static factory methods to create events instead of typelists used in doMakeEvent<>(); the EventType enumeration is replaced with a namespace populated with constants as necessary. In general, EventType is considered a deprecated mechanism altogether; instead, a set of facilities is provided: is<>() to check if an event has a certain type (to replace comparison against an EventType value) and visit<>() to execute actions based on the event type (replacing switch statements over EventType values). Closes #129.
2018-07-01More cleanup and minor tweaksKitsune Ral
2018-06-03csapi + converters: Support variant types (using QVariant)Kitsune Ral
This mandated some rearrangement of toJson() overloads and FromJson<> specializations for QVariant* types - instead of variant_converters.h they are now in converters.cpp.
2018-06-02Room::dropDuplicateEvents(): use a reference instead of a pointerKitsune Ral
There's no case for a nullptr in that function, and I'm fine to use non-const ref parameters.
2018-05-28Move out prettyPrint() from Room to util.hKitsune Ral
So that it could be used outside of room context.
2018-05-06Optimise #includes, eliminate some excess blank lines in lib/csapiKitsune Ral
2018-05-06Room::calculateDisplayname: fix a misleading room name after leaving a ↵Kitsune Ral
one-on-one
2018-05-04New home for the generated code - lib/csapiKitsune Ral
2018-05-04Preempt job/setroomstatejob.* with jobs/generated/room_state.*Kitsune Ral
The template part (not exposed in the auto-generated class) goes to Room::Private::requestSetState(). Also, Room::setMemberState() to interface with User class.
2018-05-04EvT::TypeId: Use a member function instead of a variableKitsune Ral
The latter one causes linkage errors when used from a template method (but not from a template class, puzzlingly).
2018-05-03GetRoomEventsJob (replaces RoomMessagesJob) + refactoringKitsune Ral
1. Updates in this commit (see further) allow to generate and build GetRoomEventsJob from message_pagination.yaml; this job completely preempts RoomMessagesJob. 2. EventsBatch<> is no more a thing; there's EventsArray<> to replace it but it's loaded from a JSON array rather than an event batch (a JSON array inside another JSON object). SyncJob that used it extensively has been moved to "conventional" containers (Events, RoomEvents and the newly introduced StateEvents). RoomMessagesJob that also used EventsBatch<> is decommissioned (see above). 3. RoomEventsRange is now an alias for Range<RoomEvents>, defined in util.h (otherwise almost the same). 4. Connection::getMessages() is no more. Use Room::getPreviousContent() and Connection::callApi<GetRooMEventsJob>() instead. 5. Moving things around in Room, since SyncJob now supplies state events in more specific StateEvents, rather than RoomEvents.
2018-05-03Room::Private::processRedaction: minor refactoringKitsune Ral
2018-05-01Event and Room: further abstract event pointersKitsune Ral
So that eventual switch from std::unique_ptr to some other pointer (as a case - QSharedPointer) would be as painless as possible.
2018-05-01Room: endorse std::moveKitsune Ral
That is, add "using std::move" and strip std:: from actual usages.
2018-04-27Use bridge names as the first line of disambiguationKitsune Ral
If can get away without showing MXIDs we should do it.
2018-04-27Cache bridge names along with user namesKitsune Ral
Otherwise the bridge is forgotten after restart. This bumps the cache version.
2018-04-22Code reformattingKitsune Ral
2018-04-13Support Qt 5.4Kitsune Ral
That is until ubports move to xenial.
2018-04-02Room/Connection: accountData()/accountDataChanged()Kitsune Ral
Generic account data are at least readable now (you can get, say, pushers from the library without it even being aware of what a pusher is).
2018-03-31Move source files to a separate folderKitsune Ral
It's been long overdue to separate them from the rest of the stuff (docs etc.). Also, this allows installing to a directory within the checked out git tree (say, ./install/, similar to ./build/).