Compare commits

..

No commits in common. "3addbb50de426f16695a9f16b7257938589b82b5" and "d4b51a6ad7f904c76b7455ac8dec6fa87b6353e4" have entirely different histories.

7 changed files with 18 additions and 19 deletions

View File

@ -25,7 +25,7 @@ import (
"regexp"
"time"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
)
// TokenResponse is the information that we get back from the token endpoint of the user...

View File

@ -33,7 +33,7 @@ import (
"p83.nl/go/ekster/pkg/util"
"github.com/alecthomas/template"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
"willnorris.com/go/microformats"
)

View File

@ -30,7 +30,7 @@ import (
"p83.nl/go/ekster/pkg/util"
"p83.nl/go/ekster/pkg/websub"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
)
// LeaseSeconds is the default number of seconds we want the subscription to last

View File

@ -27,8 +27,7 @@ import (
"time"
"cloud.google.com/go/profiler"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
"p83.nl/go/ekster/pkg/microsub"
)

View File

@ -36,7 +36,7 @@ import (
"p83.nl/go/ekster/pkg/fetch"
"p83.nl/go/ekster/pkg/microsub"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
"willnorris.com/go/microformats"
)
@ -511,8 +511,6 @@ func (b *memoryBackend) Search(query string) ([]microsub.Feed, error) {
log.Printf("Error while fetching %s: %v\n", u, err)
continue
}
defer resp.Body.Close()
fetchUrl, err := url.Parse(u)
md := microformats.Parse(resp.Body, fetchUrl)
if err != nil {
@ -569,7 +567,6 @@ func (b *memoryBackend) PreviewURL(previewURL string) (microsub.Timeline, error)
if err != nil {
return microsub.Timeline{}, fmt.Errorf("error while fetching %s: %v", previewURL, err)
}
defer resp.Body.Close()
items, err := fetch.FeedItems(&fetch2{}, previewURL, resp.Header.Get("content-type"), resp.Body)
if err != nil {
return microsub.Timeline{}, fmt.Errorf("error while fetching %s: %v", previewURL, err)

View File

@ -29,7 +29,7 @@ import (
"p83.nl/go/ekster/pkg/jf2"
"p83.nl/go/ekster/pkg/microsub"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
"willnorris.com/go/microformats"
)

View File

@ -26,7 +26,7 @@ import (
"p83.nl/go/ekster/pkg/microsub"
"github.com/gomodule/redigo/redis"
"github.com/garyburd/redigo/redis"
)
type microsubHandler struct {
@ -225,11 +225,18 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if method == "mark_read" || r.PostForm.Get("method") == "mark_read" {
values = r.Form
channel := values.Get("channel")
var markAsRead []string
if uids, e := values["entry"]; e {
markAsRead = uids
err := h.Backend.MarkRead(channel, uids)
if err != nil {
http.Error(w, err.Error(), 500)
return
}
} else if uids, e := values["entry[]"]; e {
markAsRead = uids
err := h.Backend.MarkRead(channel, uids)
if err != nil {
http.Error(w, err.Error(), 500)
return
}
} else {
uids := []string{}
for k, v := range values {
@ -237,11 +244,7 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
uids = append(uids, v...)
}
}
markAsRead = uids
}
if len(markAsRead) > 0 {
err := h.Backend.MarkRead(channel, markAsRead)
err := h.Backend.MarkRead(channel, uids)
if err != nil {
http.Error(w, err.Error(), 500)
return