* riece-ctcp.el (riece-ctcp-completing-read-identity): New
authorueno <ueno>
Tue, 21 Oct 2003 10:04:55 +0000 (10:04 +0000)
committerueno <ueno>
Tue, 21 Oct 2003 10:04:55 +0000 (10:04 +0000)
function.
(riece-command-ctcp-version): Use it.
(riece-command-ctcp-ping): Ditto.
(riece-command-ctcp-clientinfo): Ditto.
(riece-command-ctcp-action): Ditto; don't encode CHANNEL identity
twice.

lisp/ChangeLog
lisp/riece-ctcp.el

index 7380d26..298790f 100644 (file)
@@ -1,3 +1,13 @@
+2003-10-21  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-ctcp.el (riece-ctcp-completing-read-identity): New
+       function.
+       (riece-command-ctcp-version): Use it.
+       (riece-command-ctcp-ping): Ditto.
+       (riece-command-ctcp-clientinfo): Ditto.
+       (riece-command-ctcp-action): Ditto; don't encode CHANNEL identity
+       twice.
+
 2003-10-20  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-xemacs.el (riece-xemacs-mode-line-buffer-identification):
index 240c9ac..9406b12 100644 (file)
             string))
     "\n")))
 
+(defun riece-ctcp-completing-read-identity ()
+  (riece-completing-read-identity
+   "Channel/User: "
+   (let ((server-name (riece-current-server-name)))
+     (append (mapcar
+             (lambda (user)
+               (riece-make-identity user server-name))
+             (riece-get-users-on-server))
+            riece-current-channels))))
+
 (defun riece-command-ctcp-version (user)
   (interactive
-   (let ((completion-ignore-case t))
-     (list (completing-read
-           "Channel/User: "
-           (mapcar #'list (riece-get-users-on-server))))))
+   (list (riece-ctcp-completing-read-identity)))
   (riece-send-string (format "PRIVMSG %s :\1VERSION\1\r\n" user)))
 
 (defun riece-command-ctcp-ping (user)
   (interactive
-   (let ((completion-ignore-case t))
-     (list (completing-read
-           "Channel/User: "
-           (mapcar #'list (riece-get-users-on-server))))))
+   (list (riece-ctcp-completing-read-identity)))
   (riece-send-string (format "PRIVMSG %s :\1PING\1\r\n" user))
   (setq riece-ctcp-ping-time (current-time)))
 
 (defun riece-command-ctcp-clientinfo (user)
   (interactive
-   (let ((completion-ignore-case t))
-     (list (completing-read
-           "Channel/User: "
-           (mapcar #'list (riece-get-users-on-server))))))
+   (list (riece-ctcp-completing-read-identity)))
   (riece-send-string (format "PRIVMSG %s :\1CLIENTINFO\1\r\n" user)))
 
 (defun riece-command-ctcp-action (channel action)
   (interactive
    (list (if current-prefix-arg
-            (completing-read
-             "Channel/User: "
-             (mapcar #'list riece-current-channels))
+            (riece-ctcp-completing-read-identity)
           riece-current-channel)
         (read-string "Action: ")))
   (if (equal action "")
   (riece-send-string (format "PRIVMSG %s :\1ACTION %s\1\r\n"
                             (riece-identity-prefix channel)
                             action))
-  (let ((buffer (riece-channel-buffer (riece-make-identity
-                                      channel riece-server-name))))
+  (let ((buffer (riece-channel-buffer channel)))
     (riece-insert-change
      buffer
      (concat (riece-identity-prefix (riece-current-nickname)) " " action "\n"))