diff options
| author | Amin Bandali | 2021-09-29 22:15:07 -0400 |
|---|---|---|
| committer | Amin Bandali | 2021-09-29 22:17:18 -0400 |
| commit | 9fc1fdcbf330b0a85cd019bb75afcb8d36243524 (patch) | |
| tree | 6b96d903cc4349423a2ddb678b1b5c4c1e90252d | |
| parent | 758753431af51f7ac79a55d426b915443e66a077 (diff) | |
| download | emacs-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/NEWS | 5 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 29 |
2 files changed, 18 insertions, 16 deletions
| @@ -2881,11 +2881,6 @@ The new '/opme' convenience command asks ChanServ to set the operator | |||
| 2881 | status for the current nick in the current channel, and '/deopme' | 2881 | status for the current nick in the current channel, and '/deopme' |
| 2882 | unsets it. | 2882 | unsets it. |
| 2883 | 2883 | ||
| 2884 | --- | ||
| 2885 | *** Fix the order of '/whois' arguments sent to the server. | ||
| 2886 | Per RFC 1459 and RFC 2812, when given, the optional 'server' argument | ||
| 2887 | for 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 | ||
| 3304 | If SERVER is non-nil, use that, rather than the current server. | 3304 | If NICK-IF-SERVER is nil, NICK-OR-SERVER should be the nick of |
| 3305 | This is useful for getting the time USER has been idle for, if | 3305 | the user about whom the whois information is to be requested. |
| 3306 | USER is on a different server of the network than the current | 3306 | Otherwise, if NICK-IF-SERVER is non-nil, NICK-OR-SERVER should be |
| 3307 | user, since only the server the user is connected to knows this | 3307 | the server to which the user with the nick NICK-IF-USER is |
| 3308 | information." | 3308 | connected to. |
| 3309 | (let ((send (if server | 3309 | |
| 3310 | (format "WHOIS %s %s" server user) | 3310 | Specifying the server NICK-OR-SERVER that the nick NICK-IF-SERVER |
| 3311 | (format "WHOIS %s" user)))) | 3311 | is connected to is useful for getting the time the NICK-IF-SERVER |
| 3312 | user has been idle for, when the user NICK-IF-SERVER is connected | ||
| 3313 | to a different server of the network than the one current user is | ||
| 3314 | connected to, since only the server a user is connected to knows | ||
| 3315 | the 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)) |