mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 08:47:24 +00:00
Func to download file, not implemented
This commit is contained in:
10
main.go
10
main.go
@ -10,6 +10,11 @@ import (
|
|||||||
"samhofi.us/x/keybase"
|
"samhofi.us/x/keybase"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Configurable section
|
||||||
|
var downloadPath = "/tmp/"
|
||||||
|
|
||||||
|
// End configurable section
|
||||||
|
|
||||||
var k = keybase.NewKeybase()
|
var k = keybase.NewKeybase()
|
||||||
var channel keybase.Channel
|
var channel keybase.Channel
|
||||||
var channels [] keybase.Channel
|
var channels [] keybase.Channel
|
||||||
@ -78,6 +83,11 @@ func sendChat(message string) {
|
|||||||
func uploadFile(g *gocui.Gui, fileName string, fileTitle string) {
|
func uploadFile(g *gocui.Gui, fileName string, fileTitle string) {
|
||||||
chat := k.NewChat(channel)
|
chat := k.NewChat(channel)
|
||||||
chat.Upload(fileTitle, fileName)
|
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) {
|
func populateList(g *gocui.Gui) {
|
||||||
|
|||||||
Reference in New Issue
Block a user