You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// +build !rm_basic_commands allcommands postcmd
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"samhofi.us/x/keybase"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
command := Command{
|
|
|
|
Cmd: []string{"post"},
|
|
|
|
Description: "- Post public messages on your wall",
|
|
|
|
Help: "",
|
|
|
|
Exec: cmdPost,
|
|
|
|
}
|
|
|
|
|
|
|
|
RegisterCommand(command)
|
|
|
|
}
|
|
|
|
func cmdPost(cmd []string) {
|
|
|
|
var pubChan keybase.Channel
|
|
|
|
pubChan.Public = true
|
|
|
|
pubChan.MembersType = keybase.USER
|
|
|
|
pubChan.Name = k.Username
|
|
|
|
post := strings.Join(cmd[1:], " ")
|
|
|
|
chat := k.NewChat(pubChan)
|
|
|
|
_, err := chat.Send(post)
|
|
|
|
if err != nil {
|
|
|
|
printToView("Feed", fmt.Sprintf("There was an error with your post: %+v", err))
|
|
|
|
} else {
|
|
|
|
printToView("Feed", "You have publically posted to your wall, signed by your current device.")
|
|
|
|
}
|
|
|
|
}
|