[Top][All Lists]

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

[Identica-mode-devel] [RFC PATCH 4/4] Add function to switch between acc

From: identica-mode-devel
Subject: [Identica-mode-devel] [RFC PATCH 4/4] Add function to switch between accounts.
Date: Sun, 22 Jan 2012 15:43:23 -0600

>From a6eb0ae33748f95855e9bd6b06a12f8402aa6073 Mon Sep 17 00:00:00 2001

This is mosatly just an illustration of what manipulating the account objects
will look like.  If you remove (setq identica-timeline-data nil)
the new notices will just append/interleave with the existing notices, but
that's pretty confusing and will probably break replies.

 identica-mode.el |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/identica-mode.el b/identica-mode.el
index c912f20..2c9a9aa 100644
--- a/identica-mode.el
+++ b/identica-mode.el
@@ -1908,6 +1908,17 @@ this dictionary, only if identica-urlshortening-service 
is 'google.
   (setq identica-active-mode nil)
+(defun identica-switch-account ()
+  "Update the current account and reload the default timeline."
+  (interactive)
+  (let ((current-account (member* sn-current-account statusnet-accounts)))
+    (setq sn-current-account
+         (if (cdr current-account)
+             (cadr current-account)
+           (car statusnet-accounts))
+         identica-timeline-data nil)
+    (identica-current-timeline)))
 (defun identica-get-timeline (&optional parameters)
   (unless parameters (setq parameters `(("count" . ,(int-to-string 
   (when (not (eq (sn-account-last-timeline-retrieved sn-current-account) 

reply via email to

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