jwr1 / interstellar

An app for Mbin and Lemmy, connecting you to the fediverse.
https://kbin.earth/m/interstellar
GNU General Public License v3.0
27 stars 4 forks source link

Further Microblog/Entry Support #4

Closed olorin99 closed 6 months ago

olorin99 commented 6 months ago

Added

olorin99 commented 6 months ago

One other thing I noticed is that the edit/delete menu still shows up and is clickable even when the thread/post/comment was made by someone else.

In order to check if logged in user is the OP, is the logged in userID stored somewhere? I can see "_selectedAccount" in SettingsController. Would this be the best variable to use for comparisons?

jwr1 commented 6 months ago

One other thing I noticed is that the edit/delete menu still shows up and is clickable even when the thread/post/comment was made by someone else.

In order to check if logged in user is the OP, is the logged in userID stored somewhere? I can see "_selectedAccount" in SettingsController. Would this be the best variable to use for comparisons?

Yes, that would work.

jwr1 commented 6 months ago

selectedAccount isn't the user id though, it's the username (like hello@kbin.earth, instead of 53198).

jwr1 commented 6 months ago

It looks like the username, from the API, for non federated users is just the username itself (no at symbols or hosts), so you could just check that the user.username field in entries/posts/comments matches the part before the @ in selectedAccount.

olorin99 commented 6 months ago

@jwr1 Should be good to go now.