diff options
| author | 2025-04-08 12:16:55 +0100 | |
|---|---|---|
| committer | 2025-04-08 12:16:55 +0100 | |
| commit | e518e899e53c072724254bd714db914cde7db5b2 (patch) | |
| tree | b9a9d3c45e2b326adb6df9756678ef4050bb3589 | |
| parent | 0b19cb38183929d3f242cfd11c34426d9302697c (diff) | |
| download | luz-e518e899e53c072724254bd714db914cde7db5b2.tar.gz luz-e518e899e53c072724254bd714db914cde7db5b2.tar.bz2 luz-e518e899e53c072724254bd714db914cde7db5b2.zip | |
fix(filamento): caps +notify and use hex representation for avatar metadata id
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | filamento.db | bin | 0 -> 118784 bytes | |||
| -rw-r--r-- | filamento/Cargo.toml | 1 | ||||
| -rw-r--r-- | filamento/examples/example.rs | 23 | ||||
| -rw-r--r-- | filamento/src/caps.rs | 6 | ||||
| -rw-r--r-- | filamento/src/logic/online.rs | 2 | ||||
| -rw-r--r-- | filamento/src/logic/process_stanza.rs | 41 |
7 files changed, 48 insertions, 27 deletions
@@ -150,6 +150,8 @@ #### to write: +- [ ] some xmpp user avatar metadata nodes published as jpeg??? +- [ ] need to specify user avatar id as hexadecimal - [ ] advanced message body (for custom emoji, styling, etc.). can opt in to mixed content in message body. base as bold, italic, underline, strikethrough, then extensible with new tags for e.g. emoji, color, size, font, chat effects. - [ ] omemo cross-signing verification or something along those lines, with a main device and linked devices. safety numbers. - [ ] better stable ids....? diff --git a/filamento.db b/filamento.db Binary files differnew file mode 100644 index 0000000..6e17d1c --- /dev/null +++ b/filamento.db diff --git a/filamento/Cargo.toml b/filamento/Cargo.toml index 92c8370..d1749f4 100644 --- a/filamento/Cargo.toml +++ b/filamento/Cargo.toml @@ -20,6 +20,7 @@ sha3 = "0.10.8" base64 = "0.22.1" sha1 = "0.10.6" image = "0.25.6" +hex = "0.4.3" [dev-dependencies] tracing-subscriber = "0.3.19" diff --git a/filamento/examples/example.rs b/filamento/examples/example.rs index 8ebfde0..d7c03e4 100644 --- a/filamento/examples/example.rs +++ b/filamento/examples/example.rs @@ -12,21 +12,30 @@ impl FileStore for Files { type Err = Arc<io::Error>; async fn is_stored(&self, name: &str) -> Result<bool, Self::Err> { - Ok(tokio::fs::try_exists(format!("files/{}", name)) + tracing::debug!("checking if {} is stored", name); + let res = tokio::fs::try_exists(format!("files/{}", name)) .await - .map_err(|err| Arc::new(err))?) + .map_err(|err| Arc::new(err)); + tracing::debug!("file check res: {:?}", res); + res } async fn store(&self, name: &str, data: &[u8]) -> Result<(), Self::Err> { - Ok(tokio::fs::write(format!("files/{}", name), data) + tracing::debug!("storing {} is stored", name); + let res = tokio::fs::write(format!("files/{}", name), data) .await - .map_err(|err| Arc::new(err))?) + .map_err(|err| Arc::new(err)); + tracing::debug!("file store res: {:?}", res); + res } async fn delete(&self, name: &str) -> Result<(), Self::Err> { - Ok(tokio::fs::remove_file(format!("files/{}", name)) + tracing::debug!("deleting {}", name); + let res = tokio::fs::remove_file(format!("files/{}", name)) .await - .map_err(|err| Arc::new(err))?) + .map_err(|err| Arc::new(err)); + tracing::debug!("file delete res: {:?}", res); + res } } @@ -37,7 +46,7 @@ async fn main() { .await .unwrap(); let (client, mut recv) = Client::new( - "test@blos.sm".try_into().unwrap(), + "test@blos.sm/testing2".try_into().unwrap(), "slayed".to_string(), db, Files, diff --git a/filamento/src/caps.rs b/filamento/src/caps.rs index b3464d1..819e669 100644 --- a/filamento/src/caps.rs +++ b/filamento/src/caps.rs @@ -35,13 +35,13 @@ pub fn client_info() -> Info { Info { node: None, features: vec![ - "http://jabber.org/protocol/disco#items".to_string(), - "http://jabber.org/protocol/disco#info".to_string(), "http://jabber.org/protocol/caps".to_string(), - "http://jabber.org/protocol/nick".to_string(), + "http://jabber.org/protocol/disco#info".to_string(), + "http://jabber.org/protocol/disco#items".to_string(), "http://jabber.org/protocol/nick+notify".to_string(), "urn:xmpp:avatar:metadata+notify".to_string(), ], + // "http://jabber.org/protocol/nick".to_string(), identities: vec