]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore the previous order of ERC's '/whois' arguments
authorAmin Bandali <bandali@gnu.org>
Thu, 30 Sep 2021 02:15:07 +0000 (22:15 -0400)
committerAmin Bandali <bandali@gnu.org>
Thu, 30 Sep 2021 02:17:18 +0000 (22:17 -0400)
* etc/NEWS: Remove unneeded entry.
* lisp/erc/erc.el (erc-cmd-WHOIS): Restore the previous order of
arguments sent to the server, so that there's no change in the
function's behavior.  Instead, rename the arguments to be more
accurate, and expand upon them in the doc string.

etc/NEWS
lisp/erc/erc.el

index 25164d536422b4b50ca2e327b3f67252ce729156..d57f67ea400c6ed3a04c2f7d8933a64795dc950e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2881,11 +2881,6 @@ The new '/opme' convenience command asks ChanServ to set the operator
 status for the current nick in the current channel, and '/deopme'
 unsets it.
 
----
-*** Fix the order of '/whois' arguments sent to the server.
-Per RFC 1459 and RFC 2812, when given, the optional 'server' argument
-for the WHOIS command must come before the 'user' argument, not after.
-
 ** xwidget-webkit mode
 
 ---
index 7fa2d37c9f2990cea83507f4ffda7fa36bbea5a4..ccb1f63bc3964674d2090ed7fd75c76f5a6e0952 100644 (file)
@@ -3298,17 +3298,24 @@ a script after exceeding the flood threshold."
     t)
    (t nil)))
 
-(defun erc-cmd-WHOIS (user &optional server)
-  "Display whois information for USER.
-
-If SERVER is non-nil, use that, rather than the current server.
-This is useful for getting the time USER has been idle for, if
-USER is on a different server of the network than the current
-user, since only the server the user is connected to knows this
-information."
-  (let ((send (if server
-                  (format "WHOIS %s %s" server user)
-                (format "WHOIS %s" user))))
+(defun erc-cmd-WHOIS (nick-or-server &optional nick-if-server)
+  "Display whois information for the given user.
+
+If NICK-IF-SERVER is nil, NICK-OR-SERVER should be the nick of
+the user about whom the whois information is to be requested.
+Otherwise, if NICK-IF-SERVER is non-nil, NICK-OR-SERVER should be
+the server to which the user with the nick NICK-IF-USER is
+connected to.
+
+Specifying the server NICK-OR-SERVER that the nick NICK-IF-SERVER
+is connected to is useful for getting the time the NICK-IF-SERVER
+user has been idle for, when the user NICK-IF-SERVER is connected
+to a different server of the network than the one current user is
+connected to, since only the server a user is connected to knows
+the idle time of that user."
+  (let ((send (if nick-if-server
+                  (format "WHOIS %s %s" nick-or-server nick-if-server)
+                (format "WHOIS %s" nick-or-server))))
     (erc-log (format "cmd: %s" send))
     (erc-server-send send)
     t))