How to check if a user is sharing their online status?
- 12 years ago
Hi Claudius,
This preference is stored as a user setting called "profile.show_online_status". You can obtain the value like any other user setting via the REST API:
So your call would look like:
/users/id/77/settings/name/profile.show_online_status
Currently, the possible values are:
- all
- none
- friends_only
These correspond to the options presented in the UI. The "friends_only" one may give you a little trouble, since you'd have to look up whether or not the person viewing is a friend of the person whose online status they're trying to view. You could also take a conservative approach and lump "friends_only" in with "none".
Alternately, you could try using an attempt/recover block in FreeMarker like you mentioned. If it reaches the "recover" block, you could assume that the user doesn't have permission and not show the status.