Skip to content

Commit

Permalink
Private Gists Created Using Web UI Turn Public
Browse files Browse the repository at this point in the history
The possible values from the github gist API for public is false, true
or null.  json-read-from-string decodes these as true, json-false or
json-null.

We have been treating json-false as as truth value, which leads to this
mismatch.

This commit also fixes the issue where public gists created through this
package are setting the gist public attribute to null instead of false.

Fixes defunkt#45
  • Loading branch information
keelerm84 committed Sep 13, 2014
1 parent 1d2a86d commit 1c83425
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gist.el
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ they're posted.")
(defun gist-internal-new (files &optional private description callback)
(let* ((api (gist-get-api))
(gist (gh-gist-gist-stub "gist"
:public (not private)
:public (or (not private) json-false)
:description (or description "")
:files files))
(resp (gh-gist-new api gist)))
Expand Down Expand Up @@ -283,7 +283,7 @@ for the gist."
(let ((repo (oref gist :id))
(creation (gist--get-time gist))
(desc (or (oref gist :description) ""))
(public (oref gist :public)))
(public (eq t (oref gist :public))))
(loop for (id label width sort format) in gist-list-format
collect (let ((string-formatter (if (eq id 'created)
'format-time-string
Expand Down

0 comments on commit 1c83425

Please sign in to comment.