Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Recognise 005 (RPL_X_ISUPPORT) CASEMAPPING

  • Loading branch information...
commit 08effddd9017bf687d4b6176ab567d81b222e5dd 1 parent bdca1e0
Sound and Fury authored
Showing with 55 additions and 2 deletions.
  1. +1 −1  buffer.h
  2. +53 −0 irc.c
  3. +1 −1  numeric.h
View
2  buffer.h
@@ -55,7 +55,7 @@ typedef struct _buf
bool alert; // tab has new messages?
bool namreply; // tab is in the middle of reading a list of NAMES replies (RPL_NAMREPLY)?
bool live; // tab is connected? when checking in a CHANNEL, remember to AND it with the parent's live (use LIVE(buf), defined further up this file)
- cmap casemapping;
+ cmap casemapping; // the SERVER's value is authoritative; the CHANNEL's value is ignored. STATUS's value is irrelevant.
}
buffer;
View
53 irc.c
@@ -337,6 +337,59 @@ int irc_numeric(char *cmd, int b) // TODO check the strtok()s for NULLs
int skip=0;
switch(num)
{
+ case RPL_X_ISUPPORT:
+ // 005 dest {[-]parameter|parameter=value}+ :are supported by this server
+ rest=strtok(NULL, " ");
+ while(rest)
+ {
+ if(*rest==':') // end of parameter list
+ {
+ break;
+ }
+ else
+ {
+ bool min=false;
+ char *value=NULL;
+ if(*rest=='-')
+ {
+ min=true;
+ rest++;
+ }
+ else
+ {
+ char *eq=strchr(rest, '=');
+ if(eq)
+ {
+ value=eq+1;
+ }
+ *eq=0;
+ }
+ if(strcmp(rest, "CASEMAPPING")==0)
+ {
+ if(value)
+ {
+ if(strcmp(value, "ascii")==0)
+ {
+ bufs[b].casemapping=ASCII;
+ }
+ else if(strcmp(value, "strict-rfc1459")==0)
+ {
+ bufs[b].casemapping=STRICT_RFC1459;
+ }
+ else
+ {
+ bufs[b].casemapping=RFC1459;
+ }
+ }
+ else
+ {
+ bufs[b].casemapping=RFC1459;
+ }
+ }
+ }
+ rest=strtok(NULL, " ");
+ }
+ break;
case RPL_NAMREPLY:
// 353 dest {@|+} #chan :name [name [...]]
strtok(NULL, " "); // @ or +, dunno what for
View
2  numeric.h
@@ -58,7 +58,7 @@
#define ERR_USERSDONTMATCH 502 // ":Cant change mode for other users" Error sent to any user trying to view or change the user mode for a user other than themselves.
/* Command responses */
-
+#define RPL_X_ISUPPORT 005 // http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt
#define RPL_NONE 300 // Dummy reply number. Not used.
#define RPL_USERHOST 302 // ":[<reply>{<space><reply>}]" Reply format used by USERHOST to list replies to the query list. The reply string is composed as follows: <reply> ::= <nick>['*'] '=' <'+'|'-'><hostname> The '*' indicates whether the client has registered as an Operator. The '-' or '+' characters represent whether the client has set an AWAY message or not respectively.
#define RPL_ISON 303 // ":[<nick> {<space><nick>}]" Reply format used by ISON to list replies to the query list.
Please sign in to comment.
Something went wrong with that request. Please try again.