magit/ghub

Question: simple method to get notifications

Closed this issue · 7 comments

Hi, I am wondering if there is a simple method to get notifications via ghub. Can you please give an example or snippet?

I am using ghub+ currently, but i'd like remove this dependency since I've switched from magithub to forge.

(ignore-errors
  (ghubp-get-notifications :participating "true"))

Just using ghub would be (ghub-get "/notifications" :query '((notifications . "true"))). Forge has its own utility functions (functions starting as forge--ghub-) but I think those require special data structures.

Thanks! But it should be (ghub-get "/notifications" '((notifications . "true")) :query), right?

Ah, sorry. I was giving that example without referring to the documentation. Both the forms (ghub-get "/notifications" '((notifications . "true"))) and (ghub-get "/notifications" nil :query '((notifications . "true"))) are equivalent, though the latter is more explicit.

Thanks for the update. I've updated my codes accordingly.

@vermiculus It seems the snippet doesn't work anymore :( Can you please take a look at this issue again? Thanks!

@seagle0128 What doesn't work about it? Is there an error? It still works for me if I've got a token with the notifications scope.

@vermiculus The snippet works a gain after I upgrading to Emacs 29.