Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Properly handle message status (read/unread, new, flagged) #6

Open
paul-issartel opened this issue Apr 24, 2016 · 1 comment
Open

Comments

@paul-issartel
Copy link
Owner

Currently message status (such as read/unread) is not properly tracked between sessions. Gnus does track this status by recording article IDs in newsrc.eld, but in nnreddit these IDs are dynamically generated from a counter and this counter is reset to 0 on a new Emacs session. Thus the mapping between Reddit articles and Gnus articles quickly becomes incorrect.

Another issue with message status is that comment articles are generated as "ancient", which is likely because their generated IDs fall outside the initial "active" range of the nnreddit group.

To solve problems with message status, the generated article IDs should thus increase monotonically between sessions, and the mapping between generated IDs and Reddit IDs should be saved somewhere to disk. Comments should not be generated as "ancient", or if they must, they should be immediately reverted to "new", "unread" or "read" according to the mapping above.

@spiderbit
Copy link

hmm I just looked at that problem or tried to go into the source.

I want to start with something "small" which in reality is probably not to small :D just that I can see in the main emacs window the unread messages.

I think one problem is that it shows not the amount of unread comments but only of the unread posts in the overview and I am not even sure it updates that correctly that it shows 1 if a new post is there or if its marked as read automatically for some reason.

(40 (:id "7p8plm" :title "nEXT Browser: GTK Linux Alpha" :author "jmercouris" :date (23124 65071 0 0) :text "<p>nEXT Browser: GTK Linux Alpha</p>\n<a href=\"https://next-browser.github.io\">https://next-browser.github.io</a>" :score 34 :num_comments 8))

lets take that for a example thats some debug output from the request-group method. So the Id is
7p8plm?

What I find odd are 3 things even if you ignore comments for 1 second:

  1. it seems the number only correspond to unread news not comments
  2. I think it doesn't register new posts as new unread items, might be wrong about that but I am pretty sure
  3. the general gnus-group-get-new-news doesn't refresh the number of the signed reddit groups, it shows not 0 but *.

That all (at least point 2 and 3) should be solvable pretty easy even without changing comment ids, right?

To the comments Part:
I don't really understand when this code in nnreddit-request-group gets executed:

  (cond
         ((arrayp json-data)
          ;; The requested group is actually a Reddit thread

so it gets not executed in the overview but also if I enter the group and have the curser on a nnreddit post/thread and press "M-g" it does not trigger under that condition.

So what do you have to do to get this code triggered :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants