* riece-commands.el (riece-command-kick): Fix completing-read
[elisp/riece.git] / lisp / riece-commands.el
index 3d0f9a9..55c0f23 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
@@ -421,8 +424,14 @@ the layout to the selected layout-name."
   (interactive
    (let* ((completion-ignore-case t)
          (target
-          (riece-completing-read-identity
-           "Channel/User: " riece-current-channels))
+          (if riece-join-channel-candidate
+              (let ((default (riece-format-identity
+                              riece-join-channel-candidate)))
+                (riece-completing-read-identity
+                 (format "Channel/User (default %s): " default)
+                 riece-current-channels nil nil nil nil default))
+            (riece-completing-read-identity
+             "Channel/User: " riece-current-channels)))
          key)
      (if (and current-prefix-arg
              (riece-channel-p (riece-identity-prefix target)))