From 0e0f12201246f9f867730e142bc4d261447beb8f Mon Sep 17 00:00:00 2001 From: bg66 Date: Tue, 29 Aug 2000 15:15:23 +0000 Subject: [PATCH] * liece-vars.el (liece-channel-unread-list): New variable. * liece-channel.el (liece-channel-unread-p): New function. (liece-channel-redisplay-buffer): Use it. * liece-handle.el (liece-handle-privmsg-message): Ditto. --- lisp/ChangeLog | 9 +++++++++ lisp/liece-channel.el | 10 ++++++++++ lisp/liece-handle.el | 9 +++++++++ lisp/liece-vars.el | 2 ++ 4 files changed, 30 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c37b4ac..102bc0c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2000-08-30 Akira Ohashi + + * liece-vars.el (liece-channel-unread-list): New variable. + + * liece-channel.el (liece-channel-unread-p): New function. + (liece-channel-redisplay-buffer): Use it. + + * liece-handle.el (liece-handle-privmsg-message): Ditto. + 2000-08-29 Akira Ohashi * liece-channel.el (liece-channel-change): Run diff --git a/lisp/liece-channel.el b/lisp/liece-channel.el index 956b53c..e340a23 100644 --- a/lisp/liece-channel.el +++ b/lisp/liece-channel.el @@ -72,6 +72,13 @@ (and (stringp item) (liece-channel-equal chnl item))) chnls)) +(defun liece-channel-unread-p (chnl) + "Return non-nil if CHNL is unread channel." + (member-if + (lambda (item) + (and (stringp item) (liece-channel-equal chnl item))) + liece-channel-unread-list)) + (defun liece-channel-get-nicks (&optional chnl) "Return CHNL or current channels's members as list." (get (intern (or chnl liece-current-channel) liece-obarray) 'nick)) @@ -495,6 +502,9 @@ If NOSW is non-nil do not switch to newly created channel." (cdr (string-assoc-ignore-case chnl liece-channel-buffer-alist))) (window (liece-get-buffer-window liece-channel-buffer))) + (and (liece-channel-unread-p chnl) + (setq liece-channel-unread-list + (delete chnl liece-channel-unread-list))) (and buffer window (with-current-buffer buffer (set-window-buffer window buffer) diff --git a/lisp/liece-handle.el b/lisp/liece-handle.el index 1ea8886..8574a6f 100644 --- a/lisp/liece-handle.el +++ b/lisp/liece-handle.el @@ -187,6 +187,15 @@ (liece-message-type 'privmsg)) (liece-display-message temp)) + ;; Append to the unread list. + (let ((item (if (eq liece-command-buffer 'chat) + liece-current-chat-partner + liece-current-channel))) + (and (not (liece-channel-equal chnl item)) + (not (liece-channel-unread-p chnl)) + (setq liece-channel-unread-list + (cons chnl liece-channel-unread-list)))) + (and (liece-nick-equal chnl liece-real-nickname) (not (liece-nick-equal prefix liece-current-chat-partner)) (liece-message (_ "A private message has arrived from %s") diff --git a/lisp/liece-vars.el b/lisp/liece-vars.el index 9f3d4f1..5b5530b 100644 --- a/lisp/liece-vars.el +++ b/lisp/liece-vars.el @@ -318,6 +318,8 @@ Otherwise you might get killed again if automagic reconnect is too fast." (defvar liece-status-message-string nil) +(defvar liece-channel-unread-list nil) + ;; Hooks. (defgroup liece-hook nil "Hooks" -- 1.7.10.4