profiles

package
v1.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROFILE_PATH            = "/v1/profile/%s"
	PROFILE_CREDENTIAL_PATH = "/v1/profile/%s/%s/%s"
	PROFILE_USERNAME_PATH   = "/v1/profile/username/%s"

	NAME_PADDED_LENGTH = 53
)
View Source
const NONCE_LEN = 12

Variables

This section is empty.

Functions

func GenerateProfileKey

func GenerateProfileKey() []byte

GenerateProfileKey generates a new ProfileKey

func GetLocalAvatar

func GetLocalAvatar(uuid string) (io.ReadCloser, error)

func GetLocalAvatarPath

func GetLocalAvatarPath(uuid string) (string, error)

func GetProfileE164

func GetProfileE164(tel string) (contacts.Contact, error)

GetProfileE164 get a profile by a phone number

func GetRemoteAvatar

func GetRemoteAvatar(avatarURL string) (io.ReadCloser, error)

GetAvatar returns an avatar for it's url from signal cdn

func SaveAvatar

func SaveAvatar(uuid string, avatar []byte) error

func UpdateProfile

func UpdateProfile(profileKey []byte, uuid, name string) error

UpdateProfile ...

Types

type Badge

type Badge struct {
	Id          string     `json:"id"`
	Category    string     `json:"category"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Sprites6    []string   `json:"sprites6"`
	Svg         string     `json:"svg"`
	Svgs        []BadgeSvg `json:"svgs"`
}

type BadgeSvg

type BadgeSvg struct {
	Light string `json:"light"`
	Dark  string `json:"dark"`
}

type Profile

type Profile struct {
	IdentityKey                    string                     `json:"identityKey"`
	UnidentifiedAccess             string                     `json:"unidentifiedAccess"`
	UnrestrictedUnidentifiedAccess bool                       `json:"unrestrictedUnidentifiedAccess"`
	Capabilities                   config.AccountCapabilities `json:"capabilities"`
	//Badges                         []string                   `json:"badges"`
	UUID           string `json:"uuid"`
	Name           string `json:"name"`
	About          string `json:"about"`
	AboutEmoji     string `json:"aboutEmoji"`
	Avatar         string `json:"avatar"`
	PaymentAddress string `json:"paymentAddress"`
	Credential     []byte `json:"credential"`
}

Profile describes the profile type

func GetProfile

func GetProfile(UUID string, profileKey []byte) (*Profile, error)

func GetProfileAndCredential

func GetProfileAndCredential(UUID string, profileKey []byte) (*Profile, error)

func GetProfileUUID

func GetProfileUUID(uuid string) (*Profile, error)

GetProfileUUID get a profile by a phone number

type ProfileSettings

type ProfileSettings struct {
	Version    string `json:"version"`
	Name       []byte `json:"name"`
	About      []byte `json:"about"`
	AboutEmoji []byte `json:"aboutEmoji"`

	Avatar     bool     `json:"avatar"`
	Commitment []byte   `json:"commitment"`
	BadgeIds   []string `json:"badgeIds"`
	// contains filtered or unexported fields
}

Profile ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL