Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDownloadPath ¶ added in v0.14.6
func GenerateDownloadPath(basePath, fileName string, overwrite bool) (filePath, manifestPath string)
GenerateDownloadPath creates a file path that doesn't currently exist on the filesystem
Types ¶
type Functionality ¶
type Functionality struct { }
Functionality groups some common UI triggered functions for contacts...
func FunctionalityGate ¶
func FunctionalityGate(experimentMap map[string]bool) (*Functionality, error)
FunctionalityGate returns filesharing if enabled in the given experiment map Note: Experiment maps are currently in libcwtch-go
func PreviewFunctionalityGate ¶ added in v0.14.6
func PreviewFunctionalityGate(experimentMap map[string]bool) (*Functionality, error)
PreviewFunctionalityGate returns filesharing if image previews are enabled
func (*Functionality) DownloadFile ¶
func (f *Functionality) DownloadFile(profile peer.CwtchPeer, conversationID int, downloadFilePath string, manifestFilePath string, key string, limit uint64)
DownloadFile given a profile, a conversation handle and a file sharing key, start off a download process to downloadFilePath
type OverlayMessage ¶
type OverlayMessage struct { Name string `json:"f"` Hash string `json:"h"` Nonce string `json:"n"` Size uint64 `json:"s"` }
OverlayMessage presents the canonical format of the File Sharing functionality Overlay Message This is the format that the UI will parse to display the message
func (*OverlayMessage) FileKey ¶ added in v0.14.6
func (om *OverlayMessage) FileKey() string
FileKey is the unique reference to a file offer
func (*OverlayMessage) ShouldAutoDL ¶ added in v0.14.6
func (om *OverlayMessage) ShouldAutoDL() bool
ShouldAutoDL checks file size and file name. *DOES NOT* check user settings or contact state