annotate lisp/erc/erc-services.el @ 75227:e90d04cd455a

Update copyright for years from Emacs 21 to present (mainly adding 2001).
author Glenn Morris <rgm@gnu.org>
date Sun, 14 Jan 2007 03:38:22 +0000
parents e566d4fc8dd2
children f45c5edf0be4
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
68822
7010bb070445 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-75
Miles Bader <miles@gnu.org>
parents: 68719
diff changeset
3 ;; Copyright (C) 2002, 2003, 2004, 2006 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
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
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
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
9 ;; the Free Software Foundation; either version 2, or (at your option)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
10 ;; any later version.
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
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
19 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 ;; Boston, MA 02110-1301, USA.
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 ;;; Commentary:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
23
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
24 ;; 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
25 ;; 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
26 ;; 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
27 ;; 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
28 ;; 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
29 ;; 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
30 ;; server.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
31
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
32 ;; As a default, ERC has the data for the official nickname services on the
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
33 ;; networks Austnet, BrasNET, Dalnet, freenode, GalaxyNet, and Slashnet.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
34 ;; You can add more by using M-x customize-variable RET erc-nickserv-alist.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
35
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
36 ;; Usage:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
37 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
38 ;; Put into your .emacs:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
39 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
40 ;; (require 'erc-services)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
41 ;; (erc-services-mode 1)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
42 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
43 ;; 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
44 ;; 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
45 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
46 ;; (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
47 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
48 ;; 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
49 ;; 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
50 ;; 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
51 ;; 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
52 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
53 ;; 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
54 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
55 ;; 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
56 ;; 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
57 ;; enabling `erc-services-mode'.
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
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
60 ;;; Code:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
61
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 (require 'erc)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
63 (require 'erc-networks)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
64 (eval-when-compile (require 'cl))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
65
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
66 ;; Customization:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
67
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
68 (defgroup erc-services nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
69 "Configuration for IRC services.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
70
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
71 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
72 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
73 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
74 and do various other things.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
75
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
76 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
77 communication with those Services."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
78 :group 'erc)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
79
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
80 ;;;###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
81 (define-erc-module services nickserv
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
82 "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
83 ((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
84 ((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
85 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
86 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
87 'erc-nickserv-identify-on-connect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
88 (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
89 '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
90
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
91 ;;;###autoload
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
92 (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
93 "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
94 (interactive
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
95 (list (intern (completing-read
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
96 "Choose Nickserv identify mode (RET to disable): "
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
97 '(("autodetect") ("nick-change") ("both")) nil t))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
98 (cond ((eq mode 'autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
99 (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
100 (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
101 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
102 (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
103 '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
104 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
105 'erc-nickserv-identify-on-connect))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
106 ((eq mode 'nick-change)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
107 (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
108 (add-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 (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
111 '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
112 (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
113 'erc-nickserv-identify-autodetect))
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
114 ((eq mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
115 (setq erc-nickserv-identify-mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
116 (add-hook 'erc-server-NOTICE-functions
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
117 'erc-nickserv-identify-autodetect)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
118 (add-hook 'erc-after-connect
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
119 'erc-nickserv-identify-on-connect)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
120 (add-hook 'erc-nick-changed-functions
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
121 '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
122 (t
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
123 (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
124 (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
125 'erc-nickserv-identify-autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
126 (remove-hook 'erc-after-connect
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
127 'erc-nickserv-identify-on-connect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
128 (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
129 '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
130
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
131 (defcustom erc-nickserv-identify-mode 'both
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
132 "The mode which is used when identifying to Nickserv.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
133
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
134 Possible settings are:.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
135
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
136 'autodetect - Identify when the real Nickserv sends an identify request.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
137 'nick-change - Identify when you change your nickname.
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
138 'both - Do the former if the network supports it, otherwise do the
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
139 latter.
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
140 nil - Disables automatic Nickserv identification.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
141
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
142 You can also use M-x erc-nickserv-identify-mode to change modes."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
143 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
144 :type '(choice (const autodetect)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
145 (const nick-change)
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
146 (const both)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
147 (const nil))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
148 :set (lambda (sym val)
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
149 (set sym val)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
150 (erc-nickserv-identify-mode val)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
151
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
152 (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
153 "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
154 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
155 :type 'boolean)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
156
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
157 (defcustom erc-nickserv-passwords nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
158 "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
159
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
160 Example of use:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
161 (setq erc-nickserv-passwords
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
162 '((freenode ((\"nick-one\" . \"password\")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
163 (\"nick-two\" . \"password\")))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
164 (DALnet ((\"nick\" . \"password\")))))"
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 '(repeat
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
167 (list :tag "Network"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
168 (choice :tag "Network name"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
169 (const freenode)
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
170 (const OFTC)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
171 (const DALnet)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
172 (const GalaxyNet)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
173 (const SlashNET)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
174 (const BRASnet)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
175 (const iip)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
176 (const Austnet)
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
177 (const Azzurra)
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
178 (symbol :tag "Network name"))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
179 (repeat :tag "Nickname and password"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
180 (cons :tag "Identity"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
181 (string :tag "Nick")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
182 (string :tag "Password"))))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
183
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
184 ;; Variables:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
185
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
186 (defcustom erc-nickserv-alist
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
187 '((DALnet
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
188 "NickServ!service@dal.net"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
189 "/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
190 "NickServ@services.dal.net"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
191 "IDENTIFY"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
192 nil)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
193 (freenode
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
194 "NickServ!NickServ@services."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
195 "/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
196 "NickServ"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
197 "IDENTIFY"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
198 nil)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
199 (GalaxyNet
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
200 "NS!nickserv@galaxynet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
201 "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
202 "NS@services.galaxynet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
203 "AUTH"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
204 t)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
205 (SlashNET
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
206 "NickServ!services@services.slashnet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
207 "/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
208 "NickServ@services.slashnet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
209 "IDENTIFY"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
210 nil)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
211 (iip
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
212 "Trent@anon.iip"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
213 "type\\s-/squery\\s-Trent\\s-identify\\s-<password>"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
214 "Trent@anon.iip"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
215 "IDENTIFY"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
216 nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
217 "SQUERY")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
218 (BRASnet
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
219 "NickServ!services@brasnet.org"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
220 "/NickServ\\s-IDENTIFY\\s-senha"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
221 "NickServ"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
222 "IDENTIFY"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
223 nil
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
224 "")
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
225 (Austnet
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
226 "NickOP!service@austnet.org"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
227 "/msg\\s-NickOP@austnet.org\\s-identify\\s-<password>"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
228 "nickop@austnet.org"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
229 "identify"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
230 nil)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
231 (Azzurra
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
232 "NickServ!service@azzurra.org"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
233 "/ns\\s-IDENTIFY\\s-password"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
234 "NickServ"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
235 "IDENTIFY"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
236 nil)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
237 (OFTC
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
238 "NickServ!services@services.oftc.net"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
239 "/msg\\s-NickServ\\s-IDENTIFY\\s-\^_password"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
240 "NickServ"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
241 "IDENTIFY"
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
242 nil))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
243 "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
244 Every element in the list has the form
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
245 \(SYMBOL NICKSERV REGEXP NICK KEYWORD USE-CURRENT ANSWER)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
246
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
247 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
248 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
249 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
250 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
251 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
252 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
253 identifying.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
254 ANSWER is the command to use for the answer. The default is 'privmsg.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
255 This last element is optional."
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
256 :group 'erc-services
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
257 :type '(repeat
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
258 (list :tag "Nickserv data"
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
259 (symbol :tag "Network name")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
260 (string :tag "Nickserv's nick!user@host")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
261 (regexp :tag "Identify request sent by Nickserv")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
262 (string :tag "Identify to")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
263 (string :tag "Identify keyword")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
264 (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
265 (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
266 (string :tag "Command")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
267 (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
268
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
269 ;; Functions:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
270
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
271 (defun erc-nickserv-identify-autodetect (proc parsed)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
272 "Check for a NickServ identify request everytime a notice is received.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
273 Make sure it is the real NickServ for this network and that it has
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
274 specifically asked the user to IDENTIFY.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
275 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
276 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
277 (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
278 (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
279 (let* ((network (erc-network))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
280 (nickserv (nth 1 (assoc network erc-nickserv-alist)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
281 (identify-regex (nth 2 (assoc network erc-nickserv-alist)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
282 (sspec (erc-response.sender parsed))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
283 (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
284 (msg (erc-response.contents parsed)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
285 ;; 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
286 ;; and it's asked us to identify
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
287 (when (and nickserv (equal sspec nickserv)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
288 (string-match identify-regex msg))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
289 (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
290 (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
291 nil))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
292
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
293 (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
294 "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
295 (unless (or (and (null erc-nickserv-passwords)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
296 (null erc-prompt-for-nickserv-password))
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
297 (and (eq erc-nickserv-identify-mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
298 (nth 2 (assoc (erc-network) erc-nickserv-alist))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
299 (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
300
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
301 (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
302 "Identify to Nickserv whenever your nick changes."
75092
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
303 (unless (or (and (null erc-nickserv-passwords)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
304 (null erc-prompt-for-nickserv-password))
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
305 (and (eq erc-nickserv-identify-mode 'both)
e566d4fc8dd2 Update from erc--emacs--22
Miles Bader <miles@gnu.org>
parents: 68822
diff changeset
306 (nth 2 (assoc (erc-network) erc-nickserv-alist))))
68719
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
307 (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
308
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
309 (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
310 "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
311 password.
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
312 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
313 (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
314 (call-interactively 'erc-nickserv-identify)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
315 (when erc-nickserv-passwords
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
316 (erc-nickserv-identify
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
317 (cdr (assoc nickname
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
318 (nth 1 (assoc (erc-network)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
319 erc-nickserv-passwords))))))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
320
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
321 ;;;###autoload
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
322 (defun erc-nickserv-identify (password)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
323 "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
324 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
325 (interactive
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
326 (list (read-passwd
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
327 (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
328 (erc-current-nick)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
329 (or (and (erc-network)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
330 (symbol-name (erc-network)))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
331 "Unknown network")))))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
332 (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
333 (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
334 (network (erc-network))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
335 (nickserv-info (assoc network erc-nickserv-alist))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
336 (nickserv (or (nth 3 nickserv-info) "NickServ"))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
337 (identify-word (or (nth 4 nickserv-info) "IDENTIFY"))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
338 (nick (if (nth 5 nickserv-info)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
339 (concat (erc-current-nick) " ")
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
340 ""))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
341 (msgtype (or (nth 6 nickserv-info) "PRIVMSG")))
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
342 (erc-message msgtype
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
343 (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
344
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
345 (provide 'erc-services)
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
346
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
347 ;;; erc-services.el ends here
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
348 ;;
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
349 ;; Local Variables:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
350 ;; indent-tabs-mode: t
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
351 ;; tab-width: 8
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
352 ;; End:
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
353
2de3fcf69715 Revision: emacs@sv.gnu.org/emacs--devo--0--patch-55
Miles Bader <miles@gnu.org>
parents:
diff changeset
354 ;; arch-tag: d401c8aa-d938-4255-96a9-3efb64c47e58