From c6d52d94673ac00fe992555756db9e90c9b31bf3 Mon Sep 17 00:00:00 2001 From: bg66 Date: Wed, 5 Nov 2003 00:49:36 +0000 Subject: [PATCH] * riece-unread.el (riece-unread-switch-to-channel): Protect switching to the channel not existing. --- lisp/ChangeLog | 7 ++++++- lisp/riece-unread.el | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccaa278..daadc9c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,12 @@ +2003-11-05 OHASHI Akira + + * riece-unread.el (riece-unread-switch-to-channel): Protect + switching to the channel not existing. + 2003-10-29 OHASHI Akira * riece-log.el (riece-log-get-directory): Support riece-identity - for mapping. + for mapping. 2003-10-28 Daiki Ueno diff --git a/lisp/riece-unread.el b/lisp/riece-unread.el index 47c998a..3a19c1d 100644 --- a/lisp/riece-unread.el +++ b/lisp/riece-unread.el @@ -82,8 +82,13 @@ (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 () -- 1.7.10.4