aboutsummaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2024-10-14 07:54:41 +0000
committerr <r@freesoftwareextremist.com>2024-10-14 07:54:41 +0000
commite5bf3159b8e485c108de0e4b1051ba6b66c16099 (patch)
tree858e645fb47e241c2b4737df31703adeafa09dbf /service
parent14d5eaf6e9aa3c74049a54a3ef95e71158fd4942 (diff)
downloadbloat-e5bf3159b8e485c108de0e4b1051ba6b66c16099.tar.gz
bloat-e5bf3159b8e485c108de0e4b1051ba6b66c16099.zip
Add support for quote reply
Diffstat (limited to 'service')
-rw-r--r--service/service.go9
-rw-r--r--service/transport.go3
2 files changed, 10 insertions, 2 deletions
diff --git a/service/service.go b/service/service.go
index d88273f..2275dfb 100644
--- a/service/service.go
+++ b/service/service.go
@@ -922,7 +922,7 @@ func (s *service) Signout(c *client) (err error) {
}
func (s *service) Post(c *client, content string, replyToID string,
- format string, visibility string, isNSFW bool,
+ format string, visibility string, isNSFW bool, isQuote bool,
files []*multipart.FileHeader) (id string, err error) {
var mediaIDs []string
@@ -934,9 +934,16 @@ func (s *service) Post(c *client, content string, replyToID string,
mediaIDs = append(mediaIDs, a.ID)
}
+ var quoteID string
+ if isQuote {
+ quoteID = replyToID
+ replyToID = ""
+ }
+
tweet := &mastodon.Toot{
Status: content,
InReplyToID: replyToID,
+ QuoteID: quoteID,
MediaIDs: mediaIDs,
ContentType: format,
Visibility: visibility,
diff --git a/service/transport.go b/service/transport.go
index 1b1a10e..e0372bd 100644
--- a/service/transport.go
+++ b/service/transport.go
@@ -307,10 +307,11 @@ func NewHandler(s *service, verbose bool, staticDir string) http.Handler {
format := c.r.FormValue("format")
visibility := c.r.FormValue("visibility")
isNSFW := c.r.FormValue("is_nsfw") == "true"
+ isQuote := c.r.FormValue("is_quote") == "true"
quickReply := c.r.FormValue("quickreply") == "true"
files := c.r.MultipartForm.File["attachments"]
- id, err := s.Post(c, content, replyToID, format, visibility, isNSFW, files)
+ id, err := s.Post(c, content, replyToID, format, visibility, isNSFW, isQuote, files)
if err != nil {
return err
}