summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-09-22 21:34:35 +0200
committerGravatar Tom Willemse2014-09-22 21:34:35 +0200
commit86f495e11714905a72fad6b25f1f8b9ae7370d50 (patch)
tree4942a3a42a2416a8eefdf31db4be24502f47edda
parent3dad71a9b73be0248bd2877b36df188bbd7c0cd1 (diff)
downloaddotfiles-86f495e11714905a72fad6b25f1f8b9ae7370d50.tar.gz
dotfiles-86f495e11714905a72fad6b25f1f8b9ae7370d50.zip
Update pivot.el
-rw-r--r--emacs/.emacs.d/site-lisp/pivot.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/emacs/.emacs.d/site-lisp/pivot.el b/emacs/.emacs.d/site-lisp/pivot.el
index b184a88..336021f4 100644
--- a/emacs/.emacs.d/site-lisp/pivot.el
+++ b/emacs/.emacs.d/site-lisp/pivot.el
@@ -24,6 +24,7 @@
;;; Code:
+(require 'json)
(require 'url)
(defgroup pivotel nil
@@ -98,15 +99,19 @@ Does not need a final `/'.")
"Get all stories for the current user."
(let ((project-ids (mapcar (lambda (itm) (cdr (assoc 'id itm)))
(pivotel-get-projects))))
- (mapcar #'pivotel-get-stories project-ids)))
+ (apply #'append
+ (append (mapcar #'pivotel-get-stories project-ids) '(nil)))))
+
+(defun pivotel--my-story-p (story)
+ "Check whether or not STORY belongs to the current user."
+ (memql (pivotel-get-me-id)
+ (append (cdr (assoc 'owner_ids story)) '(nil))))
(defun pivotel-get-my-owned-stories ()
"Get the stories for which the user is an owner."
- (let ((stories (pivotel-get-all-stories))
- (id (pivotel-get-me-id)))
+ (let ((stories (pivotel-get-all-stories)))
(delq nil
- (mapcar (lambda (itm)
- (when (= (cdr (assoc 'owned_by_id itm)) id) itm))
+ (mapcar (lambda (itm) (when (pivotel--my-story-p itm) itm))
stories))))
(provide 'pivot)