aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali2021-09-29 22:15:07 -0400
committerAmin Bandali2021-09-29 22:17:18 -0400
commit9fc1fdcbf330b0a85cd019bb75afcb8d36243524 (patch)
tree6b96d903cc4349423a2ddb678b1b5c4c1e90252d
parent758753431af51f7ac79a55d426b915443e66a077 (diff)
downloademacs-9fc1fdcbf330b0a85cd019bb75afcb8d36243524.tar.gz
emacs-9fc1fdcbf330b0a85cd019bb75afcb8d36243524.zip
Restore the previous order of ERC's '/whois' arguments
* 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.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/erc/erc.el29
2 files changed, 18 insertions, 16 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 25164d53642..d57f67ea400 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2881,11 +2881,6 @@ The new '/opme' convenience command asks ChanServ to set the operator
2881status for the current nick in the current channel, and '/deopme' 2881status for the current nick in the current channel, and '/deopme'
2882unsets it. 2882unsets it.
2883 2883
2884---
2885*** Fix the order of '/whois' arguments sent to the server.
2886Per RFC 1459 and RFC 2812, when given, the optional 'server' argument
2887for the WHOIS command must come before the 'user' argument, not after.
2888
2889** xwidget-webkit mode 2884** xwidget-webkit mode
2890 2885
2891--- 2886---
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 7fa2d37c9f2..ccb1f63bc39 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3298,17 +3298,24 @@ a script after exceeding the flood threshold."
3298 t) 3298 t)
3299 (t nil))) 3299 (t nil)))
3300 3300
3301(defun erc-cmd-WHOIS (user &optional server) 3301(defun erc-cmd-WHOIS (nick-or-server &optional nick-if-server)
3302 "Display whois information for USER. 3302 "Display whois information for the given user.
3303 3303
3304If SERVER is non-nil, use that, rather than the current server. 3304If NICK-IF-SERVER is nil, NICK-OR-SERVER should be the nick of
3305This is useful for getting the time USER has been idle for, if 3305the user about whom the whois information is to be requested.
3306USER is on a different server of the network than the current 3306Otherwise, if NICK-IF-SERVER is non-nil, NICK-OR-SERVER should be
3307user, since only the server the user is connected to knows this 3307the server to which the user with the nick NICK-IF-USER is
3308information." 3308connected to.
3309 (let ((send (if server 3309
3310 (format "WHOIS %s %s" server user) 3310Specifying the server NICK-OR-SERVER that the nick NICK-IF-SERVER
3311 (format "WHOIS %s" user)))) 3311is connected to is useful for getting the time the NICK-IF-SERVER
3312user has been idle for, when the user NICK-IF-SERVER is connected
3313to a different server of the network than the one current user is
3314connected to, since only the server a user is connected to knows
3315the idle time of that user."
3316 (let ((send (if nick-if-server
3317 (format "WHOIS %s %s" nick-or-server nick-if-server)
3318 (format "WHOIS %s" nick-or-server))))
3312 (erc-log (format "cmd: %s" send)) 3319 (erc-log (format "cmd: %s" send))
3313 (erc-server-send send) 3320 (erc-server-send send)
3314 t)) 3321 t))