Commit 7608c40c authored by Romain Francoise's avatar Romain Francoise

(url-irc-rcirc, url-irc-erc): New functions.

(url-irc-function): Add rcirc and ERC to the list of IRC clients.
Default to rcirc, since ZenIRC isn't part of Emacs.
parent 8d214091
2006-03-27 Romain Francoise <romain@orebokech.com>
* url-irc.el (url-irc-rcirc, url-irc-erc): New functions.
(url-irc-function): Add rcirc and ERC to the list of IRC clients.
Default to rcirc, since ZenIRC isn't part of Emacs.
2006-03-07 Stefan Monnier <monnier@iro.umontreal.ca> 2006-03-07 Stefan Monnier <monnier@iro.umontreal.ca>
* url-http.el (url-http-find-free-connection): Fix braino in last fix. * url-http.el (url-http-find-free-connection): Fix braino in last fix.
......
...@@ -33,15 +33,17 @@ ...@@ -33,15 +33,17 @@
(defconst url-irc-default-port 6667 "Default port for IRC connections") (defconst url-irc-default-port 6667 "Default port for IRC connections")
(defcustom url-irc-function 'url-irc-zenirc (defcustom url-irc-function 'url-irc-rcirc
"*Function to actually open an IRC connection. "*Function to actually open an IRC connection.
Should be a function that takes several argument: Should be a function that takes several arguments:
HOST - the hostname of the IRC server to contact HOST - the hostname of the IRC server to contact
PORT - the port number of the IRC server to contact PORT - the port number of the IRC server to contact
CHANNEL - What channel on the server to visit right away (can be nil) CHANNEL - What channel on the server to visit right away (can be nil)
USER - What username to use USER - What username to use
PASSWORD - What password to use" PASSWORD - What password to use"
:type '(choice (const :tag "ZEN IRC" :value 'url-irc-zenirc) :type '(choice (const :tag "rcirc" :value url-irc-rcirc)
(const :tag "ERC" :value url-irc-erc)
(const :tag "ZEN IRC" :value url-irc-zenirc)
(function :tag "Other")) (function :tag "Other"))
:group 'url) :group 'url)
...@@ -59,6 +61,16 @@ PASSWORD - What password to use" ...@@ -59,6 +61,16 @@ PASSWORD - What password to use"
(insert "/join " channel) (insert "/join " channel)
(zenirc-send-line)))) (zenirc-send-line))))
(defun url-irc-rcirc (host port channel user password)
(let ((chan (when channel (concat "#" channel))))
(rcirc-connect host port user nil nil (when chan (list chan)))
(when chan
(switch-to-buffer (concat chan "@" host)))))
(defun url-irc-erc (host port channel user password)
(erc-select :server host :port port :nick user :password password)
(erc-join-channel channel))
;;;###autoload ;;;###autoload
(defun url-irc (url) (defun url-irc (url)
(let* ((host (url-host url)) (let* ((host (url-host url))
...@@ -74,7 +86,7 @@ PASSWORD - What password to use" ...@@ -74,7 +86,7 @@ PASSWORD - What password to use"
(setq chan nil)) (setq chan nil))
(funcall url-irc-function host port chan user pass) (funcall url-irc-function host port chan user pass)
nil)) nil))
(provide 'url-irc) (provide 'url-irc)
;;; arch-tag: 2e5eecf8-9eb3-436b-9fbd-c26f2fb2bf3e ;;; arch-tag: 2e5eecf8-9eb3-436b-9fbd-c26f2fb2bf3e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment