Add users blockchain data to the search index and provide it in search results. Updated webapi search and download.

This commit is contained in:
Kleissner
2021-12-14 15:45:03 +01:00
parent da0a6357de
commit c053c617c2
6 changed files with 103 additions and 5 deletions

View File

@@ -54,7 +54,10 @@ resultLoop:
}
}
if peer := core.NodelistLookup(file.NodeID); peer != nil {
if bytes.Equal(file.NodeID, core.SelfNodeID()) {
// Indicates data from the current user.
file.Tags = append(file.Tags, blockchain.TagFromNumber(blockchain.TagSharedByCount, 1))
} else if peer := core.NodelistLookup(file.NodeID); peer != nil {
// add the tags 'Shared By Count' and 'Shared By GeoIP'
file.Tags = append(file.Tags, blockchain.TagFromNumber(blockchain.TagSharedByCount, 1))
if latitude, longitude, valid := api.Peer2GeoIP(peer); valid {