From e63d08fe75cff6e4b713a477408203351cc14e57 Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Thu, 20 Nov 2014 13:18:44 -0500 Subject: Uses of `sx-method-call` have been updated to use new format. sx-question now includes 2 authentication requiring parameters, `question.upvoted` and `question.downvoted`. These will only be used if access token exists. sx-favorites still uses site-workaround pending #82. --- sx-networks.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sx-networks.el') diff --git a/sx-networks.el b/sx-networks.el index 755d62c..ff5a630 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -67,10 +67,11 @@ If cache is not available, retrieve current data." Sets cache and then uses `sx-network--get-associated' to update the variables." (sx-cache-set 'network-user - (sx-method-call "me/associated" - '((types . (main_site meta_site))) - sx-network--user-filter - 'warn)) + (sx-method-call 'me + :submethod 'associated + :keywords '((types . (main_site meta_site))) + :filter sx-network--user-filter + :auth 'warn)) (sx-network--get-associated)) (defun sx-network--initialize () -- cgit v1.2.3 From 81e662bb2572c69d0cdd42fddd9d09acf17f9027 Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Thu, 20 Nov 2014 13:48:00 -0500 Subject: Fix auth settings in calls. Do not use 'warn in non-interactive commands. --- sx-favorites.el | 2 +- sx-networks.el | 2 +- sx-question.el | 1 + sx-site.el | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sx-networks.el') diff --git a/sx-favorites.el b/sx-favorites.el index 55ebf49..f254137 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -58,7 +58,7 @@ Added as hook to initialization." (sx-method-call 'me :submethod (format "favorites?site=%s" site) :filter sx-favorite-list-filter - :auth 'warn)) + :auth t)) (defun sx-favorites--update-site-favorites (site) "Update list of starred QUESTION_IDs for SITE. diff --git a/sx-networks.el b/sx-networks.el index ff5a630..110f975 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -71,7 +71,7 @@ the variables." :submethod 'associated :keywords '((types . (main_site meta_site))) :filter sx-network--user-filter - :auth 'warn)) + :auth t)) (sx-network--get-associated)) (defun sx-network--initialize () diff --git a/sx-question.el b/sx-question.el index d040bad..75f786c 100644 --- a/sx-question.el +++ b/sx-question.el @@ -63,6 +63,7 @@ (let ((res (sx-method-call 'questions :id id :site site + :auth t :filter sx-question-browse-filter))) (if (vectorp res) (elt res 0) diff --git a/sx-site.el b/sx-site.el index 6928ea8..3966a9f 100644 --- a/sx-site.el +++ b/sx-site.el @@ -50,8 +50,7 @@ 'site-list '(sx-method-call 'sites :keywords '((pagesize . 999)) - :filter sx-site-browse-filter - :auth 'warn))) + :filter sx-site-browse-filter))) (defcustom sx-site-favorites nil -- cgit v1.2.3 From 1d4dd3d3171895e66ab16948d2320b22841f582e Mon Sep 17 00:00:00 2001 From: Jonathan Leech-Pepin Date: Fri, 21 Nov 2014 12:10:57 -0500 Subject: Fix indentation following indent declaration. --- sx-favorites.el | 6 +++--- sx-networks.el | 8 ++++---- sx-question.el | 16 ++++++++-------- sx-site.el | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'sx-networks.el') diff --git a/sx-favorites.el b/sx-favorites.el index c00d262..aaf2734 100644 --- a/sx-favorites.el +++ b/sx-favorites.el @@ -52,9 +52,9 @@ Added as hook to initialization." (defun sx-favorites--retrieve-favorites (site) "Obtain list of starred QUESTION_IDs for SITE." (sx-method-call 'me - :submethod (format "favorites?site=%s" site) - :filter sx-favorite-list-filter - :auth t)) + :submethod (format "favorites?site=%s" site) + :filter sx-favorite-list-filter + :auth t)) (defun sx-favorites--update-site-favorites (site) "Update list of starred QUESTION_IDs for SITE. diff --git a/sx-networks.el b/sx-networks.el index f5aa9f5..e4660af 100644 --- a/sx-networks.el +++ b/sx-networks.el @@ -64,10 +64,10 @@ Sets cache and then uses `sx-network--get-associated' to update the variables." (sx-cache-set 'network-user (sx-method-call 'me - :submethod 'associated - :keywords '((types . (main_site meta_site))) - :filter sx-network--user-filter - :auth t)) + :submethod 'associated + :keywords '((types . (main_site meta_site))) + :filter sx-network--user-filter + :auth t)) (sx-network--get-associated)) (defun sx-network--initialize () diff --git a/sx-question.el b/sx-question.el index c02cf62..c66d253 100644 --- a/sx-question.el +++ b/sx-question.el @@ -58,19 +58,19 @@ property. (mapcar (lambda (question) (cons (cons 'site site) question)) (sx-method-call 'questions - :keywords `((page . ,page)) - :site site - :auth t - :filter sx-question-browse-filter))) + :keywords `((page . ,page)) + :site site + :auth t + :filter sx-question-browse-filter))) (defun sx-question-get-question (site question-id) "Query SITE for a QUESTION-ID and return it. If QUESTION-ID doesn't exist on SITE, raise an error." (let ((res (sx-method-call 'questions - :id id - :site site - :auth t - :filter sx-question-browse-filter))) + :id id + :site site + :auth t + :filter sx-question-browse-filter))) (if (vectorp res) (elt res 0) (error "Couldn't find question %S in %S" diff --git a/sx-site.el b/sx-site.el index 065f113..04b5240 100644 --- a/sx-site.el +++ b/sx-site.el @@ -49,8 +49,8 @@ (sx-cache-get 'site-list '(sx-method-call 'sites - :keywords '((pagesize . 999)) - :filter sx-site-browse-filter))) + :keywords '((pagesize . 999)) + :filter sx-site-browse-filter))) (defcustom sx-site-favorites nil -- cgit v1.2.3