# HG changeset patch # User Mikael Berthe # Date 1536349656 -7200 # Node ID 747f108d582100b7d1bf41afe063451cbdef29b3 # Parent f5cd5562219469111d42a72c45ba27f4b7da6512 timeline: Allow "direct" timeline diff -r f5cd55622194 -r 747f108d5821 cmd/timelines.go --- a/cmd/timelines.go Fri Sep 07 19:18:30 2018 +0200 +++ b/cmd/timelines.go Fri Sep 07 21:47:36 2018 +0200 @@ -22,19 +22,22 @@ // timelineCmd represents the timelines command var timelineCmd = &cobra.Command{ - Use: "timeline [home|public|:HASHTAG|!list_id] [--local]", + Use: "timeline [home|public|direct|:HASHTAG|!list_id] [--local]", Aliases: []string{"tl"}, Short: "Fetch a timeline", Long: ` The timeline command fetches a timeline (home, local or federated). +The timeline "direct" contains only direct messages (that is, messages with +visibility set to "direct"). It can also get a hashtag-based timeline if the keyword or prefixed with ':' or '#', or a list-based timeline (use !ID with the list ID).`, Example: ` madonctl timeline madonctl timeline public --local madonctl timeline '!42' - madonctl timeline :mastodon`, + madonctl timeline :mastodon + madonctl timeline direct`, RunE: timelineRunE, - ValidArgs: []string{"home", "public"}, + ValidArgs: []string{"home", "public", "direct"}, } func init() { @@ -72,7 +75,7 @@ } // Home timeline and list-based timeline require to be logged in - if err := madonInit(tl == "home" || strings.HasPrefix(tl, "!")); err != nil { + if err := madonInit(tl == "home" || tl == "direct" || strings.HasPrefix(tl, "!")); err != nil { return err }