From 7f7369f882f44f7223cdc43d128a559c8e5003de Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 25 Sep 2019 16:57:28 -0400 Subject: [PATCH] Func to download file, not implemented --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index bb26430..e573a8e 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,11 @@ import ( "samhofi.us/x/keybase" ) +// Configurable section +var downloadPath = "/tmp/" + +// End configurable section + var k = keybase.NewKeybase() var channel keybase.Channel var channels [] keybase.Channel @@ -78,6 +83,11 @@ func sendChat(message string) { func uploadFile(g *gocui.Gui, fileName string, fileTitle string) { chat := k.NewChat(channel) chat.Upload(fileTitle, fileName) + printToView(g, "Feed", fmt.Sprintf("You have uploaded %s to %s", fileName, channel.Name)) +} +func downloadFile(g *gocui.Gui, messageID int, fileName string) { + chat := k.NewChat(channel) + chat.Download(messageID, fmt.Sprintf("%s/%s", downloadPath, fileName)) } func populateList(g *gocui.Gui) {