(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)
(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 ."
(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-read-multiple
- (_ "Assign operational privilege to: ") (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-read-multiple
- (_ "Divest operational privilege from: ") (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-read-multiple
- (_ "Allow to speak: ") (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)
+ (if (= (length run) liece-compress-mode-length)
+ (liece-command-qualify-nicks ?o run (not arg))))
+ (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-read-multiple
- (_ "Forbid to speak: ") (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 " ")))))
+ (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)
+ (if (= (length run) liece-compress-mode-length)
+ (liece-command-qualify-nicks ?v run (not arg))))
+ (when run
+ (liece-command-qualify-nicks ?v run (not arg))))))
(defun liece-command-message (address message)
"Send ADDRESS a private MESSAGE."
(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."
(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-read-multiple
- (_ "Userhost nick")
- (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)