diff options
author | F. Jason Park <jp@neverwas.me> | 2021-08-12 03:10:31 -0700 |
---|---|---|
committer | F. Jason Park <jp@neverwas.me> | 2022-06-30 15:03:26 -0700 |
commit | c356f86b51f0e0adc85a9162816cb853b2583a5f (patch) | |
tree | 239c6686f2d578483550282494e0647a47ce3fc6 /lisp/erc/erc-capab.el | |
parent | 485b84cb7c4c61b434273fc25be0a25b84fca31d (diff) | |
download | emacs-c356f86b51f0e0adc85a9162816cb853b2583a5f.tar.gz emacs-c356f86b51f0e0adc85a9162816cb853b2583a5f.tar.bz2 emacs-c356f86b51f0e0adc85a9162816cb853b2583a5f.zip |
Update ISUPPORT handling in ERC
* lisp/erc/erc-backend (erc--isupport-params): Add new variable to
hold a hashmap of parsed `erc-server-parameters' in a more useful
format. But keep `erc-server-parameters' around for public use. We
currently lack dedicated local variables for certain discovered IRC
session properties, such as what prefix characters are supported for
channels, etc. And the truth of this needs querying many times per
second at various points. As such, caching here seems justified but
can be easily removed if deemed otherwise because all ingredients are
internal.
(erc--parse-isupport-value): Add helper function that parses an
ISUPPORT value and returns the component parts with backslash-x hex
escapes removed. This can probably use some streamlining.
(erc--with-memoization): Add compat alias for use in internal ISUPPORT
getter. Should be moved to `erc-compat.el' when that library is fully
reincorporated.
(erc--get-isupport-entry): Add internal getter to look up ISUPPORT
items.
(erc-server-005): Treat `erc-server-response' "command args" field as
read-only. Previously, this field was set to nil after processing,
which was unhelpful to other parts of the library. Also call above
mentioned helper to parse values. And add some bookkeeping to handle
negation.
* lisp/erc/erc-capab.el (erc-capab-identify-send-messages): Use
internal ISUPPORT getter.
* lisp/erc/erc.el (erc-cmd-NICK, erc-parse-prefix,
erc-nickname-in-use): Use internal ISUPPORT getter.
* test/lisp/erc/erc-tests.el: Add tests for the above mentioned
changes in erc-backend.el.
Diffstat (limited to 'lisp/erc/erc-capab.el')
-rw-r--r-- | lisp/erc/erc-capab.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 8d0f40af994..c590b45fd21 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -137,7 +137,7 @@ These arguments are sent to this function when called as a hook in ;; could possibly check for '("IRCD" . "dancer") in ;; `erc-server-parameters' instead of looking for a specific name ;; in `erc-server-version' - (assoc "CAPAB" erc-server-parameters)) + (erc--get-isupport-entry 'CAPAB)) (erc-log "Sending CAPAB IDENTIFY-MSG and IDENTIFY-CTCP") (erc-server-send "CAPAB IDENTIFY-MSG") (erc-server-send "CAPAB IDENTIFY-CTCP") |