Mercurial > hg > octave-lyh
comparison gui/src/qirc/IRCCodes.h @ 13588:52fd3b9ea848
Changed all #defines for IRC Codes to constants, as it should be. Assorted them in namespaces and gave them better readable names.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Wed, 03 Aug 2011 17:20:20 +0200 |
parents | 86d6c3b90ad7 |
children |
comparison
equal
deleted
inserted
replaced
13587:eba1ee1f31bb | 13588:52fd3b9ea848 |
---|---|
1 /*************************************************************************** | 1 /* OctaveGUI - A graphical user interface for Octave |
2 IRCCodes.h - description | 2 * Copyright (C) 2011 Jacob Dawid |
3 ------------------- | 3 * jacob.dawid@googlemail.com |
4 begin : Mon Sep 18 2000 | 4 * |
5 copyright : (C) 2000 by gerardo Puga | 5 * This program is free software: you can redistribute it and/or modify |
6 email : gere@mailroom.com | 6 * it under the terms of the GNU General Public License as published by |
7 ***************************************************************************/ | 7 * the Free Software Foundation, either version 3 of the License, or |
8 | 8 * (at your option) any later version. |
9 /*************************************************************************** | 9 * |
10 * * | 10 * This program is distributed in the hope that it will be useful, |
11 * This program is free software; you can redistribute it and/or modify * | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * it under the terms of the GNU General Public License as published by * | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 * the Free Software Foundation; either version 2 of the License, or * | 13 * GNU General Public License for more details. |
14 * (at your option) any later version. * | 14 * |
15 * * | 15 * You should have received a copy of the GNU General Public License |
16 ***************************************************************************/ | 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 */ | |
17 | 18 |
18 #ifndef IRCCODES_H | 19 #ifndef IRCCODES_H |
19 #define IRCCODES_H | 20 #define IRCCODES_H |
20 | 21 #include <QString> |
21 // ********* *********** | 22 |
22 // ************************ as seen on the RFC 2812 *********************** | 23 namespace IRCCommand |
23 // ********* *********** | 24 { |
24 | 25 const QString Password = "PASS"; |
25 // COMMAND STRINGS | 26 const QString Nick = "NICK"; |
26 // - connection registration | 27 const QString User = "USER"; |
27 #define COMMAND_PASS "PASS" | 28 const QString Operation = "OPER"; |
28 #define COMMAND_NICK "NICK" | 29 const QString Service = "SERVICE"; |
29 #define COMMAND_USER "USER" | 30 const QString Quit = "QUIT"; |
30 #define COMMAND_OPER "OPER" | 31 const QString ServerQuit = "SQUIT"; |
31 #define COMMAND_SERVICE "SERVICE" | 32 |
32 #define COMMAND_QUIT "QUIT" | 33 const QString Join = "JOIN"; |
33 #define COMMAND_SQUIT "SQUIT" | 34 const QString Part = "PART"; |
34 // - channel operations | 35 const QString Mode = "MODE"; |
35 #define COMMAND_JOIN "JOIN" | 36 const QString Topic = "TOPIC"; |
36 #define COMMAND_PART "PART" | 37 const QString Names = "NAMES"; |
37 #define COMMAND_MODE "MODE" | 38 const QString List = "LIST"; |
38 #define COMMAND_TOPIC "TOPIC" | 39 const QString Invite = "INVITE"; |
39 #define COMMAND_NAMES "NAMES" | 40 const QString Kick = "KICK"; |
40 #define COMMAND_LIST "LIST" | 41 |
41 #define COMMAND_INVITE "INVITE" | 42 const QString PrivateMessage = "PRIVMSG"; |
42 #define COMMAND_KICK "KICK" | 43 const QString Notice = "NOTICE"; |
43 // - sending messages | 44 |
44 #define COMMAND_PRIVMSG "PRIVMSG" | 45 const QString MessageOfTheDay = "MOTD"; |
45 #define COMMAND_NOTICE "NOTICE" | 46 const QString ListUsers = "LUSERS"; |
46 // - server queries and commands | 47 const QString Version = "VERSION"; |
47 #define COMMAND_MOTD "MOTD" | 48 const QString Stats = "STATS"; |
48 #define COMMAND_LUSERS "LUSERS" | 49 const QString Links = "LINKS"; |
49 #define COMMAND_VERSION "VERSION" | 50 const QString Time = "TIME"; |
50 #define COMMAND_STATS "STATS" | 51 const QString Command = "CONNECT"; |
51 #define COMMAND_LINKS "LINKS" | 52 const QString Trace = "TRACE"; |
52 #define COMMAND_TIME "TIME" | 53 const QString Admin = "ADMIN"; |
53 #define COMMAND_CONNECT "CONNECT" | 54 const QString Info = "INFO"; |
54 #define COMMAND_TRACE "TRACE" | 55 |
55 #define COMMAND_ADMIN "ADMIN" | 56 const QString ServerList = "SERVLIST"; |
56 #define COMMAND_INFO "INFO" | 57 const QString ServerQuery = "SQUERY"; |
57 // - service query and commands | 58 |
58 #define COMMAND_SERVLIST "SERVLIST" | 59 const QString Who = "WHO"; |
59 #define COMMAND_SQUERY "SQUERY" | 60 const QString WhoIs = "WHOIS"; |
60 // - user based queries | 61 const QString WhoWas = "WHOWAS"; |
61 #define COMMAND_WHO "WHO" | 62 |
62 #define COMMAND_WHOIS "WHOIS" | 63 const QString Kill = "KILL"; |
63 #define COMMAND_WHOWAS "WHOWAS" | 64 const QString Ping = "PING"; |
64 // - miscellaneous messages | 65 const QString Pong = "PONG"; |
65 #define COMMAND_KILL "KILL" | 66 const QString Error = "ERROR"; |
66 #define COMMAND_PING "PING" | 67 |
67 #define COMMAND_PONG "PONG" | 68 const QString Away = "AWAY"; |
68 #define COMMAND_ERROR "ERROR" | 69 const QString Rehash = "REHASH"; |
69 // - optional features | 70 const QString Die = "DIE"; |
70 #define COMMAND_AWAY "AWAY" | 71 const QString Restart = "RESTART"; |
71 #define COMMAND_REHASH "REHASH" | 72 const QString Summon = "SUMMON"; |
72 #define COMMAND_DIE "DIE" | 73 const QString Users = "USERS"; |
73 #define COMMAND_RESTART "RESTART" | 74 const QString OperatorWall = "OPERWALL"; |
74 #define COMMAND_SUMMON "SUMMON" | 75 const QString UserHost = "USERHOST"; |
75 #define COMMAND_USERS "USERS" | 76 const QString IsOn = "ISON"; |
76 #define COMMAND_OPERWALL "OPERWALL" | 77 }; |
77 #define COMMAND_USERHOST "USERHOST" | 78 |
78 #define COMMAND_ISON "ISON" | 79 namespace IRCReply |
79 | 80 { |
80 // COMMAND REPLIES | 81 const int Welcome = 1; |
81 | 82 const int YourHost = 2; |
82 #define RPL_WELCOME 1 | 83 const int Created = 3; |
83 #define RPL_YOURHOST 2 | 84 const int MyInfo = 4; |
84 #define RPL_CREATED 3 | 85 const int ReplyBounce = 5; |
85 #define RPL_MYINFO 4 | 86 const int UserHost = 302; |
86 #define RPL_RPLBOUNCE 5 | 87 const int IsOn = 303; |
87 #define RPL_USERHOST 302 | 88 const int Away = 301; |
88 #define RPL_ISON 303 | 89 const int UnAway = 305; |
89 #define RPL_AWAY 301 | 90 const int NoAway = 306; |
90 #define RPL_UNAWAY 305 | 91 const int WhoIsUser = 311; |
91 #define RPL_NOWAWAY 306 | 92 const int WhoIsServer = 312; |
92 #define RPL_HWOISUSER 311 | 93 const int WhoIsOperator = 313; |
93 #define RPL_WHOISSERVER 312 | 94 const int WhoIsIdle = 317; |
94 #define RPL_WHOISOPERATOR 313 | 95 const int EndOfWhoIs = 318; |
95 #define RPL_WHOISIDLE 317 | 96 const int WhoIsChannels = 319; |
96 #define RPL_ENOFWHOIS 318 | 97 const int WhoWasUser = 314; |
97 #define RPL_WHOISCHANNELS 319 | 98 const int EndOfWhoWas = 369; |
98 #define RPL_WHOWASUSER 314 | 99 const int ListStart = 321; |
99 #define RPL_ENDOFWHOWAS 369 | 100 const int List = 322; |
100 #define RPL_LISTSTART 321 | 101 const int ListEnd = 323; |
101 #define RPL_LIST 322 | 102 const int UniqueOpIs = 325; |
102 #define RPL_LISTEND 323 | 103 const int ChannelModeIs = 324; |
103 #define RPL_UNIQOPIS 325 | 104 const int NoTopic = 331; |
104 #define RPL_CHANNELMODEIS 324 | 105 const int Topic = 332; |
105 #define RPL_NOTOPIC 331 | 106 const int Inviting = 341; |
106 #define RPL_TOPIC 332 | 107 const int Summoning = 342; |
107 #define RPL_INVITING 341 | 108 const int InviteList = 346; |
108 #define RPL_SUMMONING 342 | 109 const int EndOfInviteList = 347; |
109 #define RPL_INVITELIST 346 | 110 const int ExceptList = 348; |
110 #define RPL_ENDOFINVITELIST 347 | 111 const int EndOfExceptList = 349; |
111 #define RPL_EXCEPTLIST 348 | 112 const int Version = 351; |
112 #define RPL_ENDOFEXCEPTLIST 349 | 113 const int WhoReply = 352; |
113 #define RPL_VERSION 351 | 114 const int EndOfWho = 315; |
114 #define RPL_WHOREPLY 352 | 115 const int NameReply = 353; |
115 #define RPL_ENDOFWHO 315 | 116 const int EndOfNames = 366; |
116 #define RPL_NAMREPLY 353 | 117 const int Links = 364; |
117 #define RPL_ENDOFNAMES 366 | 118 const int EndOfLinks = 367; |
118 #define RPL_LINKS 364 | 119 const int BanList = 368; |
119 #define RPL_ENDOFLINKS 367 | 120 const int Info = 371; |
120 #define RPL_BANLIST 368 | 121 const int EndOfInfo = 374; |
121 #define RPL_INFO 371 | 122 const int MessageOfTheDayStart = 375; |
122 #define RPL_ENDOFINFO 374 | 123 const int MessageOfTheDay = 372; |
123 #define RPL_MOTDSTART 375 | 124 const int MessageOfTheDayEnd = 376; |
124 #define RPL_MOTD 372 | 125 const int YouAreOperator = 381; |
125 #define RPL_ENDOFMOTD 376 | 126 const int Rehashing = 382; |
126 #define RPL_YOUREOPER 381 | 127 const int YouAreService = 383; |
127 #define RPL_REHASHING 382 | 128 const int Time = 391; |
128 #define RPL_YOURESERVICE 383 | 129 const int UserStart = 392; |
129 #define RPL_TIME 391 | 130 const int Users = 393; |
130 #define RPL_USERSSTART 392 | 131 const int EndOfUsers = 394; |
131 #define RPL_USERS 393 | 132 const int NoUsers = 395; |
132 #define RPL_ENDOFUSERS 394 | 133 const int TraceLink = 200; |
133 #define RPL_NOUSERS 395 | 134 const int TraceConnecting = 201; |
134 #define RPL_TRACELINK 200 | 135 const int TraceHandshake = 202; |
135 #define RPL_TRACECONNECTING 201 | 136 const int TraceUnknown = 203; |
136 #define RPL_TRACEHANDSHAKE 202 | 137 const int TraceOperator = 204; |
137 #define RPL_TRACEUNKNOWN 203 | 138 const int TraceUser = 205; |
138 #define RPL_TRACEOPERATOR 204 | 139 const int TraceServer = 206; |
139 #define RPL_TRACEUSER 205 | 140 const int TraceService = 207; |
140 #define RPL_TRACESERVER 206 | 141 const int TraceNewType = 208; |
141 #define RPL_TRACESERVICE 207 | 142 const int TraceClass = 209; |
142 #define RPL_TRACENEWTYPE 208 | 143 const int TraceConnect = 210; |
143 #define RPL_TRACECLASS 209 | 144 const int TraceLog = 261; |
144 #define RPL_TRACECONNECT 210 | 145 const int TraceEnd = 262; |
145 #define RPL_TRACELOG 261 | 146 const int StatsLinkInfo = 211; |
146 #define RPL_TRACEEND 262 | 147 const int StatsCommands = 212; |
147 #define RPL_STATSLINKINFO 211 | 148 const int EndOfStats = 219; |
148 #define RPL_STATSCOMMANDS 212 | 149 const int StatsUptime = 242; |
149 #define RPL_ENDOFSTATS 219 | 150 const int StatsOnline = 243; |
150 #define RPL_STATSUPTIME 242 | 151 const int UModeIs = 221; |
151 #define RPL_STATSONLINE 243 | 152 const int ServerList = 234; |
152 #define RPL_UMODEIS 221 | 153 const int ServerListEnd = 235; |
153 #define RPL_SERVLIST 234 | 154 const int ListUserClient = 251; |
154 #define RPL_SERVLISTEND 235 | 155 const int ListUserOperator = 252; |
155 #define RPL_LUSERCLIENT 251 | 156 const int ListUserUnknown = 253; |
156 #define RPL_LUSEROP 252 | 157 const int ListUserChannels = 254; |
157 #define RPL_LUSERUNKNOWN 253 | 158 const int ListUserMe = 255; |
158 #define RPL_LUSERCHANNELS 254 | 159 const int AdminMe = 256; |
159 #define RPL_LUSERME 255 | 160 const int AdminLoc1 = 257; |
160 #define RPL_ADMINME 256 | 161 const int AdminLoc2 = 258; |
161 #define RPL_ADMINLOC1 257 | 162 const int AdminEmail = 259; |
162 #define RPL_ADMINLOC2 258 | 163 const int TryAgain = 263; |
163 #define RPL_ADMINEMAIL 259 | 164 }; |
164 #define RPL_TRYAGAIN 263 | 165 |
165 | 166 namespace IRCError |
166 // ERRROR REPLIES | 167 { |
167 | 168 const int NoSuchNick = 401; |
168 #define ERR_NOSUCHNICK 401 | 169 const int NoSuchServer = 402; |
169 #define ERR_NOSUCHSERVER 402 | 170 const int NoSuchChannel = 403; |
170 #define ERR_NOSUCHCHANNEL 403 | 171 const int CannotSendToChannel = 404; |
171 #define ERR_CANNOTSENDTOCHAN 404 | 172 const int TooManyChannels = 405; |
172 #define ERR_TOOMANYCHANNELS 405 | 173 const int WasNoSuchNick = 406; |
173 #define ERR_WASNOSUCHNICK 406 | 174 const int TooManyTargets = 407; |
174 #define ERR_TOOMANYTARGETS 407 | 175 const int NoSuchService = 408; |
175 #define ERR_NOSUCHSERVICE 408 | 176 const int NoOrigin = 409; |
176 #define ERR_NOORIGIN 409 | 177 const int NoRecipient = 411; |
177 #define ERR_NORECPIENT 411 | 178 const int NoTextToSend = 412; |
178 #define ERR_NOTEXTTOSEND 412 | 179 const int NoTopLevel = 413; |
179 #define ERR_NOTOPLEVEL 413 | 180 const int WildTopLevel = 414; |
180 #define ERR_WILDTOPLEVEL 414 | 181 const int BasMask = 415; |
181 #define ERR_BADMASK 415 | 182 const int UnknownCommand = 421; |
182 #define ERR_UNKNOWNCOMMAND 421 | 183 const int NoMessageOfTheDay = 422; |
183 #define ERR_NOMOTD 422 | 184 const int NoAdminInfo = 423; |
184 #define ERR_NOADMININFO 423 | 185 const int FileError = 424; |
185 #define ERR_FILEERROR 424 | 186 const int NoNickNameGiven = 431; |
186 #define ERR_NONICKNAMEGIVEN 431 | 187 const int ErroneusNick = 432; |
187 #define ERR_ERRONEUSNICKNAME 432 | 188 const int NicknameInUse = 433; |
188 #define ERR_NICKNAMEINUSE 433 | 189 const int NickCollision = 436; |
189 #define ERR_NICKCOLLISION 436 | 190 const int UnavailResource = 437; |
190 #define ERR_UNAVAILRESOURCE 437 | 191 const int UserNotInChannel = 441; |
191 #define ERR_USERNOTINCHANNEL 441 | 192 const int NotOnChannel = 442; |
192 #define ERR_NOTONCHANNEL 442 | 193 const int UserOnChannel = 443; |
193 #define ERR_USERONCHANNEL 443 | 194 const int NoLogin = 444; |
194 #define ERR_NOLOGIN 444 | 195 const int SummonDisabled = 445; |
195 #define ERR_SUMMONDISABLED 445 | 196 const int UsersDisabled = 446; |
196 #define ERR_USERSDISABLED 446 | 197 const int NotRegistered = 451; |
197 #define ERR_NOTREGISTERED 451 | 198 const int NeedMoreParams = 461; |
198 #define ERR_NEEDMOREPARAMS 461 | 199 const int AlreadyRegistered = 462; |
199 #define ERR_ALREADYREGISTRED 462 | 200 const int NoPermissionForHost = 463; |
200 #define ERR_NOPERMFORHOST 463 | 201 const int PasswordMismatch = 464; |
201 #define ERR_PASSWDMISMATCH 464 | 202 const int YouAreBannedCreep = 465; |
202 #define ERR_YOUREBANNEDCREEP 465 | 203 const int YouWillBeBanned = 466; |
203 #define ERR_YOUWILLBEBANNED 466 | 204 const int KeySet = 467; |
204 #define ERR_KEYSET 467 | 205 const int ChannelIsFull = 471; |
205 #define ERR_CHANNELISFULL 471 | 206 const int UnknownMode = 472; |
206 #define ERR_UNKNOWNMODE 472 | 207 const int InviteOnlyChannel = 473; |
207 #define ERR_INVITEONLYCHANNEL 473 | 208 const int BannedFromChannel = 474; |
208 #define ERR_BANNEDFROMCHAN 474 | 209 const int BadChannelKey = 475; |
209 #define ERR_BADCHANNELKEY 475 | 210 const int BadChannelMask = 476; |
210 #define ERR_BADCHANMASK 476 | 211 const int NoChannelModes = 477; |
211 #define ERR_NOCHANMODES 477 | 212 const int BanListFull = 478; |
212 #define ERR_BANLISTFULL 478 | 213 const int NoPrivileges = 481; |
213 #define ERR_NOPRIVILEGES 481 | 214 const int ChannelOperatorPrivilegesNeeded = 482; |
214 #define ERR_CHANOPPRIVNEEDED 482 | 215 const int CannotKillServer = 483; |
215 #define ERR_CANTKILLSERVER 483 | 216 const int Restricted = 484; |
216 #define ERR_RESTRICTED 484 | 217 const int UniqueOperatorPrivilegesNeeded = 485; |
217 #define ERR_UNIQOPPRIVSNEEDED 485 | 218 const int NoOperatorHost = 491; |
218 #define ERR_NOOPERHOST 491 | 219 const int YourModeListUnknownFlag = 501; |
219 #define ERR_UMODELUNKNOWNFLAG 501 | 220 const int UsersDontMatch = 502; |
220 #define ERR_USERSDONTMATCH 502 | 221 }; |
221 | 222 |
222 #endif | 223 #endif |