Skip to content

Commit

Permalink
Create an identica-create-account function to create a status.net acc…
Browse files Browse the repository at this point in the history
…ount object from the old account globals and call it from former location of code..
  • Loading branch information
kevingranade committed Aug 31, 2012
1 parent f9d44d4 commit 8d47e6b
Showing 1 changed file with 28 additions and 22 deletions.
50 changes: 28 additions & 22 deletions identica-mode.el
Expand Up @@ -640,28 +640,34 @@ of identica-stripe-face."
(nconc text-property-default-nonsticky
'((face . t)(mouse-face . t)(uri . t)(source . t)(uri-in-text . t)))

;; Create an account object based on the various custom variables.
;; Insert it into the statusnet accounts list.
(setq statusnet-accounts
(cons (make-statusnet-account
:server statusnet-server
:port statusnet-port
:username identica-username
:auth-mode identica-auth-mode
:password identica-password
:textlimit statusnet-server-textlimit
:oauth-data (if (string= identica-auth-mode "oauth")
(make-statusnet-oauth-data
:consumer-key identica-mode-oauth-consumer-key
:consumer-secret identica-mode-oauth-consumer-secret
:request-url statusnet-request-url
:access-url statusnet-access-url
:authorize-url statusnet-authorize-url
:access-token nil)
nil)
:last-timeline-retrieved nil)
statusnet-accounts))
(setq sn-current-account (car statusnet-accounts)))
(identica-create-account))

(defun identica-create-account ()
"Create an account object based on the various custom variables.
Insert it into the statusnet accounts list.
This needs to be called from any globally-accessable entry point."
(unless (boundp 'statusnet-account-created)
(setq statusnet-account-created t)
(setq statusnet-accounts
(cons (make-statusnet-account
:server statusnet-server
:port statusnet-port
:username identica-username
:auth-mode identica-auth-mode
:password identica-password
:textlimit statusnet-server-textlimit
:oauth-data (if (string= identica-auth-mode "oauth")
(make-statusnet-oauth-data
:consumer-key identica-mode-oauth-consumer-key
:consumer-secret identica-mode-oauth-consumer-secret
:request-url statusnet-request-url
:access-url statusnet-access-url
:authorize-url statusnet-authorize-url
:access-token nil)
nil)
:last-timeline-retrieved nil)
statusnet-accounts))
(setq sn-current-account (car statusnet-accounts))))

(defmacro case-string (str &rest clauses)
`(cond
Expand Down

0 comments on commit 8d47e6b

Please sign in to comment.