remove blob rendering for blocked peers

This commit is contained in:
2022-03-02 13:35:21 +02:00
parent 6cba477f15
commit 06a55ade06

View File

@ -83,22 +83,9 @@ impl BlocksContext {
let mut info = sbot_client.get_profile_info(&key).await?;
// insert the public key of the peer into the info hashmap
info.insert("id".to_string(), key.to_string());
// retrieve the profile image blob id for the given peer
if let Some(blob_id) = info.get("image") {
// look-up the path for the image blob
if let Ok(blob_path) = blobs::get_blob_path(&blob_id) {
// insert the image blob path of the peer into the info hashmap
info.insert("blob_path".to_string(), blob_path.to_string());
// check if the blob is in the blobstore
// set a flag in the info hashmap
match utils::blob_is_stored_locally(&blob_path).await {
Ok(exists) if exists == true => {
info.insert("blob_exists".to_string(), "true".to_string())
}
_ => info.insert("blob_exists".to_string(), "false".to_string()),
};
}
}
// we do not even attempt to find the blob for a blocked peer,
// since it may be vulgar to cause distress to the local peer.
info.insert("blob_exists".to_string(), "false".to_string());
// push profile info to peer_list vec
peer_info.push(info)
}