Function: rcirc-handler-CTCP

rcirc-handler-CTCP is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc-handler-CTCP PROCESS TARGET SENDER TEXT)

Documentation

Handle Client-To-Client-Protocol message TEXT.

The message is addressed from SENDER to TARGET. Attempt to find an appropriate handler, by invoicing the function rcirc-handler-ctcp-REQUEST, where REQUEST is the message type as extracted from TEXT. If no handler was found, an error message will be printed. PROCESS is the process object for the current connection.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc-handler-CTCP (process target sender text)
  "Handle Client-To-Client-Protocol message TEXT.
The message is addressed from SENDER to TARGET.  Attempt to find
an appropriate handler, by invoicing the function
`rcirc-handler-ctcp-REQUEST', where REQUEST is the message type
as extracted from TEXT.  If no handler was found, an error
message will be printed.  PROCESS is the process object for the
current connection."
  (if (string-match "^\\([^ ]+\\) *\\(.*\\)$" text)
      (let* ((request (upcase (match-string 1 text)))
             (args (match-string 2 text))
             (handler (intern-soft (concat "rcirc-handler-ctcp-" request))))
        (if (not (fboundp handler))
            (rcirc-print process sender "ERROR" target
                         (format "%s sent unsupported ctcp: %s" sender text)
                         t)
          (funcall handler process target sender args)
          (unless (or (string= request "ACTION")
                      (string= request "KEEPALIVE"))
            (rcirc-print process sender "CTCP" target
                         (format "%s" text) t))))))