Skip to content

Support qvitter api notifications

HJ requested to merge notifications into develop

Fixes #129 (closed) #86 (closed) #96

This MR completely removes current notifications logic (parsing home tl and adding relevant statuses when "favorited a post" and such appear) and replaces it with fetching notifications from qvitter api. Therefore hosts without qvitter notifications api endpoint will have broken notifications in pleroma FE. If this is unacceptable - tell me - i'll try to restore current behavior and make it configurable to rely on old or new mechanic.

Another thing - it only relies on vanilla qvitter api without pleroma extensions, therefore it has problem with broken favorites (qvitter only gives you id of a post favorite is referring to). Using current method of fetching favorites - searching allStatuses sometimes doesn't work well because TL might not have own statuses.

This has been mitigated by adding a hidden "own" timeline which is automatically fetched for user's own posts (separate timeline so that it won't get broken when viewing someone else's profile) and adding a method for fetching older posts with specified starting id. This is pretty much a hack and should be removed once we extend qvitter notifications api to provide full post data in favorites (which i want to make in a separate MRs)

Another change is ability to load previous notifications and therefore removal of limit of max 20 notifications displayed.

And lastly - notifications now save their "seen" status, but in a hacky way. I couldn't find "mark as seen" endpoint so it doesn't seem to be a way to affect is_seen property in notifications. For now FE stores the latest notification id in local storage and automatically marks all notifications with id smaller than that as seen. Loading older notifications also automatically marks them as seen. This, again, should be removed once we can manipulate is_seen.

Known issues:

  • Favorites for DMs remain broken until DM is found in some timeline.
  • (unsure about if this actually happens or not) Repeats of your own posts are shown in home TL
  • Sometimes clicking favorite button on mention in notification area doesn't cause star to become filled, but does send a request and does update status/counter after a while.
    • Seems to be happening when post isn't on shown TL (i.e. getting a mention from another instance while looking at local timeline).~~
  • Error fetching notifications is noted internally but isn't shown in UI.
  • Fetching older notifications lacks localization string and needs fix for styling.
  • Broken favorites for DMs
  • Same delay issues with saving read status because of localstorage throttle.

Not really related to the subject of MR but it also fixes:

  • custom emojis in notifications in nicknames
  • gif avatars not animating on notification hover
Edited by HJ

Merge request reports