Skip to content

Commit

Permalink
forge-topic-mark-read: Only perform the appropriate status change
Browse files Browse the repository at this point in the history
There are three statuses "unread", "pending" and "done".  The only
status change that makes sense when performing "mark as read" is to
change from "unread" to "pending".  "pending" and "done" topics are
already not-"unread", and the distinction between the two should not
be lost just because the user decides to look at the topic.

This function was accidentally not adjusted when we migrated to three
separate statuses, likely due to a rebase accident.
  • Loading branch information
tarsius committed Feb 10, 2024
1 parent 2fc14c6 commit 28a55a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ depends on option `forge-colorful-topic-summaries'."
t))

(cl-defmethod forge-topic-mark-read ((topic forge-topic))
(oset topic status 'done))
(when (eq (oref topic status) 'unread)
(oset topic status 'pending)))

(cl-defmethod forge--set-topic-marks ((_repo forge-repository) topic marks)
(oset topic marks marks)
Expand Down

0 comments on commit 28a55a7

Please sign in to comment.