Repository: importantimport/hatsu (language: rust)

Issue:
Set icon
Is it possible to set the icon of the fedi actor or pull it from the RSS feed?

![image](https://github.com/importantimport/hatsu/assets/19589006/147d16f7-db75-4b92-b24f-5051f3dca84f)



Discussion / hints:
Hatsu currently gets the icon from the feed.
Atom / RSS should also work, but I'm not sure how `feed-rs` are handled.

https://github.com/importantimport/hatsu/blob/1dc88b73db9a38a970238f445d455f87d5099bd9/crates/feed/src/user_feed.rs#L107
Is it possible that it's because I use an SVG icon?
> Is it possible that it's because I use an SVG icon?

Hatsu only verifies that it is a url, not the icon format. For reference, you can try accessing your actor json to see if it contains the icon
Nope I don't see anything: https://fedi.place.reeseric.ci/users/place.reeseric.ci
> Nope I don't see anything: [fedi.place.reeseric.ci/users/place.reeseric.ci](https://fedi.place.reeseric.ci/users/place.reeseric.ci)

I found the reason, RSS2 doesn't have an `icon`. maybe I should use the `logo` as a fallback.

https://github.com/feed-rs/feed-rs/blob/0f4d13488952b0d9f0abd140caeb30be922fcac8/feed-rs/src/parser/rss2/mod.rs#L65

Fix patch:
diff --git a/crates/feed/src/user_feed.rs b/crates/feed/src/user_feed.rs
index 45bf57b9..91ce0ac5 100644
--- a/crates/feed/src/user_feed.rs
+++ b/crates/feed/src/user_feed.rs
@@ -104,7 +104,10 @@ impl UserFeed {
                 None => String::from("untitled"),
             },
             description: feed.description.map(|text| text.content),
-            icon: feed.icon.map(|image| Url::parse(&image.uri).unwrap()),
+            icon: feed.icon.map_or(
+                feed.logo.map_or(None, |image| Url::parse(&image.uri).ok()),
+                |image| Url::parse(&image.uri).ok(),
+            ),
             language: feed.language,
             items,
         })


Test patch: