summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-services.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
committerKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
commit191ae1cf7cd2571277635b3b8e488e773ca5c9b9 (patch)
treee0b26e3040767dae38fb39a03b757da05088c58f /lisp/erc/erc-services.el
parent382707ecfb50f8c7794a7ba3d8cd9db9b6cd29d0 (diff)
parentf85c5e3b72855951b071eacb7b6e2d002c5fc4be (diff)
downloademacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.tar.gz
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-585 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-586 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-587 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-588 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-589 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-590 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-591 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-592
Diffstat (limited to 'lisp/erc/erc-services.el')
-rw-r--r--lisp/erc/erc-services.el67
1 files changed, 42 insertions, 25 deletions
diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el
index c8bac7fe45c..b93317e6124 100644
--- a/lisp/erc/erc-services.el
+++ b/lisp/erc/erc-services.el
@@ -94,7 +94,7 @@ communication with those Services."
(interactive
(list (intern (completing-read
"Choose Nickserv identify mode (RET to disable): "
- '(("autodetect") ("nick-change")) nil t))))
+ '(("autodetect") ("nick-change") ("both")) nil t))))
(cond ((eq mode 'autodetect)
(setq erc-nickserv-identify-mode 'autodetect)
(add-hook 'erc-server-NOTICE-functions
@@ -111,6 +111,14 @@ communication with those Services."
'erc-nickserv-identify-on-nick-change)
(remove-hook 'erc-server-NOTICE-functions
'erc-nickserv-identify-autodetect))
+ ((eq mode 'both)
+ (setq erc-nickserv-identify-mode 'both)
+ (add-hook 'erc-server-NOTICE-functions
+ 'erc-nickserv-identify-autodetect)
+ (add-hook 'erc-after-connect
+ 'erc-nickserv-identify-on-connect)
+ (add-hook 'erc-nick-changed-functions
+ 'erc-nickserv-identify-on-nick-change))
(t
(setq erc-nickserv-identify-mode nil)
(remove-hook 'erc-server-NOTICE-functions
@@ -120,22 +128,25 @@ communication with those Services."
(remove-hook 'erc-nick-changed-functions
'erc-nickserv-identify-on-nick-change))))
-(defcustom erc-nickserv-identify-mode 'autodetect
+(defcustom erc-nickserv-identify-mode 'both
"The mode which is used when identifying to Nickserv.
Possible settings are:.
'autodetect - Identify when the real Nickserv sends an identify request.
'nick-change - Identify when you change your nickname.
+'both - Do the former if the network supports it, otherwise do the
+ latter.
nil - Disables automatic Nickserv identification.
You can also use M-x erc-nickserv-identify-mode to change modes."
:group 'erc-services
:type '(choice (const autodetect)
(const nick-change)
+ (const both)
(const nil))
:set (lambda (sym val)
- (set-default sym val)
+ (set sym val)
(erc-nickserv-identify-mode val)))
(defcustom erc-prompt-for-nickserv-password t
@@ -156,12 +167,14 @@ Example of use:
(list :tag "Network"
(choice :tag "Network name"
(const freenode)
+ (const OFTC)
(const DALnet)
(const GalaxyNet)
(const SlashNET)
(const BRASnet)
(const iip)
(const Austnet)
+ (const Azzurra)
(symbol :tag "Network name"))
(repeat :tag "Nickname and password"
(cons :tag "Identity"
@@ -209,24 +222,24 @@ Example of use:
"IDENTIFY"
nil
"")
- (Austnet
- "NickOP!service@austnet.org"
- "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>"
- "nickop@austnet.org"
- "identify"
- nil)
- (Azzurra
- "NickServ!service@azzurra.org"
- "/ns\\s-IDENTIFY\\s-password"
- "NickServ"
- "IDENTIFY"
- nil)
- (OFTC
- "NickServ!services@services.oftc.net"
- "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password"
- "NickServ"
- "IDENTIFY"
- nil))
+ (Austnet
+ "NickOP!service@austnet.org"
+ "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>"
+ "nickop@austnet.org"
+ "identify"
+ nil)
+ (Azzurra
+ "NickServ!service@azzurra.org"
+ "/ns\\s-IDENTIFY\\s-password"
+ "NickServ"
+ "IDENTIFY"
+ nil)
+ (OFTC
+ "NickServ!services@services.oftc.net"
+ "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password"
+ "NickServ"
+ "IDENTIFY"
+ nil))
"Alist of NickServer details, sorted by network.
Every element in the list has the form
\(SYMBOL NICKSERV REGEXP NICK KEYWORD USE-CURRENT ANSWER)
@@ -279,14 +292,18 @@ password for this nickname, otherwise try to send it automatically."
(defun erc-nickserv-identify-on-connect (server nick)
"Identify to Nickserv after the connection to the server is established."
- (unless (and (null erc-nickserv-passwords)
- (null erc-prompt-for-nickserv-password))
+ (unless (or (and (null erc-nickserv-passwords)
+ (null erc-prompt-for-nickserv-password))
+ (and (eq erc-nickserv-identify-mode 'both)
+ (nth 2 (assoc (erc-network) erc-nickserv-alist))))
(erc-nickserv-call-identify-function nick)))
(defun erc-nickserv-identify-on-nick-change (nick old-nick)
"Identify to Nickserv whenever your nick changes."
- (unless (and (null erc-nickserv-passwords)
- (null erc-prompt-for-nickserv-password))
+ (unless (or (and (null erc-nickserv-passwords)
+ (null erc-prompt-for-nickserv-password))
+ (and (eq erc-nickserv-identify-mode 'both)
+ (nth 2 (assoc (erc-network) erc-nickserv-alist))))
(erc-nickserv-call-identify-function nick)))
(defun erc-nickserv-call-identify-function (nickname)