* riece.el (riece-exit): Reset riece-channel-status-indicator.
authorueno <ueno>
Sun, 14 Nov 2004 02:31:24 +0000 (02:31 +0000)
committerueno <ueno>
Sun, 14 Nov 2004 02:31:24 +0000 (02:31 +0000)
(riece-command-mode): Display riece-channel-status-indicator.
(riece-dialogue-mode): Ditto.
(riece-channel-mode): Ditto.

* riece-display.el (riece-update-channel-status-indicator): New
function.
(riece-update-indicator-functions): Add it.

* riece-globals.el (riece-channel-status-indicator): New indicator.

lisp/ChangeLog
lisp/riece-display.el
lisp/riece-globals.el
lisp/riece.el

index 8b64322..624bd7d 100644 (file)
@@ -1,3 +1,21 @@
+2004-11-14  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece.el (riece-exit): Reset riece-channel-status-indicator.
+       (riece-command-mode): Display riece-channel-status-indicator.
+       (riece-dialogue-mode): Ditto.
+       (riece-channel-mode): Ditto.
+
+       * riece-display.el (riece-update-channel-status-indicator): New
+       function.
+       (riece-update-indicator-functions): Add it.
+
+       * riece-globals.el (riece-channel-status-indicator): New indicator.
+
+2004-11-13  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece.el (riece-select-keys): Bind
+       riece-command-switch-to-channel-by-number to "#".
+
 2004-11-11  Masatake YAMATO  <jet@gyve.org>
 
        * riece-yank.el (riece-command-yank): Fix a typo in comments.
index 9c36ec4..c9f5b3c 100644 (file)
@@ -43,6 +43,7 @@ Local to the buffer in `riece-buffer-list'.")
 
 (defvar riece-update-indicator-functions
   '(riece-update-status-indicators
+    riece-update-channel-status-indicator
     riece-update-channel-indicator
     riece-update-long-channel-indicator
     riece-update-channel-list-indicator)
@@ -70,6 +71,7 @@ Local to the buffer in `riece-buffer-list'.")
    'channel-switched
    (lambda (signal handback)
      (riece-update-status-indicators)
+     (riece-update-channel-status-indicator)
      (riece-update-channel-indicator)
      (riece-update-long-channel-indicator)
      (force-mode-line-update t)
@@ -199,6 +201,7 @@ Local to the buffer in `riece-buffer-list'.")
   (riece-connect-signal
    'channel-operators-changed
    (lambda (signal handback)
+     (riece-update-channel-status-indicator)
      (riece-emit-signal 'user-list-changed riece-current-channel))
    (lambda (signal)
      (and riece-current-channel
@@ -207,6 +210,7 @@ Local to the buffer in `riece-buffer-list'.")
   (riece-connect-signal
    'channel-speakers-changed
    (lambda (signal handback)
+     (riece-update-channel-status-indicator)
      (riece-emit-signal 'user-list-changed riece-current-channel))
    (lambda (signal)
      (and riece-current-channel
@@ -325,20 +329,21 @@ Local to the buffer in `riece-buffer-list'.")
     (setq riece-channel-list-indicator "No channel")))
 
 (defun riece-update-status-indicators ()
-  (if riece-current-channel
-      (with-current-buffer riece-command-buffer
-       (riece-with-server-buffer (riece-identity-server riece-current-channel)
-         (setq riece-away-indicator
-               (if (and riece-real-nickname
-                        (riece-user-get-away riece-real-nickname))
-                   "A"
-                 "-")
-               riece-operator-indicator
-               (if (and riece-real-nickname
-                        (riece-user-get-operator riece-real-nickname))
-                   "O"
-                 "-")
-               riece-user-indicator riece-real-nickname))))
+  (let ((server-name (riece-current-server-name)))
+    (if server-name
+       (with-current-buffer riece-command-buffer
+         (riece-with-server-buffer server-name
+           (setq riece-away-indicator
+                 (if (and riece-real-nickname
+                          (riece-user-get-away riece-real-nickname))
+                     "A"
+                   "-")
+                 riece-operator-indicator
+                 (if (and riece-real-nickname
+                          (riece-user-get-operator riece-real-nickname))
+                     "O"
+                   "-")
+                 riece-user-indicator riece-real-nickname)))))
   (walk-windows
    (lambda (window)
      (with-current-buffer (window-buffer window)
@@ -351,6 +356,29 @@ Local to the buffer in `riece-buffer-list'.")
                       "F"
                     "-"))))))))
 
