libQuotient
libQuotient copied to clipboard
Provide ready-made models for rooms, users, and timeline
First there was Quaternion; then Tensor borrowed from it; then uMatriks borrowed from Tensor. Time to consolidate.
Indeed if we can all agree on what to call everything, which should be doable since we're all stuck with the structure of the matrix api anyway.
Most of my messagemodel is copypastad from quaternion, but QML apps need an image provider URL for things like avatars and such.
https://github.com/r0kk3rz/harbour-matrix/blob/master/src/models/messageeventmodel.cpp#L448
And in my roomlist model I have some stuff about the default tags that Riot.im puts in https://github.com/r0kk3rz/harbour-matrix/blob/master/src/models/roomlistmodel.cpp#L114
Well, the good thing about the models is that they need not be used in entirety. In fact, Quaternion has the same problem solved because the current version can show user avatars within the timeline (it's behind a feature flag because it does not always work good, but I'm gradually stabilising it). The most recent message model simply exports a User
object for that purpose. As for tags in the room list - I'm quite happy to expose them in some (preferably generic) form too, so we can simply use your version of RoomListModel
as a starting point and then improve on it.
The way I see it - the models are similar enough to just put them to the library repo and then iron out the differences.
Or we can write a custom QML Image item that accepts QImage as input.