Use channel adder with matchers
This commit is contained in:
parent
aa22931786
commit
09d2a72b33
|
|
@ -353,7 +353,7 @@ func (b *memoryBackend) ProcessContent(channel, fetchURL, contentType string, bo
|
||||||
|
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
item.Read = false
|
item.Read = false
|
||||||
err = b.channelAddItem(conn, channel, item)
|
err = b.channelAddItemWithMatcher(conn, channel, item)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("ERROR: %s\n", err)
|
log.Printf("ERROR: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
item.Read = false
|
item.Read = false
|
||||||
id, _ := redis.Int(conn.Do("INCR", "source:"+sourceID+"next_id"))
|
id, _ := redis.Int(conn.Do("INCR", "source:"+sourceID+"next_id"))
|
||||||
item.ID = fmt.Sprintf("%x", sha1.Sum([]byte(fmt.Sprintf("source:%s:%d", sourceID, id))))
|
item.ID = fmt.Sprintf("%x", sha1.Sum([]byte(fmt.Sprintf("source:%s:%d", sourceID, id))))
|
||||||
h.Backend.channelAddItem(conn, channel, item)
|
h.Backend.channelAddItemWithMatcher(conn, channel, item)
|
||||||
err = h.Backend.updateChannelUnreadCount(conn, channel)
|
err = h.Backend.updateChannelUnreadCount(conn, channel)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error: while updating channel unread count for %s: %s\n", channel, err)
|
log.Printf("error: while updating channel unread count for %s: %s\n", channel, err)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user