aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-22BaseJob::* facility classes: better constructionKitsune Ral
Use std::initializer_list instead of QList<> because we actually want to construct from initializer lists; and only enable Data(std::initializer_list) for older Qt's that don't have the same on the level of QJsonObject.
2017-06-22Connection is now able to generate transaction idsKitsune Ral
The generation algorithm doesn't support several Quaternions using the same accessToken, as of yet.
2017-06-13Removed RoomMessageEvent::userId in favor of RoomEvent::senderIdKitsune Ral
2017-06-07Merge pull request #69 from Quiark/pull-bridged-fieldKitsune Ral
Split bridge name into a separate field in user model
2017-06-07Adjust whitespaceRoman Plášil
2017-06-07Split user's bridge (IRC, Gitter) into a separate field in user model objectRoman Plášil
2017-06-07Merge pull request #68 from Quiark/pull-mark-invokableKitsune Ral
Make markAllMessagesAsRead() Q_INVOKABLE
2017-06-07Make markAllMessagesAsRead() Q_INVOKABLERoman Plášil
2017-06-02Merge pull request #66 from Quiark/reorgKitsune Ral
Expose userlist to QML
2017-06-02Add Room::memberNames() for nick completion in QMLRoman Plášil
2017-06-02Clean upRoman Plášil
2017-06-02Fix qmake compilationRoman Plášil
2017-05-28Merge pull request #65 from QMatrixClient/kitsune-simplify-eventsKitsune Ral
Events refactoring
2017-05-22Fixed building with CLang 3.5Kitsune Ral
2017-05-22Refactored EventsKitsune Ral
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
2017-05-22CleanupKitsune Ral
2017-05-22Dispatch<>: Allow nullptr for a function; special-case GCC 4.8Kitsune Ral
2017-05-22util.h: lookup() uses forwarding refs; added Dispatch/dispatch and REGISTER_ENUMKitsune Ral
The Dispatch<> template and dispatch(), a facility function for it, simplify dispatching to functions that have different signatures that still can be converted to the same std::function<> type. The case in point is in event.cpp; Event::fromJson calls make() that always returns the type we need; however, once we have several possible base types (Event, RoomEvent, StateEvent), we'd have to either write a specific make() incarnation for each of them, or mess with function return type conversions. Dispatch<> helps to keep the code clean. REGISTER_ENUM is a cross-Qt versions approach to dumping enumeration values to qDebug() and the likes.
2017-05-18Merge pull request #64 from Fxrh/kitsune-osx-ciKitsune Ral
Enable OSX in Travis CI
2017-05-18Enable OSX in Travis CIKitsune Ral
2017-05-17Merge pull request #62 from Fxrh/kitsune-refactoringKitsune Ral
Code tweaks and cleanup
2017-05-13More code cleanup and tweaks; fine-tuning logs; performance improvementsKitsune Ral
After adding some profiling it became clear that to recalculate the room name and emit namesChanged() upon each member event is a waste, especially when there are thousands of those coming at initial sync (*cough* Matrix HQ room). So the room name is recalculated only once and unconditionally (in most cases this will boil down to checking whether name/canonicalAlias changed after processing the events batch), and namesChanged is only emitted once per batch, if any name or alias changed.
2017-05-13Refactored logging enhancementsKitsune Ral
logging.h/logging.cpp is now a full-fledged pair for all things logging. Two more categories added, EPHEMERAL and SYNCJOB, that control logging for ephemeral events and SyncJob, respectively (in particular, switching off EPHEMERAL greatly reduces the logspam about moving read markers and how many users have read up to which event).
2017-05-12BaseJob: Do not leak access token into the job configurationKitsune Ral
Before the access token was added to Private::requestQuery on every sendRequest() invocation, leading to the same access token being added up to the request once more with each retry.
2017-05-09Returned Connection::disconnectFromServer() for back-compatibilityKitsune Ral
2017-05-09README.md: Described how to use Qt logging categoriesKitsune Ral
2017-05-09Enable Travis CI webhook so that Matrix rooms could listenKitsune Ral
2017-05-09LeaveRoomJob now accepts a roomId, not a Room object; Room::leaveRoom() ↵Kitsune Ral
introduced; Connection and Room cleanup Helps to better encapsulate Room
2017-05-09Allow to get a Connection object of the RoomKitsune Ral
It's just natural, after all, Connection is a parent of Room. But seriously, this will be needed when we have rooms from different Connections living next to each other.
2017-05-09Code cleanup and tweaking (partially driven by clang-tidy)Kitsune Ral
Mainly it's about const-ification (in particular, passing const-refs instead of values) and deleting unneeded declarations/#includes. Since the changes alter the external interface, this is submitted as a PR for peer review. One of unneeded declarations/definitions is a virtual destructor in BaseJob descendants. Since a job object should be deleted through QObject::deleteLater() anyway (and it's the only correct way of disposing of the object), all deletions will call the stack of destructors through virtual QObject::~QObject(). Therefore even BaseJob could get on with a non-virtual destructor but for the sake of clarity BaseJob::~BaseJob() is still declared virtual.
2017-05-08Make QNetworkAccessManager member a singletonKitsune Ral
As Qt documentation advises, a single QNetworkAccessManager is enough for the whole Qt application.
2017-05-01Merge pull request #61 from elvisangelaccio/qloggingcategoryKitsune Ral
Port to categorized logging
2017-04-30Port to categorized loggingElvis Angelaccio
This greatly reduces the noise made by quaternion. To enable full logging, export the following variable: QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
2017-04-20Merge pull request #60 from elvisangelaccio/dont-discard-avatarsKitsune Ral
Don't discard avatars as well
2017-04-19Don't discard avatars as wellElvis Angelaccio
Same workaround as in commit 836f35dc7d, but this time also for avatars.
2017-04-18Added markAllMessagesAsRead()Kitsune Ral
2017-04-18Use localeAwareCompare() to sort room membersKitsune Ral
Because it's a recommended by Qt method to sort end-user-facing lists.
2017-04-17Merge pull request #59 from elvisangelaccio/fix-displaynameKitsune Ral
Don't discard user display names upon leave membership events
2017-04-17Don't discard user display names upon leave membership eventsElvis Angelaccio
Otherwise the following QJsonObject will discard a valid display name in RoomMemberEvent::fromJson(): QJsonObject({"content":{"membership":"leave"},"event_id":"$14905359301189950PoADM:matrix.org","membership":"leave","origin_server_ts":1490535930821,"sender":"@elvisangelaccio:matrix.org","state_key":"@elvisangelaccio:matrix.org","type":"m.room.member","unsigned":{"age":1887090448,"prev_content":{"avatar_url":"mxc://matrix.org/PuDxgBQfeplXbCQFvOGpTEmC","displayname":"eang","membership":"join"},"prev_sender":"@elvisangelaccio:matrix.org","replaces_state":"$14905358091189487gXwtE:matrix.org"}})
2017-04-16Make sure message body is treated as plain textKitsune Ral
The previous code deviated from the spec, trying to guess on the content type of body as if there could be HTML in some cases. The spec openly states that 'body' value should always be in plain text.
2017-04-14Enable PostMessageJob to send rich text messagesKitsune Ral
2017-04-13Use own copy of MIME database on WindowsKitsune Ral
The one that comes with Qt as a fallback is from 2012 (even from newer Qt versions) and is missing many common content types.
2017-04-05Make Room data Q_PROPERTY's so that they could be accessed from QML tooKitsune Ral
2017-04-04Merge pull request #58 from elvisangelaccio/masterKitsune Ral
You've got the point. Merged this.
2017-04-04Don't extend the spec when calculating the display nameElvis Angelaccio
Room names conflicts should be handled at the client level, for example by displaying the canonical alias in a tooltip or in the custom delegate of the view. If we extend the display name algorithm at the lib level, we are just cluttering the display name in the most common scenario (i.e. when there are no name clashes).
2017-04-02Renamed JobHttpType to more fitting HttpVerb; removed Job from enum valuesKitsune Ral
2017-04-02Rotten comments fixesKitsune Ral
2017-04-01Merge pull request #57 from elvisangelaccio/default-avatarKitsune Ral
Couldn't find anything cross-platform to track theme changes, so just merging this. Thanks!
2017-03-30Fixed accidental auto-promotion when read marker is out of sightKitsune Ral
2017-03-27Map QNetworkReply::UnknownContentError to BaseJob::IncorrectRequestErrorKitsune Ral
This is what /join returns if I supply garbage for the alias.