Function: erc-server-TOPIC

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

Signature

(erc-server-TOPIC PROC PARSED)

Documentation

The channel topic has changed.

Handler for a TOPIC 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-TOPIC-functions instead.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-backend.el.gz
(define-erc-response-handler (TOPIC)
  "The channel topic has changed." nil
  (let* ((ch (car (erc-response.command-args parsed)))
         (topic (erc-trim-string (erc-response.contents parsed)))
         (time (format-time-string erc-server-timestamp-format)))
    (pcase-let ((`(,nick ,login ,host)
                 (erc-parse-user (erc-response.sender parsed))))
      (erc-update-channel-member ch nick nick nil nil nil nil nil nil host login)
      (erc-update-channel-topic ch (format "%s\C-o (%s, %s)" topic nick time))
      (erc-display-message parsed 'notice (erc-get-buffer ch proc)
                           'TOPIC ?n nick ?u login ?h host
                           ?c ch ?T topic))))