Skip to content

Commit

Permalink
feat: add client tag
Browse files Browse the repository at this point in the history
  • Loading branch information
reyamir committed Sep 20, 2024
1 parent b239032 commit dafe35c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src-tauri/src/commands/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,22 +429,20 @@ pub async fn publish(
// Create tags from content
let mut tags = create_event_tags(&content);

// Add client tag
// TODO: allow user config this setting
tags.push(Tag::custom(TagKind::custom("client"), vec!["Lume"]));

// Add content-warning tag if present
if let Some(reason) = warning {
let t = TagStandard::ContentWarning {
reason: Some(reason),
};
let tag = Tag::from(t);
let tag = Tag::from_standardized(t);
tags.push(tag)
};

// Get signer
let signer = match client.signer().await {
Ok(signer) => signer,
Err(_) => return Err("Signer is required.".into()),
};

// Get public key
let signer = client.signer().await.map_err(|err| err.to_string())?;
let public_key = signer.public_key().await.map_err(|err| err.to_string())?;

// Create unsigned event
Expand Down

0 comments on commit dafe35c

Please sign in to comment.