Re-enable CreateFeed for WebSub
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3a43844e93
commit
21c226ce56
|
@ -66,6 +66,7 @@ func (h *hubIncomingBackend) GetSecret(id int64) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *hubIncomingBackend) CreateFeed(topic string) (int64, error) {
|
func (h *hubIncomingBackend) CreateFeed(topic string) (int64, error) {
|
||||||
|
log.Println("CreateFeed", topic)
|
||||||
db := h.backend.database
|
db := h.backend.database
|
||||||
|
|
||||||
secret := util.RandStringBytes(32)
|
secret := util.RandStringBytes(32)
|
||||||
|
@ -112,6 +113,8 @@ VALUES ($1, $2, $3, $4, DEFAULT) RETURNING "id"`, topic, secret, urlSecret, 60*6
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *hubIncomingBackend) UpdateFeed(subscriptionID int64, contentType string, body io.Reader) error {
|
func (h *hubIncomingBackend) UpdateFeed(subscriptionID int64, contentType string, body io.Reader) error {
|
||||||
|
log.Println("UpdateFeed", subscriptionID)
|
||||||
|
|
||||||
db := h.backend.database
|
db := h.backend.database
|
||||||
var (
|
var (
|
||||||
topic string
|
topic string
|
||||||
|
@ -186,6 +189,7 @@ func (h *hubIncomingBackend) Feeds() ([]Feed, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *hubIncomingBackend) Subscribe(feed *Feed) error {
|
func (h *hubIncomingBackend) Subscribe(feed *Feed) error {
|
||||||
|
log.Println("Subscribe", feed.URL)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
return websub.Subscribe(&client, feed.Hub, feed.URL, feed.Callback, feed.Secret, LeaseSeconds)
|
return websub.Subscribe(&client, feed.Hub, feed.URL, feed.Callback, feed.Secret, LeaseSeconds)
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,8 +341,7 @@ func (b *memoryBackend) FollowURL(uid string, url string) (microsub.Feed, error)
|
||||||
|
|
||||||
_ = b.ProcessContent(uid, fmt.Sprintf("%d", feedID), feed.URL, resp.Header.Get("Content-Type"), resp.Body)
|
_ = b.ProcessContent(uid, fmt.Sprintf("%d", feedID), feed.URL, resp.Header.Get("Content-Type"), resp.Body)
|
||||||
|
|
||||||
// FIXME: re-enable CreateFeed
|
_, _ = b.CreateFeed(url)
|
||||||
// _, _ = b.CreateFeed(url, uid)
|
|
||||||
|
|
||||||
return feed, nil
|
return feed, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user