* riece-unread.el (riece-unread-switch-to-channel): Protect
authorbg66 <bg66>
Wed, 5 Nov 2003 00:49:36 +0000 (00:49 +0000)
committerbg66 <bg66>
Wed, 5 Nov 2003 00:49:36 +0000 (00:49 +0000)
switching to the channel not existing.

lisp/ChangeLog
lisp/riece-unread.el

index ccaa278..daadc9c 100644 (file)
@@ -1,7 +1,12 @@
+2003-11-05  OHASHI Akira  <bg66@koka-in.org>
+
+       * riece-unread.el (riece-unread-switch-to-channel): Protect
+       switching to the channel not existing.
+
 2003-10-29  OHASHI Akira  <bg66@koka-in.org>
 
        * riece-log.el (riece-log-get-directory): Support riece-identity
-        for mapping.
+       for mapping.
 
 2003-10-28  Daiki Ueno  <ueno@unixuser.org>
 
index 47c998a..3a19c1d 100644 (file)
 
 (defun riece-unread-switch-to-channel ()
   (interactive)
-  (if (car riece-unread-channels)
-      (riece-command-switch-to-channel (car riece-unread-channels))
+  (if riece-unread-channels
+      (let ((channel (car riece-unread-channels)))
+       (if (riece-identity-member channel riece-current-channels)
+           (riece-command-switch-to-channel channel)
+         (setq riece-unread-channels
+               (delete channel riece-unread-channels))
+         (riece-unread-switch-to-channel)))
     (error "No unread channel!")))
 
 (defun riece-guess-channel-from-unread ()