mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-18 11:17:49 +01:00
* added upload status * added changes for progress bar with more logs and bug fixes, Documentation yet to be added * huge changes that need more doucmenting * added possibility to get profile using NodeID * added fix profile listing user profile information * removed profile image from the explore reult struct * saving current changes * added filter to search based on NodeID * Monday bug fixing * updates to the profile * changes for tracing the blockchain profile image not shown * added condition to ensure TAG is not sent and removed debug prints * updated webapi docs
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
/*
|
|
File Username: Profile Data.go
|
|
Copyright: 2021 Peernet s.r.o.
|
|
Author: Peter Kleissner
|
|
*/
|
|
|
|
package blockchain
|
|
|
|
// List of recognized profile fields.
|
|
const (
|
|
ProfileName = 0 // Arbitrary username
|
|
ProfileEmail = 1 // Email address
|
|
ProfileWebsite = 2 // Website address
|
|
ProfileTwitter = 3 // Twitter account without the @
|
|
ProfileYouTube = 4 // YouTube channel URL
|
|
ProfileAddress = 5 // Physical address
|
|
ProfilePicture = 6 // Profile picture, blob
|
|
)
|
|
|
|
// The encoding of profile fields depends on the field. Text data is always UTF-8 text encoded.
|
|
// Note that all profile data is arbitrary and shall be considered untrusted and unverified.
|
|
// To establish trust, the user must load Certificates into the blockchain that validate certain data.
|
|
|
|
// Text returns the profile field as text encoded
|
|
func (info *BlockRecordProfile) Text() string {
|
|
return string(info.Data)
|
|
}
|
|
|
|
// ProfileFieldFromText returns a profile field from text
|
|
func ProfileFieldFromText(Type uint16, Text string) BlockRecordProfile {
|
|
return BlockRecordProfile{Type: Type, Data: []byte(Text)}
|
|
}
|