+(defun riece-update-channel-status-indicator ()
+  (if (and riece-current-channel
+          (riece-channel-p (riece-identity-prefix riece-current-channel)))
+      (let ((users
+            (riece-with-server-buffer (riece-identity-server
+                                       riece-current-channel)
+              (riece-channel-get-users (riece-identity-prefix
+                                        riece-current-channel))))
+           (nickname
+            (riece-with-server-buffer (riece-identity-server
+                                       riece-current-channel)
+              riece-real-nickname)))
+       (with-current-buffer riece-command-buffer
+         (setq riece-channel-status-indicator
+               (if nickname
+                   (let ((user (cdr (riece-identity-assoc nickname users t))))
+                     (if (memq ?o user)
+                         "@"
+                       (if (memq ?v user)
+                           "+")
+                       "-"))
+                 "-"))))))
+
 (defun riece-update-buffers (&optional buffers)
   (unless buffers
     (setq buffers riece-buffer-list))
index 4741b89..676daca 100644 (file)
@@ -156,7 +156,10 @@ riece-channel-indicator.")
 user is away.")
 (defvar riece-operator-indicator "-"
   "String displayed on the modeline to allow the user to tell if the
-user is a operator.")
+user is an operator.")
+(defvar riece-channel-status-indicator "-"
+  "String displayed on the modeline to allow the user to tell if the
+user's status on the current channel.")
 
 ;;; Buffers:
 (defvar riece-command-buffer nil
index e815b16..592683d 100644 (file)
@@ -67,7 +67,8 @@
   "Non nil if add-ons are already insinuated.")
 
 (defvar riece-select-keys
-  `("1" riece-command-switch-to-channel-by-number-1
+  `("#" riece-command-switch-to-channel-by-number
+    "1" riece-command-switch-to-channel-by-number-1
     "2" riece-command-switch-to-channel-by-number-2
     "3" riece-command-switch-to-channel-by-number-3
     "4" riece-command-switch-to-channel-by-number-4
@@ -363,6 +364,7 @@ If optional argument CONFIRM is non-nil, ask which IRC server to connect."
        riece-channel-list-indicator "No channel"
        riece-away-indicator "-"
        riece-operator-indicator "-"
+       riece-channel-status-indicator "-"
        riece-freeze-indicator "-")
   (delete-other-windows)
   (run-hooks 'riece-exit-hook))
@@ -384,6 +386,7 @@ For a list of the generic commands type \\[riece-command-generic] ? RET.
 
   (setq riece-away-indicator "-"
        riece-operator-indicator "-"
+       riece-channel-status-indicator "-"
        major-mode 'riece-command-mode
        mode-name "Command"
        mode-line-buffer-identification
@@ -391,6 +394,7 @@ For a list of the generic commands type \\[riece-command-generic] ? RET.
         '("Riece: "
           riece-away-indicator
           riece-operator-indicator
+          riece-channel-status-indicator
           " "
           riece-user-indicator
           " "
@@ -426,6 +430,7 @@ Instead, these commands are available:
   (setq riece-freeze riece-default-freeze
        riece-away-indicator "-"
        riece-operator-indicator "-"
+       riece-channel-status-indicator "-"
        major-mode 'riece-dialogue-mode
        mode-name "Dialogue"
        mode-line-buffer-identification
@@ -434,6 +439,7 @@ Instead, these commands are available:
           riece-away-indicator
           riece-operator-indicator
           riece-freeze-indicator
+          riece-channel-status-indicator
           " "
           riece-channel-list-indicator " "))
        truncate-lines nil
@@ -463,6 +469,7 @@ Instead, these commands are available:
           riece-away-indicator
           riece-operator-indicator
           riece-freeze-indicator
+          riece-channel-status-indicator
           " "
           riece-long-channel-indicator))))