* riece-unread.el (riece-unread-after-display-message-function):
authorDaiki Ueno <ueno@unixuser.org>
Wed, 24 Mar 2004 15:22:06 +0000 (15:22 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Wed, 24 Mar 2004 15:22:06 +0000 (15:22 +0000)
Treat private messages as unread.

lisp/ChangeLog
lisp/riece-unread.el

index ffbe8df..e08df94 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-24  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-unread.el (riece-unread-after-display-message-function):
+       Treat private messages as unread.
+
 2004-03-21  Daiki Ueno  <ueno@unixuser.org>
 
        * riece.el (riece-exit): Don't clear riece-user-list-buffer and
 2004-03-21  Daiki Ueno  <ueno@unixuser.org>
 
        * riece.el (riece-exit): Don't clear riece-user-list-buffer and
index 6f64b2e..3514358 100644 (file)
 (defvar riece-unread-channels nil)
 
 (defun riece-unread-after-display-message-function (message)
 (defvar riece-unread-channels nil)
 
 (defun riece-unread-after-display-message-function (message)
-  (unless (or (riece-message-own-p message)
-             (riece-message-type message)
-             (riece-identity-equal (riece-message-target message)
-                                   riece-current-channel)
-             (riece-identity-member (riece-message-target message)
-                                    riece-unread-channels))
-    (setq riece-unread-channels
-         (cons (riece-message-target message) riece-unread-channels))
-    (riece-emit-signal 'channel-list-changed)))
+  (let ((target (if (riece-message-private-p message)
+                   (riece-message-speaker message)
+                 (riece-message-target message))))
+    (unless (or (riece-message-own-p message)
+               (riece-message-type message)
+               (riece-identity-equal target riece-current-channel)
+               (riece-identity-member target riece-unread-channels))
+      (setq riece-unread-channels (cons target riece-unread-channels))
+      (riece-emit-signal 'channel-list-changed))))
 
 (defun riece-unread-after-switch-to-channel-function (last)
   (setq riece-unread-channels
 
 (defun riece-unread-after-switch-to-channel-function (last)
   (setq riece-unread-channels