diff options
author | r <r@freesoftwareextremist.com> | 2020-01-31 03:38:49 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-01-31 03:38:49 +0000 |
commit | a981085260af2623bd4988e4b9c0052e2e3035eb (patch) | |
tree | 8b1f2f35274a2e5fee77f2498f0b7569dca18b7e /service/transport.go | |
parent | 6a6cc744b7d9ed1b57dc2e88cd22e73275d5dcbe (diff) | |
download | bloat-a981085260af2623bd4988e4b9c0052e2e3035eb.tar.gz bloat-a981085260af2623bd4988e4b9c0052e2e3035eb.zip |
Update user page
- Use the same page to display status and user list
- Add media only status list
Diffstat (limited to 'service/transport.go')
-rw-r--r-- | service/transport.go | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/service/transport.go b/service/transport.go index b2fb4a8..d945e18 100644 --- a/service/transport.go +++ b/service/transport.go @@ -146,36 +146,6 @@ func NewHandler(s Service, staticDir string) http.Handler { } } - followingPage := func(w http.ResponseWriter, req *http.Request) { - c := newClient(w) - ctx := newCtxWithSesion(req) - id, _ := mux.Vars(req)["id"] - maxID := req.URL.Query().Get("max_id") - minID := req.URL.Query().Get("min_id") - - err := s.ServeFollowingPage(ctx, c, id, maxID, minID) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - s.ServeErrorPage(ctx, c, err) - return - } - } - - followersPage := func(w http.ResponseWriter, req *http.Request) { - c := newClient(w) - ctx := newCtxWithSesion(req) - id, _ := mux.Vars(req)["id"] - maxID := req.URL.Query().Get("max_id") - minID := req.URL.Query().Get("min_id") - - err := s.ServeFollowersPage(ctx, c, id, maxID, minID) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - s.ServeErrorPage(ctx, c, err) - return - } - } - notificationsPage := func(w http.ResponseWriter, req *http.Request) { c := newClient(w) ctx := newCtxWithSesion(req) @@ -194,10 +164,11 @@ func NewHandler(s Service, staticDir string) http.Handler { c := newClient(w) ctx := newCtxWithSesion(req) id, _ := mux.Vars(req)["id"] + pageType, _ := mux.Vars(req)["type"] maxID := req.URL.Query().Get("max_id") minID := req.URL.Query().Get("min_id") - err := s.ServeUserPage(ctx, c, id, maxID, minID) + err := s.ServeUserPage(ctx, c, id, pageType, maxID, minID) if err != nil { w.WriteHeader(http.StatusInternalServerError) s.ServeErrorPage(ctx, c, err) @@ -600,10 +571,9 @@ func NewHandler(s Service, staticDir string) http.Handler { r.HandleFunc("/thread/{id}", threadPage).Methods(http.MethodGet) r.HandleFunc("/likedby/{id}", likedByPage).Methods(http.MethodGet) r.HandleFunc("/retweetedby/{id}", retweetedByPage).Methods(http.MethodGet) - r.HandleFunc("/following/{id}", followingPage).Methods(http.MethodGet) - r.HandleFunc("/followers/{id}", followersPage).Methods(http.MethodGet) r.HandleFunc("/notifications", notificationsPage).Methods(http.MethodGet) r.HandleFunc("/user/{id}", userPage).Methods(http.MethodGet) + r.HandleFunc("/user/{id}/{type}", userPage).Methods(http.MethodGet) r.HandleFunc("/usersearch/{id}", userSearchPage).Methods(http.MethodGet) r.HandleFunc("/about", aboutPage).Methods(http.MethodGet) r.HandleFunc("/emojis", emojisPage).Methods(http.MethodGet) |