* liece-commands.el (liece-command-set-operators): Reset `run'.
[elisp/liece.git] / lisp / liece-commands.el
index 86ab774..bbcba82 100644 (file)
@@ -30,7 +30,6 @@
 ;;; Code:
 
 (eval-when-compile
-   (require 'liece-crypt)
    (require 'liece-misc))
 
 (require 'liece-channel)
@@ -40,7 +39,6 @@
 (require 'liece-minibuf)
 
 (autoload 'liece-dcc-chat-send "liece-dcc")
-(autoload 'liece-window-configuration-pop "liece-window")
 
 (autoload 'liece-command-ctcp-version "liece-ctcp" nil t)
 (autoload 'liece-command-ctcp-userinfo "liece-ctcp" nil t)
@@ -127,72 +125,48 @@ Optional argument NO-CONS specifies timestamp format is cons cell."
   (let ((win (liece-get-buffer-window liece-command-buffer)))
     (if win (select-window win))))
 
-(defun liece-command-send-message
-  (message &optional arg key)
-  "Send MESSAGE to current chat partner of current channel.
-If argument ARG is non-nil message will be encrypted with KEY."
-  (when arg
-    (setq liece-crypt-mode-active (not liece-crypt-mode-active)))
+(defun liece-command-send-message (message)
+  "Send MESSAGE to current chat partner of current channel."
   (if (string-equal message "")
       (progn (liece-message (_ "No text to send")) nil)
     (let ((addr (if (eq liece-command-buffer-mode 'chat)
                    liece-current-chat-partner
                  liece-current-channel))
-         repr method name target
-         (msg message))
-      (with-liece-encryption (msg addr arg key)
-       (cond
-        ((eq liece-command-buffer-mode 'chat)
-         (if (null liece-current-chat-partner)
-             (message
-              (substitute-command-keys
-               "Type \\[liece-command-join] to start private conversation"))
-           (setq repr (liece-channel-parse-representation
-                       liece-current-chat-partner)
-                 method (aref repr 0)
-                 name (aref repr 1)
-                 target (aref repr 2))
-           (cond ((eq method 'dcc)
-                  (liece-dcc-chat-send target msg))
-                 ((eq method 'irc)
-                  (liece-send "PRIVMSG %s :%s"
-                               liece-current-chat-partner msg)))
-           (liece-own-private-message message)))
-        ((not liece-current-channel)
-         (beep t)
-         (message (substitute-command-keys
-                   "Type \\[liece-command-join] to join a channel")))
-        (t
-         (liece-send
-          "PRIVMSG %s :%s"
-          (liece-channel-real liece-current-channel) msg)
-         (liece-own-channel-message message))))
-      t)))
-
-(defun liece-enter-message (&optional arg key)
-  "Enter the current line as an entry in the IRC dialogue.
-If argument ARG is non-nil message will be encrypted with KEY."
+         repr method name target)
+      (cond
+       ((eq liece-command-buffer-mode 'chat)
+       (or liece-current-chat-partner
+           (error
+            (substitute-command-keys
+             "Type \\[liece-command-join] to start private conversation")))
+       (setq repr (liece-channel-parse-representation
+                   liece-current-chat-partner)
+             method (aref repr 0)
+             name (aref repr 1)
+             target (aref repr 2))
+       (cond ((eq method 'dcc)
+              (liece-dcc-chat-send target message))
+             ((eq method 'irc)
+              (liece-send "PRIVMSG %s :%s"
+                          liece-current-chat-partner message)))
+       (liece-own-private-message message))
+       (t
+       (or liece-current-channel
+           (error
+            (substitute-command-keys
+             "Type \\[liece-command-join] to join a channel")))
+       (liece-send
+        "PRIVMSG %s :%s"
+        (liece-channel-real liece-current-channel) message)
+       (liece-own-channel-message message))))))
+
+(defun liece-command-enter-message ()
+  "Enter the current line as an entry in the IRC dialogue."
+  (interactive)
   (beginning-of-line)
-  (if (liece-command-send-message
-       (buffer-substring (point)(progn (end-of-line) (point)))
-       arg key)
-      (liece-next-line 1)))
-
-(defun liece-command-enter-message (&optional arg key)
-  "Enter the current line as an entry in the IRC dialogue.
-If the prefix argument ARG is non-nil, message will be encrypted with KEY."
-  (interactive
-   (let ((completion-ignore-case t))
-     (and (if current-prefix-arg
-             (not liece-crypt-mode-active)
-           liece-crypt-mode-active)
-         (list
-          'encrypt
-          (completing-read
-           (_ "Encrypt message with key [RET for none]: ")
-           (cons (cons "" nil)
-                 liece-crypt-encryption-keys))))))
-  (liece-enter-message arg (if (string-equal key "") nil key)))
+  (liece-command-send-message
+   (buffer-substring (point)(progn (end-of-line) (point))))
+  (liece-next-line 1))
 
 (defun liece-dialogue-enter-message ()
   "Ask for a line as an entry in the IRC dialogue on the current channel."
@@ -201,13 +175,6 @@ If the prefix argument ARG is non-nil, message will be encrypted with KEY."
     (while (not (string-equal (setq message (read-string "> ")) ""))
       (liece-command-send-message message))))
 
-(defun liece-command-inline ()
-  "Send current line as a message to the IRC server."
-  (interactive)
-  (beginning-of-line)
-  (liece-send (buffer-substring (point)(progn (end-of-line) (point))))
-  (liece-next-line 1))
-
 (defun liece-command-join-channel (join-channel-var key)
   "Join a JOIN-CHANNEL-VAR with KEY."
   (let ((nicks liece-nick-alist) nick)
@@ -249,14 +216,13 @@ with specified user."
               current-prefix-arg
             (liece-channel-virtual
              (if (eq liece-command-buffer-mode 'chat)
-                 (liece-minibuffer-completing-default-read
+                 (liece-minibuffer-completing-read
                   (_ "Start private conversation with: ")
-                  liece-nick-alist
-                  nil nil liece-privmsg-partner)
-               (liece-minibuffer-completing-default-read
+                  liece-nick-alist nil nil nil nil liece-privmsg-partner)
+               (liece-minibuffer-completing-read
                 (_ "Join channel: ")
                 (append liece-channel-alist liece-nick-alist)
-                nil nil liece-default-channel-candidate)))))
+                nil nil nil nil liece-default-channel-candidate)))))
      (if (and current-prefix-arg
              (not (numberp current-prefix-arg)))
         (setq key
@@ -293,14 +259,14 @@ with specified user."
      (setq part-channel-var
           (liece-channel-virtual
            (if (eq liece-command-buffer-mode 'chat)
-               (liece-minibuffer-completing-default-read
+               (liece-minibuffer-completing-read
                 (_ "End private conversation with: ")
                 (list-to-alist liece-current-chat-partners)
-                nil nil liece-current-chat-partner)
-             (liece-minibuffer-completing-default-read
+                nil nil nil nil liece-current-chat-partner)
+             (liece-minibuffer-completing-read
               (_ "Part channel: ")
               (list-to-alist liece-current-channels)
-              nil nil liece-current-channel))))
+              nil nil nil nil liece-current-channel))))
      (when current-prefix-arg
        (setq part-msg (read-string (_ "Part Message: "))))
      (list part-channel-var part-msg)))
@@ -317,7 +283,6 @@ with specified user."
            liece-current-chat-partner
            (car liece-current-chat-partners))
       (liece-set-channel-indicator)
-      (liece-set-crypt-indicator)
       (liece-channel-part part-channel-var))))
 
 (defun liece-command-kill (kill-nickname-var &optional timeout silent)
@@ -415,8 +380,8 @@ If SILENT is non-nil, don't notify current status."
                     (concat nick "!" (liece-nick-get-user-at-host nick)))))
                 nicks))
          ban nick msg)
-     (setq ban (liece-minibuffer-completing-default-read
-               (_ "Ban pattern: ") uahs nil nil
+     (setq ban (liece-minibuffer-completing-read
+               (_ "Ban pattern: ") uahs nil nil nil nil
                (concat nick "!" (liece-nick-get-user-at-host nick))))
      (list ban)))
   (liece-send "MODE %s :+b %s"
@@ -436,8 +401,8 @@ If SILENT is non-nil, don't notify current status."
          ban nick msg)
      (setq nick (completing-read (_ "Kick out nickname: ")
                                 (list-to-alist nicks))
-          ban (liece-minibuffer-completing-default-read
-               (_ "Ban pattern: ") uahs nil nil
+          ban (liece-minibuffer-completing-read
+               (_ "Ban pattern: ") uahs nil nil nil nil
                (concat nick "!" (liece-nick-get-user-at-host nick))))
      (if current-prefix-arg
         (setq msg (concat " :" (read-string (_ "Kick Message: "))))
@@ -458,9 +423,9 @@ With - as argument, list all channels."
        (if (eq current-prefix-arg '-)
           (list current-prefix-arg))
      (let ((completion-ignore-case t) channel)
-       (setq channel (liece-minibuffer-completing-default-read
+       (setq channel (liece-minibuffer-completing-read
                      (_ "LIST channel: ")
-                     liece-channel-alist nil nil liece-current-channel))
+                     liece-channel-alist nil nil nil nil liece-current-channel))
        (unless (string-equal "" channel)
         (list channel)))))
   
@@ -475,11 +440,6 @@ With - as argument, list all channels."
         (liece-send "LIST %s" (liece-channel-real channel))
         )))
 
-(defun liece-command-lusers ()
-  "List the number of users and servers."
-  (interactive)
-  (liece-send "LUSERS"))
-
 (defun liece-command-modec (chnl change)
   "Send a MODE command to this CHNL.
 Argument CHANGE ."
@@ -489,10 +449,10 @@ Argument CHANGE ."
         liece-minibuffer-complete-function prompt)
      (if current-prefix-arg
         (setq chnl
-              (liece-minibuffer-completing-default-read
+              (liece-minibuffer-completing-read
                (_ "Channel/User: ")
                (append liece-channel-alist liece-nick-alist)
-               nil nil liece-current-channel)))
+               nil nil nil nil liece-current-channel)))
      (cond
       ((liece-channel-p (liece-channel-real chnl))
        (setq prompt (format
@@ -509,143 +469,87 @@ Argument CHANGE ."
      (list chnl (read-from-minibuffer prompt nil liece-minibuffer-map))))
   (liece-send "MODE %s %s" (liece-channel-real chnl) change))
 
-(defun liece-command-mode+o (opers)
-  "Send a MODE +o OPERS command."
-  (interactive
-   (let ((opers (liece-channel-get-operators)) oper
-        (nicks (liece-channel-get-nicks))
-        (completion-ignore-case t))
-     (setq nicks (filter-elements
-                  nick nicks
-                  (not (liece-nick-member nick opers)))
-          opers (liece-minibuffer-completing-sequential-read
-                 (_ "Set Operator for") 0
-                 (list-to-alist nicks)))
-     (list opers)))
-  (let (ops)
-    (dolist (oper opers)
-      (push oper ops)
-      (when (= (length ops) liece-compress-mode-length)
-       (liece-send "MODE %s +%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "o" liece-compress-mode-length)
-                    (string-join ops " "))
-       (setq ops nil)))
-    (if ops
-       (liece-send "MODE %s +%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "o" (length ops))
-                    (string-join ops " ")))))
-
-(defun liece-command-mode-o (opers)
-  "Send a MODE -o OPERS command."
-  (interactive
-   (let ((completion-ignore-case t)
-        (opers (liece-channel-get-operators)) oper nicks)
-     (setq nicks (liece-minibuffer-completing-sequential-read
-                 (_ "Unset Operator for") 0
-                 (list-to-alist opers)))
-     (list nicks)))
-  (let (ops)
-    (dolist (oper opers)
-      (push oper ops)
-      (when (= (length ops) liece-compress-mode-length)
-       (liece-send "MODE %s -%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "o" liece-compress-mode-length)
-                    (string-join ops " "))
-       (setq ops nil)))
-    (if ops
-       (liece-send "MODE %s -%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "o" (length ops))
-                    (string-join ops " ")))))
-
-(defun liece-command-mode+v (voices)
-  "Send a MODE +v VOICES command."
+(defun liece-command-qualify-nicks (mode nicks val)
+  (liece-send
+   "MODE %s %c%s %s"
+   (liece-channel-real liece-current-channel)
+   (if val ?+ ?-) (make-string (length nicks) ?o)
+   (string-join nicks " ")))
+
+(defun liece-command-set-operators (nicks &optional arg)
   (interactive
-   (let ((voices (append (liece-channel-get-voices)
-                        (liece-channel-get-operators)))
-        voice
-        (nicks (liece-channel-get-nicks))
+   (let ((opers (liece-channel-get-operators))
         (completion-ignore-case t)
-        (count 0))
-     (setq nicks (filter-elements nick nicks
-                  (not (string-assoc-ignore-case nick voices)))
-          voices (liece-minibuffer-completing-sequential-read
-                  (_ "Set Voice for") 0 (list-to-alist nicks)))
-     (list voices)))
-  (let (vcs)
-    (dolist (voice voices)
-      (push voice vcs)
-      (when (= (length vcs) liece-compress-mode-length)
-       (liece-send "MODE %s +%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "v" liece-compress-mode-length)
-                    (string-join vcs " "))
-       (setq vcs nil)))
-    (if vcs
-       (liece-send "MODE %s +%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "v" (length vcs))
-                    (string-join vcs " ")))))
-
-(defun liece-command-mode-v (voices)
-  "Send a MODE -v VOICES command."
+        nicks)
+     (if current-prefix-arg
+        (setq nicks (liece-minibuffer-completing-read-multiple
+                     (_ "Divest operational privilege from: ")
+                     (list-to-alist opers)))
+       (setq nicks (liece-channel-get-nicks)
+            nicks (filter-elements nick nicks
+                    (not (liece-nick-member nick opers)))
+            nicks (liece-minibuffer-completing-read-multiple
+                   (_ "Assign operational privilege to: ")
+                   (list-to-alist nicks))))
+     (list nicks current-prefix-arg)))
+  (let (run)
+    (unwind-protect
+       (dolist (nick nicks)
+         (push nick run)
+         (when (= (length run) liece-compress-mode-length)
+           (liece-command-qualify-nicks ?o run (not arg))
+           (setq run nil)))
+      (when run
+       (liece-command-qualify-nicks ?o run (not arg))))))
+
+(defun liece-command-set-voices (nicks &optional arg)
   (interactive
-   (let ((completion-ignore-case t)
-        (voices (liece-channel-get-voices)) voice nicks)
-     (setq nicks (liece-minibuffer-completing-sequential-read
-                 (_ "Unset Voice for") 0 (list-to-alist voices)))
-     (list nicks)))
-  (let (vcs)
-    (dolist (voice voices)
-      (push voice vcs)
-      (when (= (length vcs) liece-compress-mode-length)
-       (liece-send "MODE %s -%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "v" liece-compress-mode-length)
-                    (string-join vcs " "))
-       (setq vcs nil)))
-    (if vcs
-       (liece-send "MODE %s -%s %s"
-                    (liece-channel-real liece-current-channel)
-                    (string-times "v" (length vcs))
-                    (string-join vcs " ")))))
-
-(defun liece-command-message (address message &optional arg key)
-  "Send ADDRESS a private MESSAGE.
-If argument ARG is non-nil message will be encrypted with KEY."
+   (let ((voices (liece-channel-get-voices))
+        (completion-ignore-case t)
+        nicks)
+     (if current-prefix-arg
+        (setq nicks (liece-minibuffer-completing-read-multiple
+                     (_ "Forbid to speak: ") (list-to-alist voices)))
+       (setq voices (append voices (liece-channel-get-operators))
+            nicks (liece-channel-get-nicks)
+            nicks (filter-elements nick nicks
+                    (not (liece-nick-member nick voices)))
+            nicks (liece-minibuffer-completing-read-multiple
+                   (_ "Allow to speak: ") (list-to-alist nicks))))
+     (list nicks current-prefix-arg)))
+  (let (run)
+    (unwind-protect
+       (dolist (nick nicks)
+         (push nick run)
+         (when (= (length run) liece-compress-mode-length)
+           (liece-command-qualify-nicks ?v run (not arg))
+           (setq run nil)))
+      (when run
+       (liece-command-qualify-nicks ?v run (not arg))))))
+
+(defun liece-command-message (address message)
+  "Send ADDRESS a private MESSAGE."
   (interactive
    (let ((completion-ignore-case t) address)
      (setq address
           (liece-channel-virtual
-           (liece-minibuffer-completing-default-read
+           (liece-minibuffer-completing-read
             (_ "Private message to: ")
             (append liece-nick-alist liece-channel-alist)
-            nil nil liece-privmsg-partner)))
+            nil nil nil nil liece-privmsg-partner)))
      (list address
           (read-string
            (format
             (_ "Private message to %s: ")
-            address))
-          (if current-prefix-arg
-              (not liece-crypt-mode-active)
-            liece-crypt-mode-active)
-          nil)))
+            address)))))
   (if (funcall liece-message-empty-predicate message)
       (progn (liece-message (_ "No text to send")) nil)
-    (let ((chnl (liece-channel-real address)) (msg message))
-      (with-liece-encryption (msg address arg key)
-       (liece-send "PRIVMSG %s :%s" chnl msg)
-       (if (liece-channel-p chnl)
-           (liece-own-channel-message message
-                                       (liece-channel-virtual address))
-         (liece-own-private-message message address)))
-      t)))
-
-;; Added at mta@tut.fi's request...
-;; Does not support encryption (yet!?)
+    (let ((chnl (liece-channel-real address)))
+      (liece-send "PRIVMSG %s :%s" chnl message)
+      (if (liece-channel-p chnl)
+         (liece-own-channel-message message
+                                    (liece-channel-virtual address))
+       (liece-own-private-message message address)))))
 
 (defun liece-command-mta-private (partner)
   "Send a private message (current line) to PARTNER."
@@ -653,10 +557,10 @@ If argument ARG is non-nil message will be encrypted with KEY."
    (let ((completion-ignore-case t))
      (setq liece-privmsg-partner
           (liece-channel-virtual
-           (liece-minibuffer-completing-default-read
+           (liece-minibuffer-completing-read
             (_ "To whom: ")
             (append liece-nick-alist liece-channel-alist)
-            nil nil liece-privmsg-partner)))
+            nil nil nil nil liece-privmsg-partner)))
      (list liece-privmsg-partner)))
   (let ((message (buffer-substring (progn (beginning-of-line) (point))
                                   (progn (end-of-line) (point)))))
@@ -675,9 +579,9 @@ With - as argument, list all channels."
        (if (eq current-prefix-arg '-)
           (list current-prefix-arg))
      (let ((completion-ignore-case t) expr)
-       (setq expr (liece-minibuffer-completing-default-read
+       (setq expr (liece-minibuffer-completing-read
                      (_ "Names on channel: ")
-                     liece-channel-alist nil nil liece-current-channel))
+                     liece-channel-alist nil nil nil nil liece-current-channel))
        (unless (string-equal "" expr)
         (list expr)))))
   (when (or (and (eq expr '-)
@@ -708,7 +612,7 @@ With - as argument, list all users."
        (if (eq current-prefix-arg '-)
           (list current-prefix-arg))
      (let ((completion-ignore-case t) expr)
-       (setq expr (liece-minibuffer-completing-default-read
+       (setq expr (completing-read
                   (_ "WHO expression: ")
                   (append liece-channel-alist liece-nick-alist)))
        (unless (string-equal "" expr)
@@ -819,18 +723,6 @@ Leave message AWAYMSG."
        (end-of-buffer
         (message "End of buffer"))))))
 
-(defun liece-command-toggle-crypt (&optional arg)
-  "Toggle crypt status.
-If prefix argument ARG is non-nil, force set crypt status."
-  (interactive "P")
-  (if arg
-      (setq liece-crypt-mode-active (prefix-numeric-value arg))
-    (if liece-crypt-mode-active
-       (setq liece-crypt-mode-active nil)
-      (setq liece-crypt-mode-active t)))
-  (liece-set-crypt-indicator)
-  (switch-to-buffer (current-buffer)))
-
 (defun liece-command-freeze (&optional arg)
   "Prevent automatic scrolling of the dialogue window.
 If prefix argument ARG is non-nil, toggle frozen status."
@@ -853,10 +745,10 @@ If prefix argument ARG is non-nil, toggle frozen status."
 (defun liece-command-beep (&optional arg)
   "Toggle the automatic beep notice when the channel message is received."
   (interactive "P")
-  (liece-beep (if liece-channel-buffer-mode
-                  liece-channel-buffer
-                liece-dialogue-buffer)
-              (if arg (prefix-numeric-value arg))))
+  (liece-set-beep (if liece-channel-buffer-mode
+                     liece-channel-buffer
+                   liece-dialogue-buffer)
+                 (if arg (prefix-numeric-value arg))))
 
 (defun liece-command-quit (&optional arg)
   "Quit IRC.
@@ -869,14 +761,9 @@ If prefix argument ARG is non-nil, leave signoff message."
           (if arg (read-string (_ "Signoff message: "))
             (or liece-signoff-message
                 (product-name (product-find 'liece-version))))))
-      (liece-send "QUIT :%s" quit-string))
-    (liece-clear-system)
-    (liece-close-server)
-    (if liece-save-variables-are-dirty
-       (liece-command-save-vars))
-    (if (interactive-p)
-       (liece-window-configuration-pop))
-    (run-hooks 'liece-exit-hook)))
+      (if quit-string
+         (liece-send "QUIT :%s" quit-string)
+       (liece-send "QUIT")))))
 
 (defun liece-command-generic (message)
   "Enter a generic IRC MESSAGE, which is sent to the server.
@@ -904,16 +791,6 @@ NAMES <channel>                    lists users per channel
       (call-interactively (function liece-command-generic))
     (self-insert-command 1)))
 
-(defun liece-command-exec (command)
-  "Execute COMMAND, stdout to dialogue."
-  (interactive "sShell command: ")
-  (shell-command command t)
-  (let ((opoint (point)))
-    (while (< (point) (mark))
-      (liece-command-enter-message)
-      (set-buffer liece-command-buffer))
-    (push-mark opoint t)))
-
 (defun liece-command-yank-send (&optional arg)
   "Send message from yank buffer.
 Prefix argument ARG is regarded as distance from yank pointer."
@@ -1048,10 +925,10 @@ Argument ARG is prefix argument of toggle status."
       (if current-prefix-arg
          ;; prefixed, ask where to continue
          (if (eq liece-command-buffer-mode 'chat)
-             (liece-minibuffer-completing-default-read
+             (liece-minibuffer-completing-read
               (_ "Return to channel: ")
               (append liece-channel-alist liece-nick-alist)
-              nil nil liece-current-channel)
+              nil nil nil nil liece-current-channel)
            (completing-read
             (_ "Start private conversation with: ")
             liece-nick-alist nil nil))
@@ -1068,7 +945,6 @@ Argument ARG is prefix argument of toggle status."
   (if (and arg (not (string-equal arg "")))
       (liece-command-join arg))
   (liece-set-channel-indicator)
-  (liece-set-crypt-indicator)
   ;; refresh mode line
   (force-mode-line-update))
 
@@ -1104,6 +980,14 @@ Argument ARG is prefix argument of toggle status."
         (car (delq nil rest))
         chnl))))
       
+(defun liece-command-unread-channel ()
+  "Select unread channel or chat partner."
+  (interactive)
+  (let ((chnl (car liece-channel-unread-list)))
+    (if chnl
+       (liece-switch-to-channel chnl)
+      (liece-message (_ "No unread channel or chat partner.")))))
+
 (defun liece-command-push ()
   "Select next channel or chat partner, and rotate list."
   (interactive)
@@ -1153,9 +1037,7 @@ Argument ARG is prefix argument of toggle status."
     (setq liece-current-chat-partner chnl)
     (liece-set-channel-indicator))
   (save-excursion
-    (run-hook-with-args 'liece-redisplay-buffer-functions chnl))
-  (liece-set-crypt-indicator)
-  t)
+    (run-hook-with-args 'liece-redisplay-buffer-functions chnl)))
 
 (defun liece-switch-to-channel-no (num)
   "Switch the current channel to NUM."
@@ -1175,11 +1057,8 @@ Argument ARG is prefix argument of toggle status."
            (setq liece-current-channel chnl)
            (liece-set-channel-indicator))
          (save-excursion
-           (run-hook-with-args 'liece-redisplay-buffer-functions chnl))
-         (liece-set-crypt-indicator)
-         t)
-      (message "Invalid channel!")
-      nil)))
+           (run-hook-with-args 'liece-redisplay-buffer-functions chnl)))
+      (message "Invalid channel!"))))
 
 (defun liece-command-ping ()
   "Send PING to server."
@@ -1191,8 +1070,8 @@ Argument ARG is prefix argument of toggle status."
   "IsON users NICKS."
   (interactive
    (let (nicks (completion-ignore-case t))
-     (setq nicks (liece-minibuffer-completing-sequential-read
-                 "IsON" 0 liece-nick-alist))
+     (setq nicks (liece-minibuffer-completing-read-multiple
+                 "IsON" liece-nick-alist))
      (list nicks)))
   (liece-send "ISON :%s" (mapconcat #'identity nicks " ")))
 
@@ -1201,8 +1080,8 @@ Argument ARG is prefix argument of toggle status."
   (interactive
    (let (nicks (completion-ignore-case t))
      (setq nicks
-          (liece-minibuffer-completing-sequential-read
-           (_ "Friend") 0
+          (liece-minibuffer-completing-read-multiple
+           (_ "Friend")
            (filter-elements nick liece-nick-alist
              (not (string-list-member-ignore-case
                    (car nick) liece-friends)))))
@@ -1225,16 +1104,6 @@ Argument ARG is prefix argument of toggle status."
          (insert "+ " friend "\n")
        (insert "- " friend "\n")))))
 
-(defun liece-command-userhost (nicks)
-  "Ask for the hostnames of NICKS."
-  (interactive
-   (let (nicks (completion-ignore-case t))
-     (setq nicks (liece-minibuffer-completing-sequential-read
-                 (_ "Userhost nick") 0
-                 (list-to-alist liece-nick-alist)))
-     (list nicks)))
-  (liece-send "USERHOST :%s" (mapconcat 'identity nicks ",")))
-
 (defun liece-command-show-last-kill ()
   "Dig last kill from KILL and show it."
   (interactive)