aboutsummaryrefslogtreecommitdiff
path: root/service/transport.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-14 18:12:48 +0000
committerr <r@freesoftwareextremist.com>2019-12-14 18:12:48 +0000
commitea66bd539dec12ef2846c23e505593f9f9d9fac3 (patch)
tree17d40c5aaf44e87ea65e444e15e87e771ca947c0 /service/transport.go
parent787a197ad8cbce572152ee41b2a411b8d145285a (diff)
downloadbloat-ea66bd539dec12ef2846c23e505593f9f9d9fac3.tar.gz
bloat-ea66bd539dec12ef2846c23e505593f9f9d9fac3.zip
Focus relevant status on like, retweet and reply
Diffstat (limited to 'service/transport.go')
-rw-r--r--service/transport.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/service/transport.go b/service/transport.go
index 709a2ff..00f7430 100644
--- a/service/transport.go
+++ b/service/transport.go
@@ -108,7 +108,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
return
}
- w.Header().Add("Location", req.Header.Get("Referer"))
+ w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusSeeOther)
}).Methods(http.MethodGet)
@@ -121,7 +121,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
return
}
- w.Header().Add("Location", req.Header.Get("Referer"))
+ w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusSeeOther)
}).Methods(http.MethodGet)
@@ -134,7 +134,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
return
}
- w.Header().Add("Location", req.Header.Get("Referer"))
+ w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusSeeOther)
}).Methods(http.MethodGet)
@@ -147,7 +147,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
return
}
- w.Header().Add("Location", req.Header.Get("Referer"))
+ w.Header().Add("Location", req.Header.Get("Referer")+"#status-"+id)
w.WriteHeader(http.StatusSeeOther)
}).Methods(http.MethodGet)
@@ -155,15 +155,15 @@ func NewHandler(s Service, staticDir string) http.Handler {
ctx := getContextWithSession(context.Background(), req)
content := req.FormValue("content")
replyToID := req.FormValue("reply_to_id")
- err := s.PostTweet(ctx, w, nil, content, replyToID)
+ id, err := s.PostTweet(ctx, w, nil, content, replyToID)
if err != nil {
s.ServeErrorPage(ctx, w, err)
return
}
- location := "/timeline"
+ location := "/timeline" + "#status-" + id
if len(replyToID) > 0 {
- location = "/thread/" + replyToID
+ location = "/thread/" + replyToID + "#status-" + id
}
w.Header().Add("Location", location)
w.WriteHeader(http.StatusSeeOther)