* riece-commands.el (riece-command-kick-with-ban): New command.
authorueno <ueno>
Sun, 19 Aug 2007 06:18:13 +0000 (06:18 +0000)
committerueno <ueno>
Sun, 19 Aug 2007 06:18:13 +0000 (06:18 +0000)
lisp/ChangeLog
lisp/riece-commands.el
lisp/riece-mcat-japanese.el

index 76295e9..5bd8996 100644 (file)
@@ -1,3 +1,7 @@
+2007-08-19  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-commands.el (riece-command-kick-with-ban): New command.
+
 2007-06-21  Nikita Danilov <nikita@clusterfs.com>
 
        * riece-000.el (riece-handle-001-message): Run
index 8efa507..60f4c60 100644 (file)
@@ -234,6 +234,39 @@ the layout to the selected layout-name."
             user))
    riece-current-channel))
 
+(defun riece-command-kick-with-ban (user pattern &optional message)
+  (interactive
+   (let ((completion-ignore-case t)
+        users patterns)
+     (riece-check-channel-commands-are-usable t)
+     (riece-with-server-buffer (riece-identity-server riece-current-channel)
+       (setq users (riece-channel-get-users (riece-identity-prefix
+                                            riece-current-channel))
+            patterns (mapcar
+                      (lambda (user)
+                        (list (concat (car user) "!"
+                                      (riece-user-get-user-at-host
+                                       (car user)))))
+                      users)))
+     (list
+      (completing-read (riece-mcat "Kick user: ") users)
+      (completing-read (riece-mcat "Ban pattern: ") patterns)
+      (if current-prefix-arg
+         (read-string "Message: ")))))
+  (riece-send-string (format "MODE %s :+b %s\r\n"
+                            (riece-identity-prefix riece-current-channel)
+                            pattern)
+                    riece-current-channel)
+  (riece-send-string
+   (if message
+       (format "KICK %s %s :%s\r\n"
+              (riece-identity-prefix riece-current-channel)
+              user message)
+     (format "KICK %s %s\r\n"
+            (riece-identity-prefix riece-current-channel)
+            user))
+   riece-current-channel))
+
 (defun riece-command-names (pattern)
   (interactive
    (let ((completion-ignore-case t))
index fa60382..d73d32c 100644 (file)
@@ -64,6 +64,7 @@
     ("Add-on: " . "\e$B%"%I%*%s\e(B: ")
     ("Already registered" . "\e$BEPO?:Q$_$G$9\e(B")
     ("Away message: " . "\e$BN%@J$N%a%C%;!<%8\e(B: ")
+    ("Ban pattern: " . "\e$BN)F~6X;_%Q%?!<%s\e(B: ")
     ("Beginning of buffer" . "\e$B%P%C%U%!$N@hF,$G$9\e(B")
     ("CTCP CLIENTINFO for %s (%s) = %s" . "%s (%s) \e$B$N\e(B CTCP CLIENTINFO = %s")
     ("CTCP CLIENTINFO from %s (%s) to %s" . "%s (%s) \e$B$,\e(B %s \e$B$K\e(B CTCP CLIENTINFO")