Add support for user online status #1

Open
opened 2025-01-28 11:27:32 +00:00 by jonas · 0 comments
Owner

Display a status (online/last seen) next to a user.

Requirements:

  • Add field to user: "last_activity"
  • Everytime a user loads/refreshes a page, set the last_activity field to the current server time.
  • When rendering a user (in a post or on their profile), display the status according to the following algorithm:
    If current_server_time - last_activity < 5 Minutes Then
      Display "user is online"
    Else
      Display "user was last seen" + formatRelativeTime(current_server_time, last_activity)
    End
    
Display a status (online/last seen) next to a user. **Requirements:** - Add field to user: "`last_activity`" - Everytime a user loads/refreshes a page, set the `last_activity` field to the current server time. - When rendering a user (in a post or on their profile), display the status according to the following algorithm: ```plain If current_server_time - last_activity < 5 Minutes Then Display "user is online" Else Display "user was last seen" + formatRelativeTime(current_server_time, last_activity) End ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mystic-house-corner/forum#1
No description provided.