The Lambda Lab
/
projects
/
lurk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6a48707
)
Improved PART handling.
author
Tim Vaughan
<plugd@thelambdalab.xyz>
Mon, 21 Jun 2021 10:01:51 +0000
(12:01 +0200)
committer
Tim Vaughan
<plugd@thelambdalab.xyz>
Mon, 21 Jun 2021 10:01:51 +0000
(12:01 +0200)
lirc.el
patch
|
blob
|
history
diff --git
a/lirc.el
b/lirc.el
index
0767a46
..
5244c2f
100644
(file)
--- a/
lirc.el
+++ b/
lirc.el
@@
-379,10
+379,12
@@
portion of the source component of the message, as LIRC doesn't use this.")
((and "PART"
(guard (equal lirc-nick (lirc-msg-src msg))))
((and "PART"
(guard (equal lirc-nick (lirc-msg-src msg))))
- (lirc-display-notice "Left channel " lirc-current-channel)
- (setq lirc-current-channel nil)
- (lirc-del-channel (car (lirc-msg-params msg)))
- (lirc-render-prompt))
+ (let ((channel (car (lirc-msg-params msg))))
+ (lirc-display-notice "Left channel " channel)
+ (lirc-del-channel (car (lirc-msg-params msg)))
+ (when (equal lirc-current-channel channel)
+ (setq lirc-current-channel nil)
+ (lirc-render-prompt))))
("PART"
(let ((channel (car (lirc-msg-params msg)))
("PART"
(let ((channel (car (lirc-msg-params msg)))
@@
-470,8
+472,12
@@
portion of the source component of the message, as LIRC doesn't use this.")
(list nick "\01VERSION\01")))
(lirc-display-notice "CTCP version request sent to " nick))
(list nick "\01VERSION\01")))
(lirc-display-notice "CTCP version request sent to " nick))
- ((rx "PART")
- (lirc-send-msg (lirc-msg nil nil "PART" lirc-current-channel)))
+ ((rx "PART" (opt (: " " (let channel (* not-newline)))))
+ (if (or lirc-current-channel channel)
+ (lirc-send-msg (lirc-msg nil nil "PART" (if channel
+ channel
+ lirc-current-channel)))
+ (lirc-display-error "No current channel to leave.")))
((rx "MSG "
(let target (* (not whitespace)))
((rx "MSG "
(let target (* (not whitespace)))
@@
-488,8
+494,11
@@
portion of the source component of the message, as LIRC doesn't use this.")
nil)))))
(unless (string-empty-p string)
nil)))))
(unless (string-empty-p string)
- (lirc-send-msg (lirc-msg nil nil "PRIVMSG" lirc-current-channel string))
- (lirc-display-message lirc-current-channel lirc-nick string))))
+ (if lirc-current-channel
+ (progn
+ (lirc-send-msg (lirc-msg nil nil "PRIVMSG" lirc-current-channel string))
+ (lirc-display-message lirc-current-channel lirc-nick string))
+ (lirc-display-error "No current channel.")))))
(defun lirc-enter ()
"Enter current contents of line after prompt."
(defun lirc-enter ()
"Enter current contents of line after prompt."