Command breakouts for join and upload

This commit is contained in:
Gregory Rudolph
2019-10-03 07:58:01 -04:00
parent 1ee036405f
commit 7ea350789e

10
main.go
View File

@ -124,15 +124,7 @@ func formatOutput(api keybase.ChatAPI) string {
}
return ret
}
func uploadFile(g *gocui.Gui, filePath string, fileName string) {
chat := k.NewChat(channel)
_, err := chat.Upload(fileName, filePath)
if err != nil {
printToView(g, "Feed", fmt.Sprintf("There was an error uploading %s to %s", filePath, channel.Name))
} else {
printToView(g, "Feed", fmt.Sprintf("Uploaded %s to %s", filePath, channel.Name))
}
}
func downloadFile(g *gocui.Gui, messageID int, fileName string) {
chat := k.NewChat(channel)
_, err := chat.Download(messageID, fmt.Sprintf("%s/%s", downloadPath, fileName))