0c39cce550955a9337424ff472d965c5f4ccb76e — Andrew Thorp 3 years ago 77971e5
Add active-status spec
A specifications/twig-extensions/active-status/README.md => specifications/twig-extensions/active-status/README.md +15 -0
@@ 0,0 1,15 @@
# Active Status
Twig metadata which indicates whether or not a user is or is not online.
Field specification in [spec.toml](spec.toml).

## Usage
An 'active status' message is designed to be sent as 'active' when a user connects to a forest, with the client sending an 'inactive' message upon exit.
This minimizes the number of messages sent by the client.
In case of unclean exits however, it is generally used in combination with expiration.
E.g. send an active status message that is "live" for 5 minutes during client startup and every consecutive 5 minutes.
In this case it is still recommended to send an "inactive" message during client shutdown/disconnect.

Active Status messages should also be invisible.

It is up to the client to keep a running map of users that have un-expired "active" messages to determine who is online.
An example of one solution to this can be found [in fores-ex](https://git.sr.ht/~athorp96/forest-ex/tree/master/item/active-status/active-status.go#L43-141).

A specifications/twig-extensions/active-status/spec.toml => specifications/twig-extensions/active-status/spec.toml +5 -0
@@ 0,0 1,5 @@
key-name = "activity"

type = "string"
description = "A stringified integer, '0' or '1', representing 'Active' or 'Inactive', respectively."