identica-mode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Identica-mode-devel] [RFC PATCH 2/4] Automatically create a statusnet a


From: identica-mode-devel
Subject: [Identica-mode-devel] [RFC PATCH 2/4] Automatically create a statusnet account based on the previously existing account variables, and add it to the accounts list.
Date: Sat, 21 Jan 2012 13:27:43 -0600

>From 2daf2a3f7326965beb43171b8e5254ca832ba029 Mon Sep 17 00:00:00 2001

This patch creates a default account object that populates itself from the
existing defcustom variables, so no one has to change their .emacs files
in order to work with the new code.

---
 identica-mode.el |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/identica-mode.el b/identica-mode.el
index 02c88ea..2261da1 100644
--- a/identica-mode.el
+++ b/identica-mode.el
@@ -625,7 +625,30 @@ of identica-stripe-face."
     `((t nil)) "" :group 'faces)
   (set-face-attribute 'identica-uri-face nil :underline t)
   (add-to-list 'minor-mode-alist '(identica-icon-mode " id-icon"))
-  (add-to-list 'minor-mode-alist '(identica-scroll-mode " id-scroll")))
+  (add-to-list 'minor-mode-alist '(identica-scroll-mode " id-scroll"))
+
+  ;; 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)))
 
 (defmacro case-string (str &rest clauses)
   `(cond
-- 
1.7.6.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]