add MSC3026 support (busy presence status)

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-05 17:48:02 -04:00
parent eb970d044d
commit a938640491
3 changed files with 86 additions and 18 deletions

View File

@ -27,13 +27,16 @@ js = ["dep:js-sys", "getrandom?/js", "uuid?/js"]
rand = ["dep:rand", "dep:uuid"]
unstable-exhaustive-types = []
unstable-msc2870 = []
unstable-msc3026 = []
unstable-msc3930 = []
unstable-msc3931 = []
unstable-msc3932 = ["unstable-msc3931"]
unstable-unspecified = []
# Allow IDs to exceed 255 bytes.
compat-arbitrary-length-ids = ["ruma-identifiers-validation/compat-arbitrary-length-ids"]
compat-arbitrary-length-ids = [
"ruma-identifiers-validation/compat-arbitrary-length-ids",
]
# Don't validate the version part in `KeyId`.
compat-key-id = ["ruma-identifiers-validation/compat-key-id"]
@ -63,10 +66,17 @@ getrandom = { version = "0.2.6", optional = true }
http = { workspace = true, optional = true }
indexmap = { version = "2.0.0", features = ["serde"] }
js_int = { workspace = true, features = ["serde"] }
konst = { version = "0.3.5", default-features = false, features = ["cmp", "iter", "parsing"], optional = true }
konst = { version = "0.3.5", default-features = false, features = [
"cmp",
"iter",
"parsing",
], optional = true }
percent-encoding = "2.1.0"
rand = { version = "0.8.3", optional = true }
regex = { version = "1.5.6", default-features = false, features = ["std", "perf"] }
regex = { version = "1.5.6", default-features = false, features = [
"std",
"perf",
] }
ruma-identifiers-validation = { workspace = true }
ruma-macros = { workspace = true }
serde = { workspace = true }

View File

