("local" "localhost" 6697))
"IRC networks.")
+(defcustom lirc-allow-ipv6 nil
+ "Set to non-nil to allow use of IPv6.")
+
;;; Faces
;;
(lirc-display-error "Disconnected from server.")
(clrhash lirc-contexts)
(setq lirc-current-context nil)
- (lirc-render-prompt)))
-
+ (lirc-render-prompt)
+ (cancel-timer lirc-ping-timer)))
(defun lirc-start-process (network)
(let* ((row (assoc network lirc-networks))
(host (elt row 1))
- (port (elt row 2)))
+ (port (elt row 2))
+ (flags (seq-drop row 3)))
(make-network-process :name "lirc"
:host host
:service port
+ :family (if lirc-allow-ipv6 nil 'ipv4)
:filter #'lirc-filter
:sentinel #'lirc-sentinel
:nowait nil
- :tls-parameters (cons 'gnutls-x509pki
- (gnutls-boot-parameters
- :type 'gnutls-x509pki
- :hostname host))
+ :tls-parameters (if (memq :notls flags)
+ nil
+ (cons 'gnutls-x509pki
+ (gnutls-boot-parameters
+ :type 'gnutls-x509pki
+ :hostname host)))
:buffer "*lirc*")))
+(defvar lirc-ping-timer nil)
+(defvar lirc-ping-period 60)
+
+(defun lirc-ping-function ()
+ (lirc-send-msg (lirc-msg nil nil "PING" (car (process-contact (get-process "lirc")))))
+ (setq lirc-ping-timer (run-with-timer lirc-ping-period nil #'lirc-ping-function)))
(defun lirc-connect (network)
(if (get-process "lirc")
(setq lirc-current-context nil)
(lirc-start-process network)
(lirc-send-msg (lirc-msg nil nil "USER" lirc-user-name 0 "*" lirc-full-name))
- (lirc-send-msg (lirc-msg nil nil "NICK" lirc-nick)))))
+ (lirc-send-msg (lirc-msg nil nil "NICK" lirc-nick))
+ (setq lirc-ping-timer (run-with-timer lirc-ping-period nil #'lirc-ping-function)))))
+
(defun lirc-send-msg (msg)
(let ((proc (get-process "lirc")))
("366" ; ENDOFNAMES
(lirc-display-notice
- (lirc-as-string (length (lirc-get-context-users lirc-current-context)))
+ (lirc--as-string (length (lirc-get-context-users lirc-current-context)))
" users in " lirc-current-context))
((rx (= 3 (any digit)))