"IRC networks."
:type '(alist :key-type string))
+(defcustom murk-show-joins nil
+ "Set to non-nil to be notified of joins, parts and quits.")
+
(defcustom murk-display-header t
"If non-nil, use buffer header to display current host and channel."
:type '(boolean))
ctx
(cl-union users (murk-context-users ctx))))
+(defun murk-del-context-user (ctx user)
+ (murk-set-context-users
+ ctx
+ (delete user (murk-context-users ctx))))
+
;;; Buffer
;;
"Joining channel " channel " on " server)
(murk-render-prompt)))
+ ("JOIN"
+ (let* ((channel (car (murk-msg-params msg)))
+ (nick (murk-msg-src msg))
+ (ctx (murk-get-context server channel)))
+ (murk-add-context-users ctx (list nick))
+ (if murk-show-joins
+ (murk-display-notice ctx nick " joined channel " channel
+ " on " server))))
+
((and "PART"
(guard (equal (murk-connection-nick server)
(murk-msg-src msg))))
(murk-remove-context (list server channel))
(murk-render-prompt)))
+ ("PART"
+ (let* ((channel (car (lurk-msg-params msg)))
+ (nick (lurk-msg-src msg))
+ (ctx (murk-get-context server channel)))
+ (murk-del-context-user ctx nick)
+ (if murk-show-joins
+ (murk-display-notice ctx nick " left channel " channel
+ " on " server))))
+
("QUIT"
(let ((nick (murk-msg-src msg))
(reason (mapconcat 'identity (murk-msg-params msg) " ")))
(defvar murk-command-table
'(("DEBUG" "Toggle debug mode on/off." murk-command-debug murk-boolean-completions)
("HEADER" "Toggle display of header." murk-command-header murk-boolean-completions)
+ ("SHOWJOINS" "Toggles display of joins/parts." murk-command-showjoins murk-boolean-completions)
("NETWORKS" "List known IRC networks." murk-command-networks)
("CONNECT" "Connect to an IRC network." murk-command-connect murk-network-completions)
("QUIT" "Disconnect from current network." murk-command-quit)
(setq-local header-line-format nil)
(murk-display-notice nil "Header disabled.")))
+(defun murk-command-showjoins (params)
+ (setq murk-show-joins
+ (if params
+ (if (equal (upcase (car params)) "ON")
+ t
+ nil)
+ (not murk-show-joins)))
+ (murk-display-notice nil "Joins/parts will now be "
+ (if murk-show-joins "shown" "hidden") "."))
+
(defun murk-command-clear (params)
(if (not params)
(murk-clear-buffer)