Closed olorin99 closed 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?
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.
selectedAccount
isn't the user id though, it's the username (like hello@kbin.earth, instead of 53198).
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
.
@jwr1 Should be good to go now.
Added