annotate lisp/erc/erc-services.el @ 96847:5129bcf1c53e

* dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead only sprintf.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 21 Jul 2008 04:27:38 +0000
parents 116dc7c6e345
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
1 ;;; erc-services.el --- Identify to NickServ
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
2
79706
5f92874bde07 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78219
diff changeset
3 ;; Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
4
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
5 ;; This file is part of GNU Emacs.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
6
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87952
diff changeset
7 ;; GNU Emacs is free software: you can redistribute it and/or modify
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87952
diff changeset
9 ;; the Free Software Foundation, either version 3 of the License, or
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87952
diff changeset
10 ;; (at your option) any later version.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
11
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is distributed in the hope that it will be useful,
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
15 ;; GNU General Public License for more details.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
16
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
94660
2a734255bcc7 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87952
diff changeset
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
19
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 ;;; Commentary:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
21
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
22 ;; There are two ways to go about identifying yourself automatically to
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
23 ;; NickServ with this module. The more secure way is to listen for identify
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
24 ;; requests from the user NickServ. Another way is to identify yourself to
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
25 ;; NickServ directly after a successful connection and every time you change
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
26 ;; your nickname. This method is rather insecure, though, because no checks
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
27 ;; are made to test if NickServ is the real NickServ for a given network or
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
28 ;; server.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
29
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
30 ;; As a default, ERC has the data for the official nickname services on
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
31 ;; the networks Austnet, BrasNET, Dalnet, freenode, GalaxyNet, GRnet,
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
32 ;; and Slashnet. You can add more by using M-x customize-variable RET
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
33 ;; erc-nickserv-alist.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
34
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
35 ;; Usage:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
36 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
37 ;; Put into your .emacs:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
38 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
39 ;; (require 'erc-services)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
40 ;; (erc-services-mode 1)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
41 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
42 ;; Add your nickname and NickServ password to `erc-nickserv-passwords'.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
43 ;; Using the freenode network as an example:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
44 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
45 ;; (setq erc-nickserv-passwords '((freenode (("nickname" "password")))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
46 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
47 ;; The default automatic identification mode is autodetection of NickServ
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
48 ;; identify requests. Set the variable `erc-nickserv-identify-mode' if
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
49 ;; you'd like to change this behavior. You can also change the way
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
50 ;; automatic identification is handled by using:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
51 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
52 ;; M-x erc-nickserv-identify-mode
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
53 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
54 ;; If you'd rather not identify yourself automatically but would like access
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
55 ;; to the functions contained in this file, just load this file without
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
56 ;; enabling `erc-services-mode'.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
57 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
58
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
59 ;;; Code:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
60
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
61 (require 'erc)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 (require 'erc-networks)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
63 (eval-when-compile (require 'cl))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
64
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
65 ;; Customization:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
66
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
67 (defgroup erc-services nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
68 "Configuration for IRC services.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
69
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
70 On some networks, there exists a special type of automated irc bot,
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
71 called Services. Those usually allow you to register your nickname,
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
72 post/read memos to other registered users who are currently offline,
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
73 and do various other things.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
74
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
75 This group allows you to set variables to somewhat automate
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
76 communication with those Services."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
77 :group 'erc)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
78
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
79 (defcustom erc-nickserv-identify-mode 'both
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
80 "The mode which is used when identifying to Nickserv.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
81
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
82 Possible settings are:.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
83
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
84 'autodetect - Identify when the real Nickserv sends an identify request.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
85 'nick-change - Identify when you log in or change your nickname.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
86 'both - Do the former if the network supports it, otherwise do the
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
87 latter.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
88 nil - Disables automatic Nickserv identification.
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
89
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
90 You can also use M-x erc-nickserv-identify-mode to change modes."
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
91 :group 'erc-services
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
92 :type '(choice (const autodetect)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
93 (const nick-change)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
94 (const both)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
95 (const nil))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
96 :set (lambda (sym val)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
97 (set sym val)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
98 ;; avoid recursive load at startup
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
99 (when (featurep 'erc-services)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
100 (erc-nickserv-identify-mode val))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
101
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
102 ;;;###autoload (autoload 'erc-services-mode "erc-services" nil t)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
103 (define-erc-module services nickserv
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
104 "This mode automates communication with services."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
105 ((erc-nickserv-identify-mode erc-nickserv-identify-mode))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
106 ((remove-hook 'erc-server-NOTICE-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
107 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
108 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
109 'erc-nickserv-identify-on-connect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
110 (remove-hook 'erc-nick-changed-functions
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
111 'erc-nickserv-identify-on-nick-change)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
112 (remove-hook 'erc-server-NOTICE-functions
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
113 'erc-nickserv-identification-autodetect)))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
114
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
115 ;;;###autoload
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
116 (defun erc-nickserv-identify-mode (mode)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
117 "Set up hooks according to which MODE the user has chosen."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
118 (interactive
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
119 (list (intern (completing-read
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
120 "Choose Nickserv identify mode (RET to disable): "
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
121 '(("autodetect") ("nick-change") ("both")) nil t))))
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
122 (add-hook 'erc-server-NOTICE-functions
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
123 'erc-nickserv-identification-autodetect)
87952
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
124 (unless erc-networks-mode
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
125 ;; Force-enable networks module, because we need it to set
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
126 ;; erc-network for us.
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
127 (erc-networks-enable))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
128 (cond ((eq mode 'autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
129 (setq erc-nickserv-identify-mode 'autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
130 (add-hook 'erc-server-NOTICE-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
131 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
132 (remove-hook 'erc-nick-changed-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
133 'erc-nickserv-identify-on-nick-change)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
134 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
135 'erc-nickserv-identify-on-connect))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
136 ((eq mode 'nick-change)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
137 (setq erc-nickserv-identify-mode 'nick-change)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
138 (add-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
139 'erc-nickserv-identify-on-connect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
140 (add-hook 'erc-nick-changed-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
141 'erc-nickserv-identify-on-nick-change)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
142 (remove-hook 'erc-server-NOTICE-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
143 'erc-nickserv-identify-autodetect))
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
144 ((eq mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
145 (setq erc-nickserv-identify-mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
146 (add-hook 'erc-server-NOTICE-functions
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
147 'erc-nickserv-identify-autodetect)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
148 (add-hook 'erc-after-connect
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
149 'erc-nickserv-identify-on-connect)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
150 (add-hook 'erc-nick-changed-functions
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
151 'erc-nickserv-identify-on-nick-change))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
152 (t
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
153 (setq erc-nickserv-identify-mode nil)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
154 (remove-hook 'erc-server-NOTICE-functions
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
155 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
156 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
157 'erc-nickserv-identify-on-connect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
158 (remove-hook 'erc-nick-changed-functions
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
159 'erc-nickserv-identify-on-nick-change)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
160 (remove-hook 'erc-server-NOTICE-functions
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
161 'erc-nickserv-identification-autodetect))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
162
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
163 (defcustom erc-prompt-for-nickserv-password t
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
164 "Ask for the password when identifying to NickServ."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
165 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
166 :type 'boolean)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
167
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
168 (defcustom erc-nickserv-passwords nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
169 "Passwords used when identifying to NickServ automatically.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
170
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
171 Example of use:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
172 (setq erc-nickserv-passwords
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
173 '((freenode ((\"nick-one\" . \"password\")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
174 (\"nick-two\" . \"password\")))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
175 (DALnet ((\"nick\" . \"password\")))))"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
176 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
177 :type '(repeat
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
178 (list :tag "Network"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
179 (choice :tag "Network name"
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
180 (const Ars)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
181 (const Austnet)
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
182 (const Azzurra)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
183 (const BitlBee)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
184 (const BRASnet)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
185 (const DALnet)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
186 (const freenode)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
187 (const GalaxyNet)
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
188 (const GRnet)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
189 (const iip)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
190 (const OFTC)
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
191 (const QuakeNet)
87952
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
192 (const Rizon)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
193 (const SlashNET)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
194 (symbol :tag "Network name"))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
195 (repeat :tag "Nickname and password"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
196 (cons :tag "Identity"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
197 (string :tag "Nick")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
198 (string :tag "Password"))))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
199
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
200 ;; Variables:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
201
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
202 (defcustom erc-nickserv-alist
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
203 '((Ars
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
204 nil nil
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
205 "Census"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
206 "IDENTIFY" nil nil nil)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
207 (Austnet
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
208 "NickOP!service@austnet.org"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
209 "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
210 "nickop@austnet.org"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
211 "identify" nil nil nil)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
212 (Azzurra
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
213 "NickServ!service@azzurra.org"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
214 "/ns\\s-IDENTIFY\\s-password"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
215 "NickServ"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
216 "IDENTIFY" nil nil nil)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
217 (BitlBee
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
218 nil nil
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
219 "&bitlbee"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
220 "identify" nil nil nil)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
221 (BRASnet
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
222 "NickServ!services@brasnet.org"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
223 "/NickServ\\s-IDENTIFY\\s-senha"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
224 "NickServ"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
225 "IDENTIFY" nil "" nil)
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
226 (DALnet
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
227 "NickServ!service@dal.net"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
228 "/msg\\s-NickServ@services.dal.net\\s-IDENTIFY\\s-<password>"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
229 "NickServ@services.dal.net"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
230 "IDENTIFY" nil nil nil)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
231 (freenode
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
232 "NickServ!NickServ@services."
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
233 ;; freenode also accepts a password at login, see the `erc'
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
234 ;; :password argument.
96081
116dc7c6e345 ERC: Upstream updates.
Michael Olson <mwolson@gnu.org>
parents: 94660
diff changeset
235 "This\\s-nickname\\s-is\\s-registered.\\s-Please\\s-choose"
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
236 "NickServ"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
237 "IDENTIFY" nil nil
96081
116dc7c6e345 ERC: Upstream updates.
Michael Olson <mwolson@gnu.org>
parents: 94660
diff changeset
238 ;; See also the 901 response code message.
116dc7c6e345 ERC: Upstream updates.
Michael Olson <mwolson@gnu.org>
parents: 94660
diff changeset
239 "You\\s-are\\s-now\\s-identified\\s-for\\s-")
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
240 (GalaxyNet
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
241 "NS!nickserv@galaxynet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
242 "Please\\s-change\\s-nicks\\s-or\\s-authenticate."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
243 "NS@services.galaxynet.org"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
244 "AUTH" t nil nil)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
245 (GRnet
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
246 "NickServ!service@irc.gr"
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
247 "This\\s-nickname\\s-is\\s-registered\\s-and\\s-protected."
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
248 "NickServ"
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
249 "IDENTIFY" nil nil
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
250 "Password\\s-accepted\\s--\\s-you\\s-are\\s-now\\s-recognized.")
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
251 (iip
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
252 "Trent@anon.iip"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
253 "type\\s-/squery\\s-Trent\\s-identify\\s-<password>"
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
254 "Trent@anon.iip"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
255 "IDENTIFY" nil "SQUERY" nil)
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
256 (OFTC
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
257 "NickServ!services@services.oftc.net"
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
258 ;; OFTC's NickServ doesn't ask you to identify anymore.
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
259 nil
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
260 "NickServ"
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
261 "IDENTIFY" nil nil
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
262 "You\\s-are\\s-successfully\\s-identified\\s-as\\s-")
87952
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
263 (Rizon
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
264 "NickServ!service@rizon.net"
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
265 "This\\s-nickname\\s-is\\s-registered\\s-and\\s-protected."
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
266 "NickServ"
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
267 "IDENTIFY" nil nil
b8f89dd3680d ERC: Sync version 5.3, release candidate 1.
Michael Olson <mwolson@gnu.org>
parents: 87687
diff changeset
268 "Password\\s-accepted\\s--\\s-you\\s-are\\s-now\\s-recognized.")
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
269 (QuakeNet
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
270 nil nil
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
271 "Q@CServe.quakenet.org"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
272 "auth" t nil nil)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
273 (SlashNET
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
274 "NickServ!services@services.slashnet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
275 "/msg\\s-NickServ\\s-IDENTIFY\\s-password"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
276 "NickServ@services.slashnet.org"
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
277 "IDENTIFY" nil nil nil))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
278 "Alist of NickServer details, sorted by network.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
279 Every element in the list has the form
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
280 \(SYMBOL NICKSERV REGEXP NICK KEYWORD USE-CURRENT ANSWER SUCCESS-REGEXP)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
281
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
282 SYMBOL is a network identifier, a symbol, as used in `erc-networks-alist'.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
283 NICKSERV is the description of the nickserv in the form nick!user@host.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
284 REGEXP is a regular expression matching the message from nickserv.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
285 NICK is nickserv's nickname. Use nick@server where necessary/possible.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
286 KEYWORD is the keyword to use in the reply message to identify yourself.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
287 USE-CURRENT indicates whether the current nickname must be used when
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
288 identifying.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
289 ANSWER is the command to use for the answer. The default is 'privmsg.
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
290 SUCCESS-REGEXP is a regular expression matching the message nickserv
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
291 sends when you've successfully identified.
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
292 The last two elements are optional."
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
293 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
294 :type '(repeat
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
295 (list :tag "Nickserv data"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
296 (symbol :tag "Network name")
76856
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
297 (choice (string :tag "Nickserv's nick!user@host")
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
298 (const :tag "No message sent by Nickserv" nil))
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
299 (choice (regexp :tag "Identify request sent by Nickserv")
2fae574a2382 Release ERC 5.2.
Miles Bader <miles@gnu.org>
parents: 75346
diff changeset
300 (const :tag "No message sent by Nickserv" nil))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
301 (string :tag "Identify to")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
302 (string :tag "Identify keyword")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
303 (boolean :tag "Use current nick in identify message?")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
304 (choice :tag "Command to use (optional)"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
305 (string :tag "Command")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
306 (const :tag "No special command necessary" nil)))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
307
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
308 (defsubst erc-nickserv-alist-sender (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
309 (nth 1 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
310
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
311 (defsubst erc-nickserv-alist-regexp (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
312 (nth 2 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
313
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
314 (defsubst erc-nickserv-alist-nickserv (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
315 (nth 3 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
316
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
317 (defsubst erc-nickserv-alist-ident-keyword (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
318 (nth 4 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
319
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
320 (defsubst erc-nickserv-alist-use-nick-p (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
321 (nth 5 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
322
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
323 (defsubst erc-nickserv-alist-ident-command (network &optional entry)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
324 (nth 6 (or entry (assoc network erc-nickserv-alist))))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
325
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
326 (defsubst erc-nickserv-alist-identified-regexp (network &optional entry)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
327 (nth 7 (or entry (assoc network erc-nickserv-alist))))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
328
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
329 ;; Functions:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
330
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
331 (defcustom erc-nickserv-identified-hook nil
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
332 "Run this hook when NickServ acknowledged successful identification.
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
333 Hooks are called with arguments (NETWORK NICK)."
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
334 :group 'erc-services
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
335 :type 'hook)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
336
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
337 (defun erc-nickserv-identification-autodetect (proc parsed)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
338 "Check for NickServ's successful identification notice.
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
339 Make sure it is the real NickServ for this network and that it has
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
340 specifically confirmed a successful identification attempt.
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
341 If this is the case, run `erc-nickserv-identified-hook'."
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
342 (let* ((network (erc-network))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
343 (sender (erc-nickserv-alist-sender network))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
344 (success-regex (erc-nickserv-alist-identified-regexp network))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
345 (sspec (erc-response.sender parsed))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
346 (nick (car (erc-response.command-args parsed)))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
347 (msg (erc-response.contents parsed)))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
348 ;; continue only if we're sure it's the real nickserv for this network
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
349 ;; and it's told us we've successfully identified
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
350 (when (and sender (equal sspec sender)
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
351 success-regex
87202
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
352 (string-match success-regex msg))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
353 (erc-log "NickServ IDENTIFY success notification detected")
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
354 (run-hook-with-args 'erc-nickserv-identified-hook network nick)
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
355 nil)))
60375ad7809c Sync from ERC upstream
Michael Olson <mwolson@gnu.org>
parents: 78219
diff changeset
356
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
357 (defun erc-nickserv-identify-autodetect (proc parsed)
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
358 "Identify to NickServ when an identify request is received.
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
359 Make sure it is the real NickServ for this network.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
360 If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
361 password for this nickname, otherwise try to send it automatically."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
362 (unless (and (null erc-nickserv-passwords)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
363 (null erc-prompt-for-nickserv-password))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
364 (let* ((network (erc-network))
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
365 (sender (erc-nickserv-alist-sender network))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
366 (identify-regex (erc-nickserv-alist-regexp network))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
367 (sspec (erc-response.sender parsed))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
368 (nick (car (erc-response.command-args parsed)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
369 (msg (erc-response.contents parsed)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
370 ;; continue only if we're sure it's the real nickserv for this network
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
371 ;; and it's asked us to identify
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
372 (when (and sender (equal sspec sender)
87687
aef7ff97a0c2 ERC: Sync changes from upstream.
Michael Olson <mwolson@gnu.org>
parents: 87649
diff changeset
373 identify-regex
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
374 (string-match identify-regex msg))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
375 (erc-log "NickServ IDENTIFY request detected")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
376 (erc-nickserv-call-identify-function nick)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
377 nil))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
378
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
379 (defun erc-nickserv-identify-on-connect (server nick)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
380 "Identify to Nickserv after the connection to the server is established."
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
381 (unless (or (and (null erc-nickserv-passwords)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
382 (null erc-prompt-for-nickserv-password))
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
383 (and (eq erc-nickserv-identify-mode 'both)
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
384 (erc-nickserv-alist-regexp (erc-network))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
385 (erc-nickserv-call-identify-function nick)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
386
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
387 (defun erc-nickserv-identify-on-nick-change (nick old-nick)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
388 "Identify to Nickserv whenever your nick changes."
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
389 (unless (or (and (null erc-nickserv-passwords)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
390 (null erc-prompt-for-nickserv-password))
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
391 (and (eq erc-nickserv-identify-mode 'both)
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
392 (erc-nickserv-alist-regexp (erc-network))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
393 (erc-nickserv-call-identify-function nick)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
394
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
395 (defun erc-nickserv-call-identify-function (nickname)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
396 "Call `erc-nickserv-identify' interactively or run it with NICKNAME's
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
397 password.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
398 The action is determined by the value of `erc-prompt-for-nickserv-password'."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
399 (if erc-prompt-for-nickserv-password
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
400 (call-interactively 'erc-nickserv-identify)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
401 (when erc-nickserv-passwords
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
402 (erc-nickserv-identify
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
403 (cdr (assoc nickname
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
404 (nth 1 (assoc (erc-network)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
405 erc-nickserv-passwords))))))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
406
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
407 ;;;###autoload
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
408 (defun erc-nickserv-identify (password)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
409 "Send an \"identify <PASSWORD>\" message to NickServ.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
410 When called interactively, read the password using `read-passwd'."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
411 (interactive
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
412 (list (read-passwd
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
413 (format "NickServ password for %s on %s (RET to cancel): "
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
414 (erc-current-nick)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
415 (or (and (erc-network)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
416 (symbol-name (erc-network)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
417 "Unknown network")))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
418 (when (and password (not (string= "" password)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
419 (let* ((erc-auto-discard-away nil)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
420 (network (erc-network))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
421 (nickserv-info (assoc network erc-nickserv-alist))
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
422 (nickserv (or (erc-nickserv-alist-nickserv nil nickserv-info)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
423 "NickServ"))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
424 (identify-word (or (erc-nickserv-alist-ident-keyword
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
425 nil nickserv-info)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
426 "IDENTIFY"))
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
427 (nick (if (erc-nickserv-alist-use-nick-p nil nickserv-info)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
428 (concat (erc-current-nick) " ")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
429 ""))
75259
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
430 (msgtype (or (erc-nickserv-alist-ident-command nil nickserv-info)
f45c5edf0be4 Merge from erc--main--0
Miles Bader <miles@gnu.org>
parents: 75092
diff changeset
431 "PRIVMSG")))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
432 (erc-message msgtype
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
433 (concat nickserv " " identify-word " " nick password)))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
434
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
435 (provide 'erc-services)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
436
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
437 ;;; erc-services.el ends here
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
438 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
439 ;; Local Variables:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
440 ;; indent-tabs-mode: t
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
441 ;; tab-width: 8
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
442 ;; End:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
443
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
444 ;; arch-tag: d401c8aa-d938-4255-96a9-3efb64c47e58