Open DMRobertson opened 1 year ago
Synapse's logic in /sync is here: https://github.com/matrix-org/synapse/blob/d0c4257f14addbf0c9072c2e34ae1c8294716ed5/synapse/rest/client/sync.py#L204-L210
Digging in, if affect_presence is falsey then the function does nothing: see https://github.com/matrix-org/synapse/blob/199c2709479a833e0dc01d19773031c3d5fa63fb/synapse/handlers/presence.py#L973, https://github.com/matrix-org/synapse/blob/199c2709479a833e0dc01d19773031c3d5fa63fb/synapse/handlers/presence.py#L474 and https://github.com/matrix-org/synapse/blob/199c2709479a833e0dc01d19773031c3d5fa63fb/synapse/handlers/presence.py#L155-L172
So Synapse votes for option 2.
Not sure about conduit: the only match for set_presence
in sync code is a TODO: https://gitlab.com/famedly/conduit/-/blob/d2bfcb018ed40eb91b6f7dd31727e24f2b992727/src/api/client_server/sync.rs#L174
Link to problem area:
Issue
From the second link:
https://github.com/matrix-org/matrix-spec/blob/8b51f1c0110384a970b777afdc11d76b17f4e97d/content/client-server-api/modules/presence.md?plain=1#L17-L25
This makes it sound like presence is a three-valued enum.
From the first link:
https://github.com/matrix-org/matrix-spec/blob/45b6aaf07ae119a0e284192d6de8a13cf668d06f/data/api/client-server/sync.yaml#L91-L105
This describes three query parameter key-values pairs:
set_presence=online
,set_presence=offline
, andset_presence=unavilable
. The wording for offline is particularly confusing:This sounds like
set_presence=offline
is effectively a no-op that doesn't alter the current present state of the user.It is hard to reconcile these two views. I see two possibilities:
set_presence=offline
really does set your presence state tooffline
. If this is true,set_presence
is confusing, andset_presence=offline
is a no-op on your presence state. If this is true,set_presence
is slightly confusing, andoffline
using /sync.Both options seem confusing and inconsistent.
I would like to understand which of these is true and update the spec to make this clearer.