Update readme
This commit is contained in:
@@ -13,6 +13,7 @@ pub struct Config {
|
||||
pub indexer_relays: Vec<String>,
|
||||
pub platform_name: String,
|
||||
pub platform_description: String,
|
||||
pub platform_picture: String,
|
||||
pub platform_messaging_relays: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -45,6 +46,7 @@ impl Config {
|
||||
.collect::<Vec<_>>();
|
||||
let platform_name = env::var("PLATFORM_NAME").unwrap_or_default();
|
||||
let platform_description = env::var("PLATFORM_DESCRIPTION").unwrap_or_default();
|
||||
let platform_picture = env::var("PLATFORM_PICTURE").unwrap_or_default();
|
||||
let platform_messaging_relays = env::var("PLATFORM_MESSAGING_RELAYS")
|
||||
.unwrap_or_default()
|
||||
.split(',')
|
||||
@@ -64,6 +66,7 @@ impl Config {
|
||||
indexer_relays,
|
||||
platform_name,
|
||||
platform_description,
|
||||
platform_picture,
|
||||
platform_messaging_relays,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ async fn main() -> Result<()> {
|
||||
&config.indexer_relays,
|
||||
&config.platform_name,
|
||||
&config.platform_description,
|
||||
&config.platform_picture,
|
||||
&config.platform_messaging_relays,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -6,6 +6,7 @@ pub async fn publish_platform_identity(
|
||||
indexer_relays: &[String],
|
||||
name: &str,
|
||||
description: &str,
|
||||
picture: &str,
|
||||
messaging_relays: &[String],
|
||||
) -> Result<()> {
|
||||
if indexer_relays.is_empty() {
|
||||
@@ -32,6 +33,9 @@ pub async fn publish_platform_identity(
|
||||
if !description.is_empty() {
|
||||
metadata = metadata.about(description);
|
||||
}
|
||||
if !picture.is_empty() {
|
||||
metadata = metadata.picture(Url::parse(picture)?);
|
||||
}
|
||||
|
||||
let metadata_builder = EventBuilder::metadata(&metadata);
|
||||
client.send_event_builder(metadata_builder).await?;
|
||||
|
||||
Reference in New Issue
Block a user