Partially selectable reblogs visibility (fluoride required fix)

This commit is contained in:
localhost_frssoft 2022-12-02 04:45:19 +03:00
parent a678b620a1
commit 8c41878b6d
5 changed files with 36 additions and 8 deletions

View file

@ -1052,8 +1052,8 @@ func (s *service) UnReact(c *client, id string, emoji string) (count int64, err
return
}
func (s *service) Retweet(c *client, id string) (count int64, err error) {
st, err := c.Reblog(c.ctx, id)
func (s *service) Retweet(c *client, id string, visibility string) (count int64, err error) {
st, err := c.Reblog(c.ctx, id, visibility)
if err != nil {
return
}

View file

@ -381,7 +381,8 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
retweet := handle(func(c *client) error {
id, _ := mux.Vars(c.r)["id"]
rid := c.r.FormValue("retweeted_by_id")
_, err := s.Retweet(c, id)
visibility := c.r.FormValue("retweet_visibility")
_, err := s.Retweet(c, id, visibility)
if err != nil {
return err
}
@ -773,7 +774,8 @@ func NewHandler(s *service, logger *log.Logger, staticDir string) http.Handler {
fRetweet := handle(func(c *client) error {
id, _ := mux.Vars(c.r)["id"]
count, err := s.Retweet(c, id)
visibility := c.r.FormValue("retweet_visibility")
count, err := s.Retweet(c, id, visibility)
if err != nil {
return err
}