Skip to content

View your own profile via account switcher

Joshua Goins requested to merge (removed):view-profile-switcher into master

Normally, you can't easily access your own profile so this MR adds a way, by accessing it via the account switcher.

image

Curiously, there was a very little infrastructure to support this, so I had to make a few changes on the C++ side as well:

  • Added a new QML property to access the selectedAccountModel (it's exposed as a QVariant like how we do it on the timeline model)
  • Added TapHandler & HoverHandler to push a new AccountInfo page with the aforementioned selectedAccountModel
    • I couldn't get the cursor shape to function correctly with a TapHandler alone for some reason? If we don't have it, it's not really obvious on desktop that you can click to access your profile.
  • AccountModel's logic had to be overhauled for some odd reason
    • This was going to be necessary at one point I think, because you were always hitting a m_identity null access if the identity didn't already exist in the cache. I added null checks or moved stuff around to prevent this.
    • As per the bug I hit above, updateRelationships is now a separate function, wasn't sure if I was going to go through the song & dance to make it a slot but I can change that.
    • the identityChanged signal is now emitted for cache hits, just in case.
    • I noticed that the model's display name didn't update on identity update, so I hooked up the relevant signal & slot.

There is a couple of issues that I would like some input on, but otherwise the MR does function:

  • Kirigami.Avatar seems to eat up my HoverHandler, is there a fix or should we just leave it be?
  • I believe we are already storing the current account's identity, but it's not put inside of the cache. If not, where is our profile picture, display name and other information coming from? I didn't have enough time to investigate this :-)

Merge request reports