Function: erc-server-396

erc-server-396 is a byte-compiled function defined in erc-backend.el.gz.

Signature

(erc-server-396 PROC PARSED)

Documentation

RPL_VISIBLEHOST or RPL_YOURDISPLAYHOST or RPL_HOSTHIDDEN.

Handler for a 396 server response. PROC is the server process which returned the response. PARSED is the actual response as an erc-response struct. If you want to add responses don't modify this function, but rather add things to erc-server-396-functions instead.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
;; https://defs.ircdocs.horse/defs/numerics.html#rpl-visiblehost-396
;; As of ERC 5.6, if the client hasn't yet joined any channels,
;; there's a good chance a server user for the current nick simply
;; doesn't exist (and there's not enough info in this reply to create
;; one).  To fix this, ERC could WHO itself on 372 or similar if it
;; hasn't yet received a 900.
(define-erc-response-handler (396)
  "RPL_VISIBLEHOST or RPL_YOURDISPLAYHOST or RPL_HOSTHIDDEN." nil
  (pcase-let* ((userhost (cadr (erc-response.command-args parsed)))
               ;; Behavior blindly copied from event_hosthidden in irssi 1.4.
               (rejectrx (rx (| (: bot (in ?@ ?: ?-)) (in ?* ?? ?! ?# ?& ?\s)
                                (: ?- eot))))
               (`(,_ ,user ,host) (and (not (string-match rejectrx userhost))
                                       (erc--parse-nuh userhost))))
    (when host
      (erc-update-user-nick (erc-current-nick) nil host user)
      (erc-display-message parsed 'notice 'active 's396 ?s userhost))))