[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/rcirc-update f6e18c6 13/18: Implement invite-notify capability
From: |
Philip Kaludercic |
Subject: |
feature/rcirc-update f6e18c6 13/18: Implement invite-notify capability |
Date: |
Thu, 10 Jun 2021 11:43:40 -0400 (EDT) |
branch: feature/rcirc-update
commit f6e18c63a63fdac0d6abc6a6f68d670ab2923269
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Implement invite-notify capability
* rcirc.el (rcirc-implemented-capabilities): Add invite-notify
(rcirc-handler-INVITE): Handle invite notifications
---
lisp/net/rcirc.el | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 60cafd4..b3b70a6 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -580,6 +580,7 @@ See `rcirc-connect' for more details on these variables.")
"server-time"
;https://ircv3.net/specs/extensions/server-time
"batch"
;https://ircv3.net/specs/extensions/batch
"message-ids"
;https://ircv3.net/specs/extensions/message-ids
+ "invite-notify"
;https://ircv3.net/specs/extensions/invite-notify
)
"A list of capabilities that rcirc supports.")
(defvar-local rcirc-requested-capabilities nil
@@ -3247,11 +3248,21 @@ Passwords are stored in `rcirc-authinfo' (which see)."
(format "AUTH %s %s" nick (car args))))))))))
(defun rcirc-handler-INVITE (process sender args _text)
- "Notify user of an invitation.
-SENDER and ARGS (in concatenated form) are passed on to
-`rcirc-print'. PROCESS is the process object for the current
-connection."
- (rcirc-print process sender "INVITE" nil (mapconcat 'identity args " ") t))
+ "Notify user of an invitation from SENDER.
+ARGS should have the form (TARGET CHANNEL). PROCESS is the
+process object for the current connection."
+ (let ((self (buffer-local-value 'rcirc-nick rcirc-process))
+ (target (car args))
+ (chan (cadr args)))
+ (if (string= target self)
+ (rcirc-print process sender "INVITE" nil
+ (format "%s invited you to %s"
+ sender chan)
+ t)
+ (rcirc-print process sender "INVITE" chan
+ (format "%s invited %s"
+ sender target)
+ t))))
(defun rcirc-handler-ERROR (process sender args _text)
"Print a error message.
- branch feature/rcirc-update created (now fd96e3a), Philip Kaludercic, 2021/06/10
- feature/rcirc-update c6b6c2d 02/18: Use auth-source for user-passwords, Philip Kaludercic, 2021/06/10
- feature/rcirc-update fb15875 03/18: Fix checkdoc complaints and related issues, Philip Kaludercic, 2021/06/10
- feature/rcirc-update c300326 12/18: Add TAGMSG handler, Philip Kaludercic, 2021/06/10
- feature/rcirc-update fd96e3a 18/18: Allow hiding certain message types after reconnecting, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 8ea5766 05/18: Recognize quoted commands in rcirc-process-input-line, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 06af44e 08/18: Create framework for IRCv3 support, Philip Kaludercic, 2021/06/10
- feature/rcirc-update ab49a9a 10/18: Implement batch extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update f6e18c6 13/18: Implement invite-notify capability,
Philip Kaludercic <=
- feature/rcirc-update 567e288 11/18: Implement message-ids extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 95fdd4b 14/18: Allow filtering how nicks are presented, Philip Kaludercic, 2021/06/10
- feature/rcirc-update b67b1ee 15/18: Fix prompt doubling when reconnecting, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 6898816 01/18: Default to libera instead of freenode, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 0b367ec 06/18: Remove custom rcirc-completion implementation, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 4ff1f66 07/18: Replace defun-rcirc-command with rcirc-define-command, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 849e71f 09/18: Implement server-time extension, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 3a61e7b 17/18: Use defvar-local instead of setq-local where applicable, Philip Kaludercic, 2021/06/10
- feature/rcirc-update 13f6f78 16/18: Allow for optional arguments using rcirc-define-command, Philip Kaludercic, 2021/06/10
- feature/rcirc-update e6c99a7 04/18: Integrate formatting into rcirc-send-string, Philip Kaludercic, 2021/06/10