Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,26 @@ constructor(
) {
val accountId = accountService.getCurrentAccountId()
val googleReaderAPI = getGoogleReaderAPI()

// The server can have unread items we don't have locally yet. Marking by ID
// misses those, and the next sync flips them back to unread. Mark the whole
// stream on the server instead using markAllAsRead.
if (!isUnread && articleId == null) {
val streamTag =
when {
groupId != null ->
GoogleReaderAPI.Stream.Category(groupId.dollarLast()).tag
feedId != null -> GoogleReaderAPI.Stream.Feed(feedId.dollarLast()).tag
else -> GoogleReaderAPI.Stream.AllItems.tag
}
super.markAsRead(groupId, feedId, articleId, before, isUnread)
googleReaderAPI.markAllAsRead(
streamId = streamTag,
sinceTimestamp = before?.time?.times(1000L),
)
return
}

val markList: List<String> =
when {
groupId != null -> {
Expand Down
Loading