(defun lurk-get-context-users (name)
(gethash name lurk-contexts))
+(defun lurk-context-known-p (name)
+ (not (eq (gethash name lurk-contexts 0) 0)))
+
(defun lurk-add-context-users (context users)
(puthash context
- (append users
- (gethash context lurk-contexts))
+ (cl-union users
+ (gethash context lurk-contexts))
lurk-contexts))
(defun lurk-del-context-user (context user)
(let* ((params (lurk-msg-params msg))
(channel (elt params 2))
(names (split-string (elt params 3))))
- (lurk-add-context-users channel names)))
+ (if (lurk-context-known-p channel)
+ (lurk-add-context-users channel names)
+ (lurk-display-notice nil "Users in " channel ": " (string-join names " ")))))
("366" ; ENDOFNAMES
(let* ((params (lurk-msg-params msg))
(channel (elt params 1)))
- (lurk-display-notice
- channel
- (lurk--as-string (length (lurk-get-context-users channel)))
- " users in " channel)))
+ (if (lurk-context-known-p channel)
+ (lurk-display-notice
+ channel
+ (lurk--as-string (length (lurk-get-context-users channel)))
+ " users in " channel)
+ (lurk-display-notice nil "End of " channel " names list."))))
("331"
(let* ((params (lurk-msg-params msg))