1 | ;;;; $Id: variable.lisp 246 2015-09-06 13:17:54Z ehuelsmann $ |
---|
2 | ;;;; $URL: trunk/variable.lisp $ |
---|
3 | |
---|
4 | ;;;; See the LICENSE file for licensing information. |
---|
5 | |
---|
6 | (in-package :irc) |
---|
7 | |
---|
8 | (defvar *debug-p* nil) |
---|
9 | (defvar *debug-stream* t) |
---|
10 | |
---|
11 | (defconstant +soh+ #.(code-char 1)) |
---|
12 | |
---|
13 | (defparameter *version* "0.9.3-dev") |
---|
14 | (defparameter *ctcp-version* |
---|
15 | (format nil "CL IRC library, cl-irc:~A:~A ~A" |
---|
16 | *version* (machine-type) (machine-version))) |
---|
17 | |
---|
18 | (defparameter *download-host* "http://common-lisp.net/") |
---|
19 | (defparameter *download-directory* "/project/cl-irc/") |
---|
20 | (defparameter *download-file* |
---|
21 | (format nil "cl-irc-~A.tar.gz" *version*)) |
---|
22 | |
---|
23 | (defvar *default-nickname* "cl-irc") |
---|
24 | (defvar *default-irc-server* "irc.freenode.net") |
---|
25 | (defvar *default-irc-server-port* '(:none 6667 ;; most used for normal IRC |
---|
26 | :ssl 6679 ;; most used for SSL IRC |
---|
27 | )) |
---|
28 | (defvar *default-quit-message* |
---|
29 | "Common Lisp IRC library - http://common-lisp.net/project/cl-irc") |
---|
30 | |
---|
31 | (defparameter *unknown-reply-hook* nil |
---|
32 | "A function of two arguments, called with the related irc connection |
---|
33 | object and the protocol message string upon detection of an unmappable |
---|
34 | response code. |
---|
35 | |
---|
36 | The function should return a valid IRC-MESSAGE class or NIL. |
---|
37 | |
---|
38 | The parameter can be NIL to disable the hook.") |
---|
39 | |
---|
40 | (defparameter *default-isupport-CHANMODES* |
---|
41 | "beI,kO,l,aimnpqsrt") |
---|
42 | (defparameter *default-isupport-PREFIX* |
---|
43 | "(ov)@+") |
---|
44 | |
---|
45 | (defparameter *default-isupport-values* |
---|
46 | `(("CASEMAPPING" "rfc1459") |
---|
47 | ("CHANMODES" ,*default-isupport-CHANMODES*) |
---|
48 | ("CHANNELLEN" "200") |
---|
49 | ("CHANTYPES" "#&") |
---|
50 | ("MODES" "3") |
---|
51 | ("NICKLEN" "9") |
---|
52 | ("PREFIX" ,*default-isupport-PREFIX*) |
---|
53 | ("TARGMAX"))) |
---|
54 | |
---|
55 | (defparameter *default-outgoing-external-format* '(:utf-8) |
---|
56 | "The external-format we use to encode outgoing messages. This |
---|
57 | should be an external format spec that flexi-streams accepts. |
---|
58 | |
---|
59 | :eol-style will always be overridden to be :crlf as required |
---|
60 | by the IRC protocol.") |
---|
61 | |
---|
62 | (defparameter *default-incoming-external-formats* '((:utf-8 :eol-style :crlf) |
---|
63 | (:latin1 :eol-style :crlf)) |
---|
64 | "The external-formats we use to decode incoming messages. This should |
---|
65 | be a list of external format specs that flexi-streams accepts. |
---|
66 | |
---|
67 | The external formats are tried in order, until one decodes the |
---|
68 | message without encoding errors. Note that the last external |
---|
69 | format should be a single-byte one with most or even all valid |
---|
70 | codepoints (such as latin-1). |
---|
71 | |
---|
72 | :eol-style will always be overridden to be :crlf as required by the |
---|
73 | IRC protocol.") |
---|
74 | |
---|
75 | (defvar *dcc-connections* nil) |
---|
76 | |
---|
77 | (defstruct (mode-description (:conc-name "MODE-DESC-")) |
---|
78 | (char nil) |
---|
79 | (symbol nil) |
---|
80 | (param-on-set-p nil) |
---|
81 | (param-on-unset-p nil) |
---|
82 | (nick-param-p nil) |
---|
83 | (class 'single-value-mode)) |
---|
84 | |
---|
85 | |
---|
86 | (defparameter *default-char-to-channel-modes-map* |
---|
87 | '( |
---|
88 | ;; these modes don't take parameters |
---|
89 | (#\a . :anonymous) |
---|
90 | (#\i . :invite-only) |
---|
91 | (#\m . :moderated) |
---|
92 | (#\n . :no-external) |
---|
93 | (#\q . :quiet) |
---|
94 | (#\s . :secret) |
---|
95 | (#\r . :reop) |
---|
96 | (#\t . :op-only-topic) |
---|
97 | |
---|
98 | ;; these modes take a user parameter |
---|
99 | (#\O . :channel-creator) |
---|
100 | (#\o . :channel-operator) |
---|
101 | (#\v . :voice) |
---|
102 | |
---|
103 | ;; these modes take a parameter other than a user |
---|
104 | (#\l . :limit) |
---|
105 | (#\k . :key) |
---|
106 | (#\b . :ban) |
---|
107 | (#\e . :except) |
---|
108 | (#\I . :invite))) |
---|
109 | |
---|
110 | (defparameter *char-to-user-modes-map* |
---|
111 | '((#\a . :away) |
---|
112 | (#\i . :invisible) |
---|
113 | (#\w . :receive-wallops) |
---|
114 | (#\s . :server-notices) |
---|
115 | (#\r . :restricted-connection) |
---|
116 | (#\o . :remote-operator) |
---|
117 | (#\O . :local-operator))) |
---|
118 | |
---|
119 | (defparameter *reply-names* |
---|
120 | '((1 :rpl_welcome) |
---|
121 | (2 :rpl_yourhost) |
---|
122 | (3 :rpl_created) |
---|
123 | (4 :rpl_myinfo) |
---|
124 | (5 :rpl_isupport) ;; The RFC was wrong to define RPL_BOUNCE here, |
---|
125 | ;; see http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt |
---|
126 | (10 :rpl_bounce) |
---|
127 | (15 :rpl_map) ; From ircd 2.11 source |
---|
128 | (17 :rpl_mapend) ; From ircd 2.11 source |
---|
129 | (18 :rpl_mapstart) ; From ircd 2.11 source |
---|
130 | (20 :rpl_hello) ; From ircd 2.11 source |
---|
131 | (42 :rpl_yourid) ; From ircd 2.11 source |
---|
132 | (43 :rpl_savenick) ; From ircd 2.11 source |
---|
133 | (200 :rpl_tracelink) |
---|
134 | (201 :rpl_traceconnecting) |
---|
135 | (202 :rpl_tracehandshake) |
---|
136 | (203 :rpl_traceunknown) |
---|
137 | (204 :rpl_traceoperator) |
---|
138 | (205 :rpl_traceuser) |
---|
139 | (206 :rpl_traceserver) |
---|
140 | (207 :rpl_traceservice) |
---|
141 | (208 :rpl_tracenewtype) |
---|
142 | (209 :rpl_traceclass) |
---|
143 | (210 :rpl_tracereconnect) |
---|
144 | (211 :rpl_statslinkinfo) |
---|
145 | (212 :rpl_statscommands) |
---|
146 | (213 :rpl_statscline) |
---|
147 | (214 :rpl_statsnline) |
---|
148 | (215 :rpl_statsiline) |
---|
149 | (216 :rpl_statskline) |
---|
150 | (217 :rpl_statsqline) |
---|
151 | (218 :rpl_statsyline) |
---|
152 | (219 :rpl_endofstats) |
---|
153 | (221 :rpl_umodeis) |
---|
154 | (225 :rpl_statsdline) ; Seen in dancer ircd source |
---|
155 | (227 :rpl_option) ; Seen in dancer ircd source |
---|
156 | (228 :rpl_endoptions) ; Seen in dancer ircd source |
---|
157 | (231 :rpl_serviceinfo) |
---|
158 | (232 :rpl_endofservices) |
---|
159 | (233 :rpl_service) |
---|
160 | (234 :rpl_servlist) |
---|
161 | (235 :rpl_servlistend) |
---|
162 | (240 :rpl_statsvline) |
---|
163 | (241 :rpl_statslline) |
---|
164 | (242 :rpl_statsuptime) |
---|
165 | (243 :rpl_statsonline) |
---|
166 | (244 :rpl_statshline) |
---|
167 | (245 :rpl_statssline) ; The RFC says 244 but I believe that was a typo. |
---|
168 | (246 :rpl_statsping) |
---|
169 | (247 :rpl_statsbline) |
---|
170 | (248 :rpl_statsuline) ; Seen in dancer ircd source |
---|
171 | (249 :rpl_statsdebug) ; Seen in dancer ircd source |
---|
172 | (250 :rpl_statsdline) |
---|
173 | (251 :rpl_luserclient) |
---|
174 | (252 :rpl_luserop) |
---|
175 | (253 :rpl_luserunknown) |
---|
176 | (254 :rpl_luserchannels) |
---|
177 | (255 :rpl_luserme) |
---|
178 | (256 :rpl_adminme) |
---|
179 | (257 :rpl_adminloc1) |
---|
180 | (258 :rpl_adminloc2) |
---|
181 | (259 :rpl_adminemail) |
---|
182 | (261 :rpl_tracelog) |
---|
183 | (262 :rpl_traceend) |
---|
184 | (263 :rpl_tryagain) |
---|
185 | (265 :rpl_localusers) ; Seen in dancer ircd source |
---|
186 | (266 :rpl_globalusers) ; Seen in dancer ircd source |
---|
187 | (268 :rpl_mode) ; Seen in dancer ircd source |
---|
188 | (269 :rpl_endmode) ; Seen in dancer ircd source |
---|
189 | (271 :rpl_sitelist) ; Seen in dancer ircd source |
---|
190 | (272 :rpl_endsitelist) ; Seen in dancer ircd source |
---|
191 | (290 :rpl_clientcapab) ; Seen in dancer ircd source |
---|
192 | (292 :rpl_noservicehost) |
---|
193 | (300 :rpl_none) |
---|
194 | (301 :rpl_away) |
---|
195 | (302 :rpl_userhost) |
---|
196 | (303 :rpl_ison) |
---|
197 | (304 :rpl_away) |
---|
198 | (305 :rpl_unaway) |
---|
199 | (306 :rpl_noaway) |
---|
200 | (307 :rpl_whoisidentified) |
---|
201 | (311 :rpl_whoisuser) |
---|
202 | (312 :rpl_whoisserver) |
---|
203 | (313 :rpl_whoisoperator) |
---|
204 | (314 :rpl_whowasuser) |
---|
205 | (315 :rpl_endofwho) |
---|
206 | (316 :rpl_whoischanop) |
---|
207 | (317 :rpl_whoisidle) |
---|
208 | (318 :rpl_endofwhois) |
---|
209 | (319 :rpl_whoischannels) |
---|
210 | (320 :rpl_whoisidentified) ; Seen in dancer ircd source |
---|
211 | (321 :rpl_liststart) |
---|
212 | (322 :rpl_list) |
---|
213 | (323 :rpl_listend) |
---|
214 | (324 :rpl_channelmodeis) |
---|
215 | (325 :rpl_uniqopis) |
---|
216 | (326 :rpl_whoisoperprivs) ; Seen in dancer ircd source |
---|
217 | (327 :rpl_whoisrealhost) ; Seen in dancer ircd source |
---|
218 | (328 :rpl_channel_url) |
---|
219 | (329 :rpl_creationtime) ; Seen in dancer ircd source |
---|
220 | (330 :rpl_whoisidentified) |
---|
221 | (331 :rpl_notopic) |
---|
222 | (332 :rpl_topic) |
---|
223 | (333 :rpl_topicwhotime) ; Seen in dancer ircd source |
---|
224 | (341 :rpl_inviting) |
---|
225 | (342 :rpl_summoning) |
---|
226 | (346 :rpl_invitelist) |
---|
227 | (347 :rpl_endofinvitelist) |
---|
228 | (348 :rpl_exceptlist) |
---|
229 | (349 :rpl_endofexceptlist) |
---|
230 | (351 :rpl_version) |
---|
231 | (352 :rpl_whoreply) |
---|
232 | (353 :rpl_namreply) |
---|
233 | (361 :rpl_killdone) |
---|
234 | (362 :rpl_closing) |
---|
235 | (363 :rpl_closeend) |
---|
236 | (366 :rpl_endofnames) |
---|
237 | (364 :rpl_links) |
---|
238 | (365 :rpl_endoflinks) |
---|
239 | (367 :rpl_banlist) |
---|
240 | (368 :rpl_endofbanlist) |
---|
241 | (369 :rpl_endofwhowas) |
---|
242 | (371 :rpl_info) |
---|
243 | (372 :rpl_motd) |
---|
244 | (373 :rpl_infostart) |
---|
245 | (374 :rpl_endofinfo) |
---|
246 | (375 :rpl_motdstart) |
---|
247 | (376 :rpl_endofmotd) |
---|
248 | (377 :rpl_map) ; Seen in dancer ircd source |
---|
249 | (378 :rpl_endofmap) ; Seen in dancer ircd source |
---|
250 | (379 :rpl_forward) ; Seen in dancer ircd source |
---|
251 | (381 :rpl_youreoper) |
---|
252 | (382 :rpl_rehashing) |
---|
253 | (383 :rpl_yourservice) |
---|
254 | (384 :rpl_myportis) |
---|
255 | (391 :rpl_time) |
---|
256 | (392 :rpl_usersstart) |
---|
257 | (393 :rpl_users) |
---|
258 | (394 :rpl_endofusers) |
---|
259 | (395 :rpl_nousers) |
---|
260 | (396 :rpl_hiddenhost) |
---|
261 | (399 :rpl_message) ; Seen in dancer ircd source |
---|
262 | (401 :err_nosuchnick) |
---|
263 | (402 :err_nosuchserver) |
---|
264 | (403 :err_nosuchchannel) |
---|
265 | (404 :err_cannotsendtochan) |
---|
266 | (405 :err_toomanychannels) |
---|
267 | (406 :err_wasnosuchnick) |
---|
268 | (407 :err_toomanytargets) |
---|
269 | (408 :err_nosuchservice) |
---|
270 | (409 :err_noorigin) |
---|
271 | (410 :err_services_offline) ; Seen in dancer ircd source |
---|
272 | (411 :err_norecipient) |
---|
273 | (412 :err_notexttosend) |
---|
274 | (413 :err_notoplevel) |
---|
275 | (414 :err_wildtoplevel) |
---|
276 | (415 :err_badmask) |
---|
277 | (421 :err_unknowncommand) |
---|
278 | (422 :err_nomotd) |
---|
279 | (423 :err_noadmininfo) |
---|
280 | (424 :err_fileerror) |
---|
281 | (431 :err_nonicknamegiven) |
---|
282 | (432 :err_erroneusnickname) |
---|
283 | (433 :err_nicknameinuse) |
---|
284 | (436 :err_nickcollision) |
---|
285 | (437 :err_unavailresource) |
---|
286 | (438 :err_bannickchange) ; Seen in dancer ircd source |
---|
287 | (441 :err_usernotinchannel) |
---|
288 | (442 :err_notonchannel) |
---|
289 | (443 :err_useronchannel) |
---|
290 | (444 :err_nologin) |
---|
291 | (445 :err_summondisabled) |
---|
292 | (446 :err_userdisabled) |
---|
293 | (447 :err_targetninvite) ; Seen in dancer ircd source |
---|
294 | (448 :err_sourceninvite) ; Seen in dancer ircd source |
---|
295 | (451 :err_notregistered) |
---|
296 | (461 :err_needmoreparams) |
---|
297 | (462 :err_alreadyregistered) |
---|
298 | (463 :err_nopermforhost) |
---|
299 | (464 :err_passwdmismatch) |
---|
300 | (465 :err_yourebannedcreep) |
---|
301 | (466 :err_youwillbebanned) |
---|
302 | (467 :err_keyset) |
---|
303 | (471 :err_channelisfull) |
---|
304 | (472 :err_unknownmode) |
---|
305 | (473 :err_inviteonlychan) |
---|
306 | (474 :err_bannedfromchan) |
---|
307 | (475 :err_badchannelkey) |
---|
308 | (476 :err_badchanmask) |
---|
309 | (477 :err_nochanmodes) |
---|
310 | (478 :err_banlistfull) |
---|
311 | (479 :err_badchanname) ; Seen in dancer ircd source |
---|
312 | (480 :err_throttled) ; Seen in dancer ircd source |
---|
313 | (481 :err_noprivileges) |
---|
314 | (482 :err_chanoprivsneeded) |
---|
315 | (483 :err_cantkillserver) |
---|
316 | (484 :err_restricted) |
---|
317 | (485 :err_uniqopprivsneeded) |
---|
318 | (486 :err_restricted) ; Seen in dancer ircd source |
---|
319 | (487 :err_no_op_split) ; Seen in dancer ircd source |
---|
320 | (488 :err_need_umode) ; Seen in dancer ircd source |
---|
321 | (491 :err_nooperhost) |
---|
322 | (501 :err_umodeunknownflag) |
---|
323 | (502 :err_usersdontmatch) |
---|
324 | (503 :err_ghostedclient) ; Seen in dancer ircd source |
---|
325 | (505 :err_blocking_notid) ; Seen in dancer ircd source |
---|
326 | (511 :err_sitelistfull) ; Seen in dancer ircd source |
---|
327 | (512 :err_maxmapnodes) ; Seen in dancer ircd source |
---|
328 | (513 :err_maxforwarding) ; Seen in dancer ircd source |
---|
329 | (514 :err_noforwarding) ; Seen in dancer ircd source |
---|
330 | (515 :err_nounidentified) ; Seen in dancer ircd source |
---|
331 | (516 :err_last_err_msg) ; Seen in dancer ircd source |
---|
332 | (671 :rpl_secureconnection) |
---|
333 | (710 :rpl_knock) |
---|
334 | )) |
---|
335 | |
---|