aboutsummaryrefslogtreecommitdiff
path: root/sx-inbox.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-12-21 10:31:16 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-12-22 10:46:41 -0200
commit9de79b2fe4c077f148f1f1ff7e16c3cf961cae8a (patch)
tree8093b557347a4344d37220eb2f12316fd7158036 /sx-inbox.el
parentd24a8b00341e207712ad0741b798491b378fe2c6 (diff)
Generalize sx-inbox-get
Diffstat (limited to 'sx-inbox.el')
-rw-r--r--sx-inbox.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/sx-inbox.el b/sx-inbox.el
index 5fb3652..3bc95c8 100644
--- a/sx-inbox.el
+++ b/sx-inbox.el
@@ -47,16 +47,19 @@
site.related_sites))
"Filter used when retrieving inbox items.")
-(defun sx-inbox-get (&optional page keywords)
+(defun sx-inbox-get (&optional notifications page keywords)
"Get an array of inbox items for the current user.
-Return an list of items. Each item is an alist of properties
+If NOTIFICATIONS is non-nil, query from `notifications' method,
+otherwise use `inbox' method.
+
+Return an array of items. Each item is an alist of properties
returned by the API.
See https://api.stackexchange.com/docs/types/inbox-item
KEYWORDS are added to the method call along with PAGE.
`sx-method-call' is used with `sx-inbox-filter'."
- (sx-method-call 'inbox
+ (sx-method-call (if notifications 'notifications 'inbox)
:keywords keywords
:filter sx-inbox-filter))