Browse Source

Merge branch 'YerinAlexey-quote-reply' into quote

pull/35/head
Rasmus Lindroth 5 years ago
parent
commit
412337ffdf
  1. 4
      config.example.ini
  2. 3
      config.go
  3. 10
      messagebox.go

4
config.example.ini

@ -49,6 +49,10 @@ timeline=home
# default=true
notification-feed=true
# If you want to quote original message when replying
# default=false
quote-reply=false
[media]
# Your image viewer
# default=xdg-open

3
config.go

@ -23,6 +23,7 @@ type GeneralConfig struct {
DateRelative int
StartTimeline TimelineType
NotificationFeed bool
QuoteReply bool
}
type StyleConfig struct {
@ -189,6 +190,8 @@ func parseGeneral(cfg *ini.File) GeneralConfig {
general.NotificationFeed = cfg.Section("general").Key("notification-feed").MustBool(true)
general.QuoteReply = cfg.Section("general").Key("quote-reply").MustBool(false)
return general
}

10
messagebox.go

@ -220,6 +220,16 @@ func (m *MessageBox) EditText() {
users = append(users, "@"+men.Acct)
}
t = strings.Join(users, " ")
if m.app.Config.General.QuoteReply {
tootText, _ := cleanTootHTML(s.Content)
t += "\n"
for _, line := range strings.Split(tootText, "\n") {
t += "> " + line + "\n"
}
t += "\n"
}
}
text, err := openEditor(m.app.UI.Root, t)
if err != nil {

Loading…
Cancel
Save