@@ -695,6 +695,8 @@ pub struct TagItem {
695
695
lnurl : Option < LnUrl > ,
696
696
#[ serde( skip_serializing_if = "Option::is_none" ) ]
697
697
image_url : Option < String > ,
698
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
699
+ primal_image_url : Option < String > ,
698
700
/// Epoch time in seconds when this tag was last used
699
701
pub last_used_time : u64 ,
700
702
}
@@ -753,6 +755,11 @@ impl TagItem {
753
755
pub fn image_url ( & self ) -> Option < String > {
754
756
self . image_url . clone ( )
755
757
}
758
+
759
+ #[ wasm_bindgen( getter) ]
760
+ pub fn primal_image_url ( & self ) -> Option < String > {
761
+ self . primal_image_url . clone ( )
762
+ }
756
763
}
757
764
758
765
impl From < ( String , MutinyContact ) > for TagItem {
@@ -764,6 +771,12 @@ impl From<(String, MutinyContact)> for TagItem {
764
771
npub : contact. npub . map ( |n| n. to_bech32 ( ) . expect ( "bech32" ) ) ,
765
772
ln_address : contact. ln_address ,
766
773
lnurl : contact. lnurl ,
774
+ primal_image_url : contact. image_url . as_ref ( ) . map ( |i| {
775
+ format ! (
776
+ "https://primal.b-cdn.net/media-cache?s=s&a=1&u={}" ,
777
+ urlencoding:: encode( i)
778
+ )
779
+ } ) ,
767
780
image_url : contact. image_url ,
768
781
last_used_time : contact. last_used ,
769
782
}
@@ -781,6 +794,7 @@ impl From<labels::TagItem> for TagItem {
781
794
ln_address : None ,
782
795
lnurl : None ,
783
796
image_url : None ,
797
+ primal_image_url : None ,
784
798
last_used_time : item. last_used_time ,
785
799
} ,
786
800
labels:: TagItem :: Contact ( contact) => contact. into ( ) ,
0 commit comments