Skip to content

Commit

Permalink
Confirm that a valid access token has been retrieved.
Browse files Browse the repository at this point in the history
* twittering-mode.el: confirm that a valid access token has been
retrieved.
(twittering-oauth-make-response-alist): do not decode a null entry.
(twittering-verify-credentials): confirm that the retrieved
`token-alist' is valid as an access token.
  • Loading branch information
cvmat committed Jun 5, 2010
1 parent ff897da commit 78dff77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
@@ -1,3 +1,11 @@
2010-06-05 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: confirm that a valid access token has been
retrieved.
(twittering-oauth-make-response-alist): do not decode a null entry.
(twittering-verify-credentials): confirm that the retrieved
`token-alist' is valid as an access token.

2010-06-04 Yuto Hayamizu <y.hayamizu@gmail.com>

* twittering-mode.el: removed (set-terminal-coding-system 'utf-8)
Expand Down
11 changes: 8 additions & 3 deletions twittering-mode.el
Expand Up @@ -1021,8 +1021,11 @@ function."
(mapcar
(lambda (entry)
(let* ((pair (split-string entry "="))
(name (twittering-oauth-url-decode (car pair)))
(value (twittering-oauth-url-decode (cadr pair))))
(name-entry (car pair))
(value-entry (cadr pair))
(name (and name-entry (twittering-oauth-url-decode name-entry)))
(value (and value-entry
(twittering-oauth-url-decode value-entry))))
`(,name . ,value)))
(split-string str "&")))

Expand Down Expand Up @@ -2913,7 +2916,9 @@ authorized -- The account has been authorized.")
twittering-oauth-consumer-key twittering-oauth-consumer-secret
"twittering-mode")))
(cond
(token-alist
((and (assoc "oauth_token" token-alist)
(assoc "oauth_token_secret" token-alist)
(assoc "screen_name" token-alist))
(let ((username (cdr (assoc "screen_name" token-alist))))
(setq twittering-oauth-access-token-alist token-alist)
(setq twittering-username username)
Expand Down

0 comments on commit 78dff77

Please sign in to comment.