Skip to content

Commit

Permalink
Integrate generic function into`twittering-oauth-get-token-alist'.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Integrate generic function into
`twittering-oauth-get-token-alist'.
(twittering-oauth-get-token-alist): unified with
`ftwittering-oauth-get-token-alist-generic'.
(twittering-oauth-get-token-alist-generic): removed.
  • Loading branch information
cvmat committed Sep 19, 2010
1 parent 437a948 commit 9b2cc3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Expand Up @@ -73,6 +73,12 @@
(twittering-send-http-request-curl): add the field "Expect".
(twittering-start-http-session): remove the field "Expect".

* twittering-mode.el: Integrate generic function into
`twittering-oauth-get-token-alist'.
(twittering-oauth-get-token-alist): unified with
`ftwittering-oauth-get-token-alist-generic'.
(twittering-oauth-get-token-alist-generic): removed.

2010-09-12 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Add an edited tweet into the history without
Expand Down
23 changes: 6 additions & 17 deletions twittering-mode.el
Expand Up @@ -1167,8 +1167,12 @@ function."
(kill-buffer buffer))
result))))

(defun twittering-oauth-get-token-alist-generic (url auth-str post-body start-func pre-process-func)
(let* ((parts-alist
(defun twittering-oauth-get-token-alist (url auth-str &optional post-body)
(let* ((entry (cdr (assq twittering-oauth-get-token-function-type
twittering-oauth-get-token-function-table)))
(start-func (car entry))
(pre-process-func (cdr entry))
(parts-alist
(let ((parsed-url (url-generic-parse-url url)))
(cond
((and (fboundp 'url-p) (url-p parsed-url))
Expand Down Expand Up @@ -1243,21 +1247,6 @@ function."
(sit-for 0.1))
result))))

(defun twittering-oauth-get-token-alist (url auth-str &optional post-body)
(let ((entry (cdr (assq twittering-oauth-get-token-function-type
twittering-oauth-get-token-function-table))))
(cond
((null entry)
nil)
((functionp entry)
(funcall entry url auth-str post-body))
((and (consp entry) (functionp (car entry))
(or (functionp (cdr entry)) (null (cdr entry))))
(twittering-oauth-get-token-alist-generic
url auth-str post-body (car entry) (cdr entry)))
(t
nil))))

(defun twittering-oauth-get-request-token (url consumer-key consumer-secret)
(let ((auth-str
(twittering-oauth-auth-str-request-token
Expand Down

0 comments on commit 9b2cc3b

Please sign in to comment.