* riece-commands.el (riece-command-universal-server-name-argument):
[riece] / lisp / riece-commands.el
index 3e3c614..caaff59 100644 (file)
@@ -189,8 +189,11 @@ the layout to the selected layout-name."
        (error "Not on a channel"))
      (list (completing-read
            "User: "
-           (mapcar #'list (riece-channel-get-users
-                           riece-current-channel)))
+           (mapcar #'list
+                   (riece-with-server-buffer
+                       (riece-identity-server riece-current-channel)
+                     (riece-channel-get-users
+                      (riece-identity-prefix riece-current-channel)))))
           (if current-prefix-arg
               (read-string "Message: ")))))
   (riece-send-string
@@ -210,7 +213,7 @@ the layout to the selected layout-name."
            (if (and riece-current-channel
                     (riece-channel-p (riece-identity-prefix
                                       riece-current-channel)))
-               (cons (riece-format-identity riece-current-channel t)
+               (cons (riece-identity-prefix riece-current-channel)
                      0))))))
   (if (or (not (equal pattern ""))
          (yes-or-no-p "Really want to query NAMES without argument? "))
@@ -224,7 +227,7 @@ the layout to the selected layout-name."
            (if (and riece-current-channel
                     (riece-channel-p (riece-identity-prefix
                                       riece-current-channel)))
-               (cons (riece-format-identity riece-current-channel t)
+               (cons (riece-identity-prefix riece-current-channel)
                      0))))))
   (if (or (not (equal pattern ""))
          (yes-or-no-p "Really want to query WHO without argument? "))
@@ -238,7 +241,7 @@ the layout to the selected layout-name."
            (if (and riece-current-channel
                     (riece-channel-p (riece-identity-prefix
                                       riece-current-channel)))
-               (cons (riece-format-identity riece-current-channel t)
+               (cons (riece-identity-prefix riece-current-channel)
                      0))))))
   (if (or (not (equal pattern ""))
          (yes-or-no-p "Really want to query LIST without argument? "))
@@ -531,7 +534,10 @@ the layout to the selected layout-name."
 (defun riece-command-toggle-away (&optional message)
   "Mark yourself as being away."
   (interactive
-   (if (and (not (riece-user-get-away (riece-current-nickname)))
+   (if (and (not (riece-with-server-buffer (riece-identity-server
+                                           (riece-current-nickname))
+                  (riece-user-get-away (riece-identity-prefix
+                                        (riece-current-nickname)))))
            (or (null riece-away-message)
                current-prefix-arg))
        (let ((message (read-string "Away message: ")))
@@ -580,10 +586,10 @@ If prefix argument ARG is non-nil, toggle frozen status."
                 (read-string "Message: ")
               (or riece-quit-message
                   (riece-extended-version))))
-           (process-list riece-process-list))
-       (while process-list
-         (riece-quit-server-process (car process-list) message)
-         (setq process-list (cdr process-list))))))
+           (alist riece-server-process-alist))
+       (while alist
+         (riece-quit-server-process (cdr (car alist)) message)
+         (setq alist (cdr alist))))))
 
 (defun riece-command-raw (command)
   "Enter raw IRC command, which is sent to the server."
@@ -621,13 +627,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
 
 (defun riece-command-close-server (server-name &optional message)
   (interactive
-   (list (completing-read
-         "Server: "
-         (mapcar
-          (lambda (process)
-            (with-current-buffer (process-buffer process)
-              (list riece-server-name)))
-          riece-process-list))
+   (list (completing-read "Server: " riece-server-process-alist)
         (if current-prefix-arg
             (read-string "Message: ")
           (or riece-quit-message
@@ -637,13 +637,7 @@ If prefix argument ARG is non-nil, toggle frozen status."
 (defun riece-command-universal-server-name-argument ()
   (interactive)
   (let* ((riece-overriding-server-name
-         (completing-read
-          "Server: "
-          (mapcar
-           (lambda (process)
-             (with-current-buffer (process-buffer process)
-               (list riece-server-name)))
-           riece-process-list)))
+         (completing-read "Server: " riece-server-process-alist))
         (command
          (key-binding (read-key-sequence
                        (format "Command to execute on \"%s\":"