[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a9d89d083a 22/25: Fix regression in erc-send-input-line
From: |
F. Jason Park |
Subject: |
master a9d89d083a 22/25: Fix regression in erc-send-input-line |
Date: |
Thu, 30 Jun 2022 18:29:54 -0400 (EDT) |
branch: master
commit a9d89d083ac5bf0b9fd5568d42e565aba0b6e13f
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Fix regression in erc-send-input-line
* lisp/erc/erc.el (erc-send-input-line): Restore remedial single-space
padding to ensure empty messages typed at the prompt without an
explicit /msg aren't rejected by the server. This behavior is only
noticeable when `erc-send-whitespace-lines' is active.
* test/lisp/erc/erc-tests.el (erc-process-input-line): Add trailing
newline to more correctly simulate how it's actually called by
`erc-send-input'. (Bug#50008)
---
lisp/erc/erc.el | 2 ++
test/lisp/erc/erc-tests.el | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 1c221a9cb1..971d3f426f 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -2992,6 +2992,8 @@ for special purposes (see erc-dcc.el).")
(defun erc-send-input-line (target line &optional force)
"Send LINE to TARGET."
+ (when (string= line "\n")
+ (setq line " \n"))
(erc-message "PRIVMSG" (concat target " " line) force))
(defun erc-get-arglist (fun)
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 618d7eeea0..afe9cc7b8c 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -643,19 +643,19 @@
(ert-info ("Implicit cmd via `erc-send-input-line-function'")
(ert-info ("Baseline")
- (erc-process-input-line "hi")
+ (erc-process-input-line "hi\n")
(should (equal (pop erc-server-flood-queue)
'("PRIVMSG #chan :hi\r\n" . utf-8))))
(ert-info ("Spaces preserved")
- (erc-process-input-line "hi you")
+ (erc-process-input-line "hi you\n")
(should (equal (pop erc-server-flood-queue)
'("PRIVMSG #chan :hi you\r\n" . utf-8))))
- (ert-info ("Empty line transmitted without injected-space kludge")
- (erc-process-input-line "")
+ (ert-info ("Empty line transmitted with injected-space kludge")
+ (erc-process-input-line "\n")
(should (equal (pop erc-server-flood-queue)
- '("PRIVMSG #chan :\r\n" . utf-8))))
+ '("PRIVMSG #chan : \r\n" . utf-8))))
(should-not calls))))))
- master c356f86b51 09/25: Update ISUPPORT handling in ERC, (continued)
- master c356f86b51 09/25: Update ISUPPORT handling in ERC, F. Jason Park, 2022/06/30
- master 1c24af0fcb 12/25: Add helper to determine local channels in ERC, F. Jason Park, 2022/06/30
- master 529e46f128 13/25: Add eventual replacement for erc-default-recipients, F. Jason Park, 2022/06/30
- master 1767b0bd7e 19/25: Don't call erc-auto-query twice on PRIVMSG, F. Jason Park, 2022/06/30
- master 7c47d6c52d 18/25: Register erc-kill-buffer-function locally, F. Jason Park, 2022/06/30
- master 10237840d0 24/25: Optionally prevent sending multiline input in ERC, F. Jason Park, 2022/06/30
- master 9be08ceb31 15/25: Add ERC test server and related resources, F. Jason Park, 2022/06/30
- master 922ad23840 17/25: Add user-oriented test scenarios for ERC, F. Jason Park, 2022/06/30
- master e958a2b726 14/25: Discourage ill-defined use of buffer targets in ERC, F. Jason Park, 2022/06/30
- master 959fbcf34b 20/25: Favor network identities in erc-join, F. Jason Park, 2022/06/30
- master a9d89d083a 22/25: Fix regression in erc-send-input-line,
F. Jason Park <=
- master 0590224343 21/25: Standardize auth-source queries in ERC, F. Jason Park, 2022/06/30
- master f46547294d 23/25: Improve ERC's handling of multiline prompt input, F. Jason Park, 2022/06/30