diff --git a/cmd/mstdn/cmd_stream.go b/cmd/mstdn/cmd_stream.go index 1ba9a6c..1b83d1a 100644 --- a/cmd/mstdn/cmd_stream.go +++ b/cmd/mstdn/cmd_stream.go @@ -13,6 +13,7 @@ import ( ) type SimpleJSON struct { + ID int64 `json:"id"` Username string `json:"username"` Avatar string `json:"avatar"` Content string `json:"content"` @@ -41,6 +42,7 @@ func cmdStream(c *cli.Context) error { } else if asSimpleJSON { if t, ok := e.(*mastodon.UpdateEvent); ok { json.NewEncoder(c.App.Writer).Encode(&SimpleJSON{ + ID: t.Status.ID, Username: t.Status.Account.Username, Avatar: t.Status.Account.AvatarStatic, Content: textContent(t.Status.Content), diff --git a/cmd/mstdn/cmd_toot.go b/cmd/mstdn/cmd_toot.go index 9a82534..1889006 100644 --- a/cmd/mstdn/cmd_toot.go +++ b/cmd/mstdn/cmd_toot.go @@ -26,7 +26,8 @@ func cmdToot(c *cli.Context) error { } client := c.App.Metadata["client"].(*mastodon.Client) _, err := client.PostStatus(context.Background(), &mastodon.Toot{ - Status: toot, + Status: toot, + InReplyToID: c.Int64("i"), }) return err } diff --git a/cmd/mstdn/main.go b/cmd/mstdn/main.go index 7030370..a5656c8 100644 --- a/cmd/mstdn/main.go +++ b/cmd/mstdn/main.go @@ -174,6 +174,11 @@ func makeApp() *cli.App { Usage: "post utf-8 string from a file(\"-\" means STDIN)", Value: "", }, + cli.IntFlag{ + Name: "i", + Usage: "in-reply-to", + Value: 0, + }, }, Action: cmdToot, },