retro-aim-server icon indicating copy to clipboard operation
retro-aim-server copied to clipboard

Add API endpoint to get online/offline/away/idle status, plus away message if possible

Open CoherentLogic opened this issue 1 year ago • 2 comments

Description of the feature

Management API endpoint that can, for a given screen name, retrieve:

  • Offline/online state
  • Idle state
  • Idle duration
  • Away state
  • Away message

Use case

This would be useful in the ChivaNet environment for further integration with the ChivaNet website, RAS directory, and presence API. I assume it could be used similarly by other operators.

CoherentLogic avatar Jun 18 '24 02:06 CoherentLogic

Would it be acceptable to add these to the /sessions endpoint? I have a change in-progress that adds the following fields to the /sessions endpoint

  • away_message - contents of their away message
  • idle_seconds - how many seconds they have been idle
  • online_seconds - how many seconds they have been online

Then to address the states,

  • For online state you can assume if the screen name is present in /sessions, they are online
  • For idle state you can assume if idle_seconds > 0, they are idle
  • For away state you can assume if away_message is not blank, they are away

I think it'd also be cool to update the /users endpoint so you could get /user/XXX and see their profile and buddy icon. This would also be a good spot to (in the future) return their privacy settings so you could control whether their presense etc should show up on the chivanet directory page.

jgknight avatar Jul 13 '24 19:07 jgknight

That works for me!

CoherentLogic avatar Jul 14 '24 15:07 CoherentLogic