From 7786553cda92c366d02719b9427ee24da303ba97 Mon Sep 17 00:00:00 2001 From: strawberry Date: Sat, 10 Feb 2024 11:43:58 -0500 Subject: [PATCH] doc+check if user does not have local presence enabled if using outgoing presence Signed-off-by: strawberry --- conduwuit-example.toml | 2 ++ src/main.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/conduwuit-example.toml b/conduwuit-example.toml index 2f6d5f5c..31aa430d 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -244,6 +244,7 @@ enable_lightning_bolt = false # Config option to control local (your server only) presence updates/requests. Defaults to false. # Note that presence on conduwuit is very fast unlike Synapse's. +# If using outgoing presence, this MUST be enabled. #allow_local_presence = false # Config option to control incoming federated presence updates/requests. Defaults to false. @@ -254,6 +255,7 @@ enable_lightning_bolt = false # Config option to control outgoing presence updates/requests. Defaults to false. # This option sends presence updates to other servers, but does not receive any unless `allow_incoming_presence` is true. # Note that presence on conduwuit is very fast unlike Synapse's. +# If using outgoing presence, you MUST enable `allow_local_presence` as well. # # Warning: Outgoing federated presence is not spec compliant due to relying on PDUs and EDUs combined. # Outgoing presence will not be very reliable due to this and any issues with federated outgoing presence are very likely attributed to this issue. diff --git a/src/main.rs b/src/main.rs index 2a949ec8..d3df9a48 100644 --- a/src/main.rs +++ b/src/main.rs @@ -178,6 +178,11 @@ async fn main() { If this is not the desired behaviour, please set a registration token."); } + if config.allow_outgoing_presence && !config.allow_local_presence { + error!("Outgoing presence requires allowing local presence. Please enable \"allow_outgoing_presence\"."); + return; + } + if config.allow_outgoing_presence { warn!("! Outgoing federated presence is not spec compliant due to relying on PDUs and EDUs combined.\nOutgoing presence will not be very reliable due to this and any issues with federated outgoing presence are very likely attributed to this issue.\nIncoming presence and local presence are unaffected."); }