libQuotient icon indicating copy to clipboard operation
libQuotient copied to clipboard

Provide ready-made models for rooms, users, and timeline

Open KitsuneRal opened this issue 6 years ago • 3 comments

First there was Quaternion; then Tensor borrowed from it; then uMatriks borrowed from Tensor. Time to consolidate.

KitsuneRal avatar Jun 05 '18 22:06 KitsuneRal

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

r0kk3rz avatar Jun 06 '18 11:06 r0kk3rz

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.

KitsuneRal avatar Jun 06 '18 11:06 KitsuneRal

Or we can write a custom QML Image item that accepts QImage as input.

soyflourbread avatar Sep 23 '18 12:09 soyflourbread