* liece-vars.el (liece-channel-unread-list): New variable.
authorbg66 <bg66>
Tue, 29 Aug 2000 15:15:23 +0000 (15:15 +0000)
committerbg66 <bg66>
Tue, 29 Aug 2000 15:15:23 +0000 (15:15 +0000)
* 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
lisp/liece-channel.el
lisp/liece-handle.el
lisp/liece-vars.el

index c37b4ac..102bc0c 100644 (file)
@@ -1,3 +1,12 @@
+2000-08-30  Akira Ohashi <bg66@luck.gr.jp>
+
+       * 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  <bg66@luck.gr.jp>
 
        * liece-channel.el (liece-channel-change): Run
index 956b53c..e340a23 100644 (file)
      (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)
index 1ea8886..8574a6f 100644 (file)
            (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")
index 9f3d4f1..5b5530b 100644 (file)
@@ -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"