Use channel adder with matchers

This commit is contained in:
Peter Stuifzand 2018-07-16 22:38:21 +02:00
parent aa22931786
commit 09d2a72b33
2 changed files with 2 additions and 2 deletions

View File

@ -353,7 +353,7 @@ func (b *memoryBackend) ProcessContent(channel, fetchURL, contentType string, bo
for _, item := range items {
item.Read = false
err = b.channelAddItem(conn, channel, item)
err = b.channelAddItemWithMatcher(conn, channel, item)
if err != nil {
log.Printf("ERROR: %s\n", err)
}

View File

@ -92,7 +92,7 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
item.Read = false
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))))
h.Backend.channelAddItem(conn, channel, item)
h.Backend.channelAddItemWithMatcher(conn, channel, item)
err = h.Backend.updateChannelUnreadCount(conn, channel)
if err != nil {
log.Printf("error: while updating channel unread count for %s: %s\n", channel, err)