diff options
author | F. Jason Park <jp@neverwas.me> | 2022-07-24 05:14:24 -0700 |
---|---|---|
committer | F. Jason Park <jp@neverwas.me> | 2022-07-27 05:19:09 -0700 |
commit | 075d6bb41089a7ea4bb5353dd70448ed5653261c (patch) | |
tree | fa7cfe4e594c530f425f0143b853c2a7d58ba485 /lisp/erc/erc-dcc.el | |
parent | 4a5499910a114a5e8a8b41e04397c20dec14935b (diff) | |
download | emacs-075d6bb41089a7ea4bb5353dd70448ed5653261c.tar.gz |
Ensure erc-dcc-chat-setup runs in the right buffer
* lisp/erc/erc-dcc.el (erc-dcc-chat-setup): Ensure initialization runs
in the intended buffer regardless of the value of `erc-join-buffer'.
(erc-dcc--send-final-turbo-ack, erc-dcc-get-filter): Rename internal
variable formerly known as `erc-dcc--X-send-final-turbo-ack'.
Diffstat (limited to 'lisp/erc/erc-dcc.el')
-rw-r--r-- | lisp/erc/erc-dcc.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index d0e1848e0eb..5862fba3b81 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -987,7 +987,7 @@ The contents of the BUFFER will then be erased." ;; If people really need this, we can convert it into a proper option. -(defvar erc-dcc--X-send-final-turbo-ack nil +(defvar erc-dcc--send-final-turbo-ack nil "Workaround for maverick turbo senders that only require a final ACK. The only known culprit is WeeChat, with its xfer.network.fast_send option, which is on by default. Leaving this set to nil and calling @@ -1032,7 +1032,7 @@ rather than every 1024 byte block, but nobody seems to care." ;; Some senders want us to hang up. Only observed w. TSEND. ((and (plist-get erc-dcc-entry-data :turbo) (= received-bytes (plist-get erc-dcc-entry-data :size))) - (when erc-dcc--X-send-final-turbo-ack + (when erc-dcc--send-final-turbo-ack (process-send-string proc (erc-pack-int received-bytes))) (delete-process proc)) ((not (or (plist-get erc-dcc-entry-data :turbo) @@ -1182,18 +1182,18 @@ other client." (proc (plist-get entry :peer)) (parent-proc (plist-get entry :parent))) (erc-setup-buffer buffer) - ;; buffer is now the current buffer. - (erc-dcc-chat-mode) - (setq erc-server-process parent-proc) - (setq erc-dcc-from nick) - (setq erc-dcc-entry-data entry) - (setq erc-dcc-unprocessed-output "") - (setq erc-insert-marker (point-max-marker)) - (setq erc-input-marker (make-marker)) - (erc-display-prompt buffer (point-max)) - (set-process-buffer proc buffer) - (add-hook 'kill-buffer-hook #'erc-dcc-chat-buffer-killed nil t) - (run-hook-with-args 'erc-dcc-chat-connect-hook proc) + (with-current-buffer buffer + (erc-dcc-chat-mode) + (setq erc-server-process parent-proc + erc-dcc-from nick + erc-dcc-entry-data entry + erc-dcc-unprocessed-output "" + erc-insert-marker (point-max-marker) + erc-input-marker (make-marker)) + (erc-display-prompt buffer (point-max)) + (set-process-buffer proc buffer) + (add-hook 'kill-buffer-hook #'erc-dcc-chat-buffer-killed nil t) + (run-hook-with-args 'erc-dcc-chat-connect-hook proc)) buffer)) (defun erc-dcc-chat-accept (entry parent-proc) |