Add unread and don'r show read
This commit is contained in:
parent
4a6fb2cb07
commit
49598a2af1
|
@ -157,6 +157,8 @@ func (b *memoryBackend) feedItems(fetchURL, contentType string, body io.Reader)
|
|||
item.URL = feedItem.Link
|
||||
item.Id = hex.EncodeToString([]byte(feedItem.ID))
|
||||
item.Published = feedItem.Date.Format(time.RFC822Z)
|
||||
log.Println(item)
|
||||
log.Println(feedItem)
|
||||
items = append(items, item)
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -305,6 +305,9 @@ func (b *memoryBackend) TimelineGet(after, before, channel string) microsub.Time
|
|||
item := microsub.Item{}
|
||||
json.Unmarshal(obj, &item)
|
||||
item.Read = b.checkRead(channel, item.Id)
|
||||
if item.Read {
|
||||
continue
|
||||
}
|
||||
items = append(items, item)
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,9 @@ package microsub
|
|||
// Channel contains information about a channel.
|
||||
type Channel struct {
|
||||
// UID is a unique id for the channel
|
||||
UID string `json:"uid"`
|
||||
Name string `json:"name"`
|
||||
UID string `json:"uid"`
|
||||
Name string `json:"name"`
|
||||
Unread int `json:"unread"`
|
||||
}
|
||||
|
||||
type Author struct {
|
||||
|
|
Loading…
Reference in New Issue
Block a user