emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/rcirc-update 354929a 6/7: Implement standard-replies capability


From: Philip Kaludercic
Subject: feature/rcirc-update 354929a 6/7: Implement standard-replies capability
Date: Mon, 6 Sep 2021 17:30:18 -0400 (EDT)

branch: feature/rcirc-update
commit 354929a85a292137256b3abbca6c2983dd93dee3
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Implement standard-replies capability
    
    * rcirc.el (rcirc-implemented-capabilities): Add standard-replies to list
    (rcirc-response-formats): Add response formats for WARN, FAIL and NOTE
    (rcirc-handler-FAIL): Add handler
    (rcirc-handler-WARN): Add handler
    (rcirc-handler-NOTE): Add handler
---
 lisp/net/rcirc.el | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index a819fb8..0315d71 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -607,6 +607,7 @@ See `rcirc-connect' for more details on these variables.")
     "invite-notify"                     
;https://ircv3.net/specs/extensions/invite-notify
     "sasl"                              
;https://ircv3.net/specs/extensions/sasl-3.1
     "multi-prefix"                      
;https://ircv3.net/specs/extensions/multi-prefix
+    "standard-replies"                  
;https://ircv3.net/specs/extensions/standard-replies
     )
   "A list of capabilities that rcirc supports.")
 (defvar-local rcirc-requested-capabilities nil
@@ -1639,6 +1640,9 @@ extracted."
     ("ACTION"  . "[%N %m]")
     ("COMMAND" . "%m")
     ("ERROR"   . "%fw!!! %m")
+    ("FAIL"   . "(%fwFAIL%f-) %m")
+    ("WARN"   . "(%fwWARN%f-) %m")
+    ("NOTE"   . "(%fwNOTE%f-) %m")
     (t         . "%fp*** %fs%n %r %m"))
   "An alist of formats used for printing responses.
 The format is looked up using the response-type as a key;
@@ -3565,6 +3569,27 @@ process object for the current connection."
     (rcirc-send-string process "CAP" "END"))
   (rcirc-join-channels-post-auth process))
 
+(defun rcirc-handler-FAIL (process _sender args _text)
+  "Display a FAIL message, as indicated by ARGS.
+PROCESS is the process object for the current connection."
+  (rcirc-print process nil "FAIL" nil
+               (mapconcat #'identity args " ")
+               t))
+
+(defun rcirc-handler-WARN (process _sender args _text)
+  "Display a WARN message, as indicated by ARGS.
+PROCESS is the process object for the current connection."
+  (rcirc-print process nil "WARN" nil
+               (mapconcat #'identity args " ")
+               t))
+
+(defun rcirc-handler-NOTE (process _sender args _text)
+  "Display a NOTE message, as indicated by ARGS.
+PROCESS is the process object for the current connection."
+  (rcirc-print process nil "NOTE" nil
+               (mapconcat #'identity args " ")
+               t))
+
 
 (defgroup rcirc-faces nil
   "Faces for rcirc."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]