profiles

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROFILE_PATH       = "/v1/profile/%s"
	NAME_PADDED_LENGTH = 53
)

Variables

This section is empty.

Functions

func GenerateProfileKey

func GenerateProfileKey() []byte

GenerateProfileKey generates a new ProfileKey

func GetAvatar

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

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

func GetProfile

func GetProfile(UUID string, profileKey []byte)

func GetProfileE164

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

GetProfileE164 get a profile by a phone number

func UpdateProfile

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

UpdateProfile ...

Types

type Profile

type Profile struct {
	IdentityKey                    string          `json:"identityKey"`
	Name                           string          `json:"name"`
	Avatar                         string          `json:"avatar"`
	UnidentifiedAccess             string          `json:"uak"`
	UnrestrictedUnidentifiedAccess bool            `json:"uua"`
	Capabilities                   ProfileSettings `json:"capabilities"`
	Username                       string          `json:"username"`
	UUID                           string          `json:"uuid"`
}

Profile describes the profile type

type ProfileSettings

type ProfileSettings struct {
	Version    string `json:"version"`
	Name       []byte `json:"name"`
	Avatar     bool   `json:"avatar"`
	Commitment []byte `json:"commitment"`
}

Profile ...

Jump to

Keyboard shortcuts

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