[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 873499ce06 06/25: Allow exemption from flood penalty in erc-backe
From: |
F. Jason Park |
Subject: |
master 873499ce06 06/25: Allow exemption from flood penalty in erc-backend |
Date: |
Thu, 30 Jun 2022 18:29:52 -0400 (EDT) |
branch: master
commit 873499ce065144682852643b7d0e04cd45f7eac3
Author: F. Jason Park <jp@neverwas.me>
Commit: F. Jason Park <jp@neverwas.me>
Allow exemption from flood penalty in erc-backend
* lisp/erc/erc-backend (erc-server-send, erc-server-PING): Change name
of param `forcep' in `erc-server-send' to `force' and change its type
to the union of the symbol `no-penalty' and the set of all other
non-nil values. In `erc-server-PING', use this exemption when calling
`erc-server-send'. This fix was fast tracked and summarily
incorporated into bug#48598 because users of the soju bouncer are all
affected. See update #5 in the bug's email thread under the section
entitled "Riders" for an explanation.
---
lisp/erc/erc-backend.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 13303c71f5..5812fa4139 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -815,11 +815,12 @@ Use DISPLAY-FN to show the results."
(erc-split-line text)))
;; From Circe, with modifications
-(defun erc-server-send (string &optional forcep target)
+(defun erc-server-send (string &optional force target)
"Send STRING to the current server.
-If FORCEP is non-nil, no flood protection is done - the string is
-sent directly. This might cause the messages to arrive in a wrong
-order.
+When FORCE is non-nil, bypass flood protection so that STRING is
+sent directly without modifying the queue. When FORCE is the
+symbol `no-penalty', exempt this round from accumulating a
+timeout penalty.
If TARGET is specified, look up encoding information for that
channel in `erc-encoding-coding-alist' or
@@ -835,11 +836,11 @@ protection algorithm."
(if (erc-server-process-alive)
(erc-with-server-buffer
(let ((str (concat string "\r\n")))
- (if forcep
+ (if force
(progn
- (setq erc-server-flood-last-message
- (+ erc-server-flood-penalty
- erc-server-flood-last-message))
+ (unless (eq force 'no-penalty)
+ (cl-incf erc-server-flood-last-message
+ erc-server-flood-penalty))
(erc-log-irc-protocol str 'outbound)
(condition-case nil
(progn
@@ -1469,7 +1470,7 @@ add things to `%s' instead."
(let ((pinger (car (erc-response.command-args parsed))))
(erc-log (format "PING: %s" pinger))
;; ping response to the server MUST be forced, or you can lose big
- (erc-server-send (format "PONG :%s" pinger) t)
+ (erc-server-send (format "PONG :%s" pinger) 'no-penalty)
(when erc-verbose-server-ping
(erc-display-message
parsed 'error proc
- master updated (a3311dbce0 -> 85c2f3bc3e), F. Jason Park, 2022/06/30
- master 0f52e7ac68 01/25: Rework mutual dependency between erc and erc-backend, F. Jason Park, 2022/06/30
- master c5b78a3379 05/25: Customize displaying of ERC buffers on reconnect, F. Jason Park, 2022/06/30
- master 4ae0707704 03/25: Accept user keyword arg in ERC entry-point commands, F. Jason Park, 2022/06/30
- master a63ed6f78a 04/25: Remove duplicate ERC prompt on reconnect, F. Jason Park, 2022/06/30
- master de53d18a4d 07/25: Don't set erc-server-announced-name unless known, F. Jason Park, 2022/06/30
- master 873499ce06 06/25: Allow exemption from flood penalty in erc-backend,
F. Jason Park <=
- master ecafe1cbb5 10/25: Recognize ASCII and strict CASEMAPPINGs in ERC, F. Jason Park, 2022/06/30
- master 752e860db4 16/25: Address long-standing ERC buffer-naming issues, F. Jason Park, 2022/06/30
- master 85c2f3bc3e 25/25: Update ERC's Info doc with network-ID related changes, F. Jason Park, 2022/06/30
- master 54414ec846 02/25: Initialize erc-server-filter-data in erc-backend, F. Jason Park, 2022/06/30
- master 4e312c07f7 11/25: Make ERC respect spaces in server passwords, F. Jason Park, 2022/06/30
- master 485b84cb7c 08/25: Require erc-networks in erc.el, F. Jason Park, 2022/06/30
- 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