emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/erc/erc-services.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/erc/erc-services.el,v
Date: Fri, 05 Jan 2007 02:09:08 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/01/05 02:09:07

Index: lisp/erc/erc-services.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/erc/erc-services.el,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- lisp/erc/erc-services.el    12 Feb 2006 20:25:00 -0000      1.2
+++ lisp/erc/erc-services.el    5 Jan 2007 02:09:07 -0000       1.3
@@ -94,7 +94,7 @@
   (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 @@
                   '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 @@
         (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 @@
          (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"
@@ -279,14 +292,18 @@
 
 (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)
+  (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)
+  (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]