@ -17,6 +17,10 @@ pub enum PresenceState {
#[default]
Online,
/// Connected to the service and active but not available for chat.
#[cfg(feature = "unstable-msc3026")]
Busy,
/// Connected to the service but not available for chat.
Unavailable,

View File

@ -31,21 +31,63 @@ client-hyper-native-tls = ["client", "ruma-client?/hyper-native-tls"]
client-isahc = ["client", "ruma-client?/isahc"]
client-reqwest = ["client", "ruma-client?/reqwest"]
client-reqwest-native-tls = ["client", "ruma-client?/reqwest-native-tls"]
client-reqwest-native-tls-vendored = ["client", "ruma-client?/reqwest-native-tls-vendored"]
client-reqwest-rustls-manual-roots = ["client", "ruma-client?/reqwest-rustls-manual-roots"]
client-reqwest-rustls-webpki-roots = ["client", "ruma-client?/reqwest-rustls-webpki-roots"]
client-reqwest-rustls-native-roots = ["client", "ruma-client?/reqwest-rustls-native-roots"]
client-reqwest-native-tls-vendored = [
"client",
"ruma-client?/reqwest-native-tls-vendored",
]
client-reqwest-rustls-manual-roots = [
"client",
"ruma-client?/reqwest-rustls-manual-roots",
]
client-reqwest-rustls-webpki-roots = [
"client",
"ruma-client?/reqwest-rustls-webpki-roots",
]
client-reqwest-rustls-native-roots = [
"client",
"ruma-client?/reqwest-rustls-native-roots",
]
appservice-api-c = ["api", "events", "dep:ruma-appservice-api", "ruma-appservice-api?/client"]
appservice-api-s = ["api", "events", "dep:ruma-appservice-api", "ruma-appservice-api?/server"]
appservice-api-c = [
"api",
"events",
"dep:ruma-appservice-api",
"ruma-appservice-api?/client",
]
appservice-api-s = [
"api",
"events",
"dep:ruma-appservice-api",
"ruma-appservice-api?/server",
]
appservice-api = ["appservice-api-c", "appservice-api-s"]
client-api-c = ["api", "events", "dep:ruma-client-api", "ruma-client-api?/client"]
client-api-s = ["api", "events", "dep:ruma-client-api", "ruma-client-api?/server"]
client-api-c = [
"api",
"events",
"dep:ruma-client-api",
"ruma-client-api?/client",
]
client-api-s = [
"api",
"events",
"dep:ruma-client-api",
"ruma-client-api?/server",
]
client-api = ["client-api-c", "client-api-s"]
federation-api-c = ["api", "signatures", "dep:ruma-federation-api", "ruma-federation-api?/client"]
federation-api-s = ["api", "signatures", "dep:ruma-federation-api", "ruma-federation-api?/server"]
federation-api-c = [
"api",
"signatures",
"dep:ruma-federation-api",
"ruma-federation-api?/client",
]
federation-api-s = [
"api",
"signatures",
"dep:ruma-federation-api",
"ruma-federation-api?/server",
]
federation-api = ["federation-api-c", "federation-api-s"]
identity-service-api-c = [
@ -60,8 +102,16 @@ identity-service-api-s = [
]
identity-service-api = ["identity-service-api-c", "identity-service-api-s"]
push-gateway-api-c = ["api", "dep:ruma-push-gateway-api", "ruma-push-gateway-api?/client"]
push-gateway-api-s = ["api", "dep:ruma-push-gateway-api", "ruma-push-gateway-api?/server"]
push-gateway-api-c = [
"api",
"dep:ruma-push-gateway-api",
"ruma-push-gateway-api?/client",
]
push-gateway-api-s = [
"api",
"dep:ruma-push-gateway-api",
"ruma-push-gateway-api?/server",
]
push-gateway-api = ["push-gateway-api-c", "push-gateway-api-s"]
# Required for randomness, current system time in browser environments
@ -164,7 +214,7 @@ unstable-exhaustive-types = [
"ruma-identity-service-api?/unstable-exhaustive-types",
"ruma-push-gateway-api?/unstable-exhaustive-types",
"ruma-state-res?/unstable-exhaustive-types",
"ruma-events?/unstable-exhaustive-types"
"ruma-events?/unstable-exhaustive-types",
]
unstable-extensible-events = [
"unstable-msc3246",
@ -178,7 +228,7 @@ unstable-msc2409 = ["ruma-appservice-api?/unstable-msc2409"]
unstable-msc2448 = [
"ruma-client-api?/unstable-msc2448",
"ruma-events?/unstable-msc2448",
"ruma-federation-api?/unstable-msc2448"
"ruma-federation-api?/unstable-msc2448",
]
unstable-msc2654 = ["ruma-client-api?/unstable-msc2654"]
unstable-msc2666 = ["ruma-client-api?/unstable-msc2666"]
@ -187,6 +237,7 @@ unstable-msc2867 = ["ruma-events?/unstable-msc2867"]
unstable-msc2870 = ["ruma-common/unstable-msc2870"]
unstable-msc2965 = ["ruma-client-api?/unstable-msc2965"]
unstable-msc2967 = ["ruma-client-api?/unstable-msc2967"]
unstable-msc3026 = ["ruma-common/unstable-msc3026"]
unstable-msc3061 = ["ruma-events?/unstable-msc3061"]
unstable-msc3202 = ["ruma-appservice-api?/unstable-msc3202"]
unstable-msc3245 = ["ruma-events?/unstable-msc3245"]
@ -197,7 +248,10 @@ unstable-msc3245-v1-compat = ["ruma-events?/unstable-msc3245-v1-compat"]
unstable-msc3246 = ["ruma-events?/unstable-msc3246"]
unstable-msc3381 = ["ruma-events?/unstable-msc3381"]
unstable-msc3401 = ["ruma-events?/unstable-msc3401"]
unstable-msc3488 = ["ruma-client-api?/unstable-msc3488", "ruma-events?/unstable-msc3488"]
unstable-msc3488 = [
"ruma-client-api?/unstable-msc3488",
"ruma-events?/unstable-msc3488",
]
unstable-msc3551 = ["ruma-events?/unstable-msc3551"]
unstable-msc3552 = ["ruma-events?/unstable-msc3552"]
unstable-msc3553 = ["ruma-events?/unstable-msc3553"]