Assembla home | Assembla project page
 

root/trunk/Phergie/Event/Response.php

Revision 217, 24.2 kB (checked in by Slynderdale, 6 months ago)

Some final clean up.

Line 
1 <?php
2
3 /**
4  * Event originating from the server in response to an event sent by the
5  * current client.
6  *
7  * @see http://www.irchelp.org/irchelp/rfc/chapter6.html
8  */
9 class Phergie_Event_Response
10 {
11     /**
12      * <nickname> :No such nick/channel
13      *
14      * Used to indicate the nickname parameter supplied to a command is currently
15      * unused.
16      */
17     const ERR_NOSUCHNICK = '401';
18
19     /**
20      * <server name> :No such server
21      *
22      * Used to indicate the server name given currently doesn't exist.
23      */
24     const ERR_NOSUCHSERVER = '402';
25
26     /**
27      * <channel name> :No such channel
28      *
29      * Used to indicate the given channel name is invalid.
30      */
31     const ERR_NOSUCHCHANNEL = '403';
32
33     /**
34      * <channel name> :Cannot send to channel
35      *
36      * Sent to a user who is either (a) not on a channel which is mode +n or (b) not
37      * a chanop (or mode +v) on a channel which has mode +m set and is trying to send
38      * a PRIVMSG message to that channel.
39      */
40     const ERR_CANNOTSENDTOCHAN = '404';
41
42     /**
43      * <channel name> :You have joined too many channels
44      *
45      * Sent to a user when they have joined the maximum number of allowed channels
46      * and they try to join another channel.
47      */
48     const ERR_TOOMANYCHANNELS = '405';
49
50     /**
51      * <nickname> :There was no such nickname
52      *
53      * Returned by WHOWAS to indicate there is no history information for that
54      * nickname.
55      */
56     const ERR_WASNOSUCHNICK = '406';
57
58     /**
59      * <target> :Duplicate recipients. No message delivered
60      *
61      * Returned to a client which is attempting to send PRIVMSG/NOTICE using the
62      * user@host destination format and for a user@host which has several
63      * occurrences.
64      */
65     const ERR_TOOMANYTARGETS = '407';
66
67     /**
68      * :No origin specified
69      *
70      * PING or PONG message missing the originator parameter which is required since
71      * these commands must work without valid prefixes.
72      */
73     const ERR_NOORIGIN = '409';
74
75     /**
76      * :No recipient given (<command>)
77      */
78     const ERR_NORECIPIENT = '411';
79
80     /**
81      * :No text to send
82      */
83     const ERR_NOTEXTTOSEND = '412';
84
85     /**
86      * <mask> :No toplevel domain specified
87      */
88     const ERR_NOTOPLEVEL = '413';
89
90     /**
91      * <mask> :Wildcard in toplevel domain
92      *
93      * 412 - 414 are returned by PRIVMSG to indicate that the message wasn't
94      * delivered for some reason. ERR_NOTOPLEVEL and ERR_WILDTOPLEVEL are errors that
95      * are returned when an invalid use of "PRIVMSG $<server>" or "PRIVMSG #<host>"
96      * is attempted.
97      */
98     const ERR_WILDTOPLEVEL = '414';
99
100     /**
101      * <command> :Unknown command
102      *
103      * Returned to a registered client to indicate that the command sent is unknown
104      * by the server.
105      */
106     const ERR_UNKNOWNCOMMAND = '421';
107
108     /**
109      * :MOTD File is missing
110      *
111      * Server's MOTD file could not be opened by the server.
112      */
113     const ERR_NOMOTD = '422';
114
115     /**
116      * <server> :No administrative info available
117      *
118      * Returned by a server in response to an ADMIN message when there is an error in
119      * finding the appropriate information.
120      */
121     const ERR_NOADMININFO = '423';
122
123     /**
124      * :File error doing <file op> on <file>
125      *
126      * Generic error message used to report a failed file operation during the
127      * processing of a message.
128      */
129     const ERR_FILEERROR = '424';
130
131     /**
132      * :No nickname given
133      *
134      * Returned when a nickname parameter expected for a command and isn't found.
135      */
136     const ERR_NONICKNAMEGIVEN = '431';
137
138     /**
139      * <nick> :Erroneus nickname
140      *
141      * Returned after receiving a NICK message which contains characters which do not
142      * fall in the defined set. See section x.x.x for details on valid nicknames.
143      */
144     const ERR_ERRONEUSNICKNAME = '432';
145
146     /**
147      * <nick> :Nickname is already in use
148      *
149      * Returned when a NICK message is processed that results in an attempt to change
150      * to a currently existing nickname.
151      */
152     const ERR_NICKNAMEINUSE = '433';
153
154     /**
155      * <nick> :Nickname collision KILL
156      *
157      * Returned by a server to a client when it detects a nickname collision
158      * (registered of a NICK that already exists by another server).
159      */
160     const ERR_NICKCOLLISION = '436';
161
162     /**
163      * <nick> <channel> :They aren't on that channel
164      *
165      * Returned by the server to indicate that the target user of the command is not
166      * on the given channel.
167      */
168     const ERR_USERNOTINCHANNEL = '441';
169
170     /**
171      * <channel> :You're not on that channel
172      *
173      * Returned by the server whenever a client tries to perform a channel effecting
174      * command for which the client isn't a member.
175      */
176     const ERR_NOTONCHANNEL = '442';
177
178     /**
179      * <user> <channel> :is already on channel
180      *
181      * Returned when a client tries to invite a user to a channel they are already
182      * on.
183      */
184     const ERR_USERONCHANNEL = '443';
185
186     /**
187      * <user> :User not logged in
188      *
189      * Returned by the summon after a SUMMON command for a user was unable to be
190      * performed since they were not logged in.
191      */
192     const ERR_NOLOGIN = '444';
193
194     /**
195      * :SUMMON has been disabled
196      *
197      * Returned as a response to the SUMMON command. Must be returned by any server
198      * which does not implement it.
199      */
200     const ERR_SUMMONDISABLED = '445';
201
202     /**
203      * :USERS has been disabled
204      *
205      * Returned as a response to the USERS command. Must be returned by any server
206      * which does not implement it.
207      */
208     const ERR_USERSDISABLED = '446';
209
210     /**
211      * :You have not registered
212      *
213      * Returned by the server to indicate that the client must be registered before
214      * the server will allow it to be parsed in detail.
215      */
216     const ERR_NOTREGISTERED = '451';
217
218     /**
219      * <command> :Not enough parameters
220      *
221      * Returned by the server by numerous commands to indicate to the client that it
222      * didn't supply enough parameters.
223      */
224     const ERR_NEEDMOREPARAMS = '461';
225
226     /**
227      * :You may not reregister
228      *
229      * Returned by the server to any link which tries to change part of the
230      * registered details (such as password or user details from second USER
231      * message).
232      */
233     const ERR_ALREADYREGISTRED = '462';
234
235     /**
236      * :Your host isn't among the privileged
237      *
238      * Returned to a client which attempts to register with a server which does not
239      * been setup to allow connections from the host the attempted connection is
240      * tried.
241      */
242     const ERR_NOPERMFORHOST = '463';
243
244     /**
245      * :Password incorrect
246      *
247      * Returned to indicate a failed attempt at registering a connection for which a
248      * password was required and was either not given or incorrect.
249      */
250     const ERR_PASSWDMISMATCH = '464';
251
252     /**
253      * :You are banned from this server
254      *
255      * Returned after an attempt to connect and register yourself with a server which
256      * has been setup to explicitly deny connections to you.
257      */
258     const ERR_YOUREBANNEDCREEP = '465';
259
260     /**
261      * <channel> :Channel key already set
262      */
263     const ERR_KEYSET = '467';
264
265     /**
266      * <channel> :Cannot join channel (+l)
267      */
268     const ERR_CHANNELISFULL = '471';
269
270     /**
271      * <char> :is unknown mode char to me
272      */
273     const ERR_UNKNOWNMODE = '472';
274
275     /**
276      * <channel> :Cannot join channel (+i)
277      */
278     const ERR_INVITEONLYCHAN = '473';
279
280     /**
281      * <channel> :Cannot join channel (+b)
282      */
283     const ERR_BANNEDFROMCHAN = '474';
284
285     /**
286      * <channel> :Cannot join channel (+k)
287      */
288     const ERR_BADCHANNELKEY = '475';
289
290     /**
291      * :Permission Denied- You're not an IRC operator
292      *
293      * Any command requiring operator privileges to operate must return this error to
294      * indicate the attempt was unsuccessful.
295      */
296     const ERR_NOPRIVILEGES = '481';
297
298     /**
299      * <channel> :You're not channel operator
300      *
301      * Any command requiring 'chanop' privileges (such as MODE messages) must return
302      * this error if the client making the attempt is not a chanop on the specified
303      * channel.
304      */
305     const ERR_CHANOPRIVSNEEDED = '482';
306
307     /**
308      * :You cant kill a server!
309      *
310      * Any attempts to use the KILL command on a server are to be refused and this
311      * error returned directly to the client.
312      */
313     const ERR_CANTKILLSERVER = '483';
314
315     /**
316      * :No O-lines for your host
317      *
318      * If a client sends an OPER message and the server has not been configured to
319      * allow connections from the client's host as an operator, this error must be
320      * returned.
321      */
322     const ERR_NOOPERHOST = '491';
323
324     /**
325      * :Unknown MODE flag
326      *
327      * Returned by the server to indicate that a MODE message was sent with a
328      * nickname parameter and that the a mode flag sent was not recognized.
329      */
330     const ERR_UMODEUNKNOWNFLAG = '501';
331
332     /**
333      * :Cant change mode for other users
334      *
335      * Error sent to any user trying to view or change the user mode for a user other
336      * than themselves.
337      */
338     const ERR_USERSDONTMATCH = '502';
339
340     /**
341      * Dummy reply number. Not used.
342      */
343     const RPL_NONE = '300';
344
345     /**
346      * :[<reply>{<space><reply>}]
347      *
348      * Reply format used by USERHOST to list replies to the query list. The reply
349      * string is composed as follows: <reply> ::= <nick>['*'] '=' <'+'|'-'><hostname>
350      * The '*' indicates whether the client has registered as an Operator. The '-' or
351      * '+' characters represent whether the client has set an AWAY message or not
352      * respectively.
353      */
354     const RPL_USERHOST = '302';
355
356     /**
357      * :[<nick> {<space><nick>}]
358      *
359      * Reply format used by ISON to list replies to the query list.
360      */
361     const RPL_ISON = '303';
362
363     /**
364      * <nick> :<away message>
365      */
366     const RPL_AWAY = '301';
367
368     /**
369      * :You are no longer marked as being away
370      */
371     const RPL_UNAWAY = '305';
372
373     /**
374      * :You have been marked as being away
375      *
376      * These replies are used with the AWAY command (if allowed). RPL_AWAY is sent to
377      * any client sending a PRIVMSG to a client which is away. RPL_AWAY is only sent
378      * by the server to which the client is connected. Replies RPL_UNAWAY and
379      * RPL_NOWAWAY are sent when the client removes and sets an AWAY message.
380      */
381     const RPL_NOWAWAY = '306';
382
383     /**
384      * <nick> <user> <host> * :<real name>
385      */
386     const RPL_WHOISUSER = '311';
387
388     /**
389      * <nick> <server> :<server info>
390      */
391     const RPL_WHOISSERVER = '312';
392
393     /**
394      * <nick> :is an IRC operator
395      */
396     const RPL_WHOISOPERATOR = '313';
397
398     /**
399      * <nick> <integer> :seconds idle
400      */
401     const RPL_WHOISIDLE = '317';
402
403     /**
404      * <nick> :End of /WHOIS list
405      */
406     const RPL_ENDOFWHOIS = '318';
407
408     /**
409      * <nick> :{[@|+]<channel><space>}
410      *
411      * Replies 311 - 313, 317 - 319 are all replies generated in response to a WHOIS
412      * message. Given that there are enough parameters present, the answering server
413      * must either formulate a reply out of the above numerics (if the query nick is
414      * found) or return an error reply. The '*' in RPL_WHOISUSER is there as the
415      * literal character and not as a wild card. For each reply set, only
416      * RPL_WHOISCHANNELS may appear more than once (for long lists of channel names).
417      * The '@' and '+' characters next to the channel name indicate whether a client
418      * is a channel operator or has been granted permission to speak on a moderated
419      * channel. The RPL_ENDOFWHOIS reply is used to mark the end of processing a
420      * WHOIS message.
421      */
422     const RPL_WHOISCHANNELS = '319';
423
424     /**
425      * <nick> <user> <host> * :<real name>
426      */
427     const RPL_WHOWASUSER = '314';
428
429     /**
430      * <nick> :End of WHOWAS
431      *
432      * When replying to a WHOWAS message, a server must use the replies
433      * RPL_WHOWASUSER, RPL_WHOISSERVER or ERR_WASNOSUCHNICK for each nickname in the
434      * presented list. At the end of all reply batches, there must be RPL_ENDOFWHOWAS
435      * (even if there was only one reply and it was an error).
436      */
437     const RPL_ENDOFWHOWAS = '369';
438
439     /**
440      * Channel :Users Name
441      */
442     const RPL_LISTSTART = '321';
443
444     /**
445      * <channel> <# visible> :<topic>
446      */
447     const RPL_LIST = '322';
448
449     /**
450      * :End of /LIST
451      *
452      * Replies RPL_LISTSTART, RPL_LIST, RPL_LISTEND mark the start, actual replies
453      * with data and end of the server's response to a LIST command. If there are no
454      * channels available to return, only the start and end reply must be sent.
455      */
456     const RPL_LISTEND = '323';
457
458     /**
459      * <channel> <mode> <mode params>
460      */
461     const RPL_CHANNELMODEIS = '324';
462
463     /**
464      * <channel> :No topic is set
465      */
466     const RPL_NOTOPIC = '331';
467
468     /**
469      * <channel> :<topic>
470      *
471      * When sending a TOPIC message to determine the channel topic, one of two
472      * replies is sent. If the topic is set, RPL_TOPIC is sent back else RPL_NOTOPIC.
473      */
474     const RPL_TOPIC = '332';
475
476     /**
477      * <channel> <nick>
478      *
479      * Returned by the server to indicate that the attempted INVITE message was
480      * successful and is being passed onto the end client.
481      */
482     const RPL_INVITING = '341';
483
484     /**
485      * <user> :Summoning user to IRC
486      *
487      * Returned by a server answering a SUMMON message to indicate that it is
488      * summoning that user.
489      */
490     const RPL_SUMMONING = '342';
491
492     /**
493      * <version>.<debuglevel> <server> :<comments>
494      *
495      * Reply by the server showing its version details. The <version> is the version
496      * of the software being used (including any patchlevel revisions) and the
497      * <debuglevel> is used to indicate if the server is running in "debug mode". The
498      * "comments" field may contain any comments about the version or further version
499      * details.
500      */
501     const RPL_VERSION = '351';
502
503     /**
504      * <channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>
505      */
506     const RPL_WHOREPLY = '352';
507
508     /**
509      * <name> :End of /WHO list
510      *
511      * The RPL_WHOREPLY and RPL_ENDOFWHO pair are used to answer a WHO message. The
512      * RPL_WHOREPLY is only sent if there is an appropriate match to the WHO query.
513      * If there is a list of parameters supplied with a WHO message, a RPL_ENDOFWHO
514      * must be sent after processing each list item with <name> being the item.
515      */
516     const RPL_ENDOFWHO = '315';
517
518     /**
519      * <channel> :[[@|+]<nick> [[@|+]<nick> [...]]]
520      */
521     const RPL_NAMREPLY = '353';
522
523     /**
524      * <channel> :End of /NAMES list
525      *
526      * To reply to a NAMES message, a reply pair consisting of RPL_NAMREPLY and
527      * RPL_ENDOFNAMES is sent by the server back to the client. If there is no
528      * channel found as in the query, then only RPL_ENDOFNAMES is returned. The
529      * exception to this is when a NAMES message is sent with no parameters and all
530      * visible channels and contents are sent back in a series of RPL_NAMEREPLY
531      * messages with a RPL_ENDOFNAMES to mark the end.
532      */
533     const RPL_ENDOFNAMES = '366';
534
535     /**
536      * <mask> <server> :<hopcount> <server info>
537      */
538     const RPL_LINKS = '364';
539
540     /**
541      * <mask> :End of /LINKS list
542      *
543      * In replying to the LINKS message, a server must send replies back using the
544      * RPL_LINKS numeric and mark the end of the list using an RPL_ENDOFLINKS reply.v
545      */
546     const RPL_ENDOFLINKS = '365';
547
548     /**
549      * <channel> <banid>
550      */
551     const RPL_BANLIST = '367';
552
553     /**
554      * <channel> :End of channel ban list
555      *
556      * When listing the active 'bans' for a given channel, a server is required to
557      * send the list back using the RPL_BANLIST and RPL_ENDOFBANLIST messages. A
558      * separate RPL_BANLIST is sent for each active banid. After the banids have been
559      * listed (or if none present) a RPL_ENDOFBANLIST must be sent.
560      */
561     const RPL_ENDOFBANLIST = '368';
562
563     /**
564      * :<string>
565      */
566     const RPL_INFO = '371';
567
568     /**
569      * :End of /INFO list
570      *
571      * A server responding to an INFO message is required to send all its 'info' in a
572      * series of RPL_INFO messages with a RPL_ENDOFINFO reply to indicate the end of
573      * the replies.
574      */
575     const RPL_ENDOFINFO = '374';
576
577     /**
578      * :- <server> Message of the day -
579      */
580     const RPL_MOTDSTART = '375';
581
582     /**
583      * :- <text>
584      */
585     const RPL_MOTD = '372';
586
587     /**
588      * :End of /MOTD command
589      *
590      * When responding to the MOTD message and the MOTD file is found, the file is
591      * displayed line by line, with each line no longer than 80 characters, using
592      * RPL_MOTD format replies. These should be surrounded by a RPL_MOTDSTART (before
593      * the RPL_MOTDs) and an RPL_ENDOFMOTD (after).
594      */
595     const RPL_ENDOFMOTD = '376';
596
597     /**
598      * :You are now an IRC operator
599      *
600      * RPL_YOUREOPER is sent back to a client which has just successfully issued an
601      * OPER message and gained operator status.
602      */
603     const RPL_YOUREOPER = '381';
604
605     /**
606      * <config file> :Rehashing
607      *
608      * If the REHASH option is used and an operator sends a REHASH message, an
609      * RPL_REHASHING is sent back to the operator.
610      */
611     const RPL_REHASHING = '382';
612
613     /**
614      * <server> :<string showing server's local time>
615      *
616      * When replying to the TIME message, a server must send the reply using the
617      * RPL_TIME format above. The string showing the time need only contain the
618      * correct day and time there. There is no further requirement for the time
619      * string.
620      */
621     const RPL_TIME = '391';
622
623     /**
624      * :UserID Terminal Host
625      */
626     const RPL_USERSSTART = '392';
627
628     /**
629      * :%-8s %-9s %-8s
630      */
631     const RPL_USERS = '393';
632
633     /**
634      * :End of users
635      */
636     const RPL_ENDOFUSERS = '394';
637
638     /**
639      * :Nobody logged in
640      *
641      * If the USERS message is handled by a server, the replies RPL_USERSTART,
642      * RPL_USERS, RPL_ENDOFUSERS and RPL_NOUSERS are used. RPL_USERSSTART must be
643      * sent first, following by either a sequence of RPL_USERS or a single
644      * RPL_NOUSER. Following this is RPL_ENDOFUSERS.
645      */
646     const RPL_NOUSERS = '395';
647
648     /**
649      * Link <version & debug level> <destination> <next server>
650      */
651     const RPL_TRACELINK = '200';
652
653     /**
654      * Try. <class> <server>
655      */
656     const RPL_TRACECONNECTING = '201';
657
658     /**
659      * H.S. <class> <server>
660      */
661     const RPL_TRACEHANDSHAKE = '202';
662
663     /**
664      * ???? <class> [<client IP address in dot form>]
665      */
666     const RPL_TRACEUNKNOWN = '203';
667
668     /**
669      * Oper <class> <nick>
670      */
671     const RPL_TRACEOPERATOR = '204';
672
673     /**
674      * User <class> <nick>
675      */
676     const RPL_TRACEUSER = '205';
677
678     /**
679      * Serv <class> <int>S <int>C <server> <nick!user|*!*>@<host|server>
680      */
681     const RPL_TRACESERVER = '206';
682
683     /**
684      * <newtype> 0 <client name>
685      */
686     const RPL_TRACENEWTYPE = '208';
687
688     /**
689      * File <logfile> <debug level>
690      *
691      * The RPL_TRACE* are all returned by the server in response to the TRACE
692      * message. How many are returned is dependent on the the TRACE message and
693      * whether it was sent by an operator or not. There is no predefined order for
694      * which occurs first. Replies RPL_TRACEUNKNOWN, RPL_TRACECONNECTING and
695      * RPL_TRACEHANDSHAKE are all used for connections which have not been fully
696      * established and are either unknown, still attempting to connect or in the
697      * process of completing the 'server handshake'. RPL_TRACELINK is sent by any
698      * server which handles a TRACE message and has to pass it on to another server.
699      * The list of RPL_TRACELINKs sent in response to a TRACE command traversing the
700      * IRC network should reflect the actual connectivity of the servers themselves
701      * along that path. RPL_TRACENEWTYPE is to be used for any connection which does
702      * not fit in the other categories but is being displayed anyway.
703      */
704     const RPL_TRACELOG = '261';
705
706     /**
707      * <linkname> <sendq> <sent messages> <sent bytes> <received messages> <received
708      * bytes> <time open>
709      */
710     const RPL_STATSLINKINFO = '211';
711
712     /**
713      * <command> <count>
714      */
715     const RPL_STATSCOMMANDS = '212';
716
717     /**
718      * C <host> * <name> <port> <class>
719      */
720     const RPL_STATSCLINE = '213';
721
722     /**
723      * N <host> * <name> <port> <class>
724      */
725     const RPL_STATSNLINE = '214';
726
727     /**
728      * I <host> * <host> <port> <class>
729      */
730     const RPL_STATSILINE = '215';
731
732     /**
733      * K <host> * <username> <port> <class>
734      */
735     const RPL_STATSKLINE = '216';
736
737     /**
738      * Y <class> <ping frequency> <connect frequency> <max sendq>
739      */
740     const RPL_STATSYLINE = '218';
741
742     /**
743      * <stats letter> :End of /STATS report
744      */
745     const RPL_ENDOFSTATS = '219';
746
747     /**
748      * L <hostmask> * <servername> <maxdepth>
749      */
750     const RPL_STATSLLINE = '241';
751
752     /**
753      * :Server Up %d days %d:%02d:%02d
754      */
755     const RPL_STATSUPTIME =