[X2serv-cvs] [CVS] Module x2: Change committed
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2004-06-09 23:33:23
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-06-09 23:33:13 UTC Modified files: source/chan.c source/commands.c source/config.h source/help.c source/parse.c source/parse.h source/set.c source/user.c Log message: Improved compatability with ircu/nefarious modes ---------------------- diff included ---------------------- Index: x2/source/chan.c diff -u x2/source/chan.c:1.87 x2/source/chan.c:1.88 --- x2/source/chan.c:1.87 Tue Mar 16 20:43:03 2004 +++ x2/source/chan.c Wed Jun 9 16:33:03 2004 @@ -841,6 +841,48 @@ *modeptr = *modeptr | CMODEm; *optr = *optr & ~CMODEm; break; + case 'r': + *modeptr = *modeptr | CMODEr; + *optr = *optr & ~CMODEr; + break; + case 'c': + *modeptr = *modeptr | CMODEc; + *optr = *optr & ~CMODEc; + break; + case 'S': + *modeptr = *modeptr | CMODES; + *optr = *optr & ~CMODES; + break; + case 'C': + *modeptr = *modeptr | CMODEC; + *optr = *optr & ~CMODEC; + break; + case 'M': + *modeptr = *modeptr | CMODEM; + *optr = *optr & ~CMODEM; + break; + case 'N': + *modeptr = *modeptr | CMODEN; + *optr = *optr & ~CMODEN; + break; + case 'O': + *modeptr = *modeptr | CMODEO; + *optr = *optr & ~CMODEO; + break; + case 'Q': + *modeptr = *modeptr | CMODEQ; + *optr = *optr & ~CMODEQ; + break; +#ifdef HAVE_SSL_MODE_z + case 'z': + *modeptr = *modeptr | CMODEz; + *optr = *optr & ~CMODEz; + break; +#endif + case 'T': + *modeptr = *modeptr | CMODET; + *optr = *optr & ~CMODET; + break; case 'k': if (modeptr == MinModes) { @@ -1589,10 +1631,10 @@ free(UpCaseChan); } -char *ConvertChanMode(char *StrModes, unsigned char Modes) +char *ConvertChanMode(char *StrModes, int Modes) { - unsigned char Mode; + int Mode; char *tmp; tmp = StrModes; @@ -1628,6 +1670,49 @@ if ((Mode & Modes) != 0) *StrModes++ = 'l'; + Mode = CMODEr; + if ((Mode & Modes) != 0) + *StrModes++ = 'r'; + + Mode = CMODEc; + if ((Mode & Modes) != 0) + *StrModes++ = 'c'; + + Mode = CMODES; + if ((Mode & Modes) != 0) + *StrModes++ = 'S'; + + Mode = CMODEC; + if ((Mode & Modes) != 0) + *StrModes++ = 'C'; + + Mode = CMODEM; + if ((Mode & Modes) != 0) + *StrModes++ = 'M'; + + Mode = CMODEN; + if ((Mode & Modes) != 0) + *StrModes++ = 'N'; + + Mode = CMODEO; + if ((Mode & Modes) != 0) + *StrModes++ = 'O'; + + Mode = CMODEQ; + if ((Mode & Modes) != 0) + *StrModes++ = 'Q'; + +#ifdef HAVE_SSL_MODE_z + Mode = CMODEz; + if ((Mode & Modes) != 0) + *StrModes++ = 'z'; +#endif + + + Mode = CMODET; + if ((Mode & Modes) != 0) + *StrModes++ = 'T'; + *StrModes = '\0'; return (tmp); } Index: x2/source/commands.c diff -u x2/source/commands.c:1.181 x2/source/commands.c:1.182 --- x2/source/commands.c:1.181 Tue Mar 16 20:43:03 2004 +++ x2/source/commands.c Wed Jun 9 16:33:03 2004 @@ -4672,10 +4672,11 @@ boolean Oper; char *UpCaseStr; char HelpFilePath[LINEBUFFSIZE]; - char* Comm; + char* Comm = NULL; Oper = IsOper(uptr); - Comm = strtok(rest, " "); + if(rest && *rest) + Comm = strtok(rest, " "); if (Comm && (strchr(Comm, '/') || strchr(Comm, '.'))) { @@ -4694,7 +4695,7 @@ } else { - send_to_user(uptr, "The operator help file is not available at the moment."); + send_to_user(uptr, "The operator help file is not available at the moment (%s).", strerror(errno)); return(FALSE); } } @@ -4708,7 +4709,7 @@ } else { - send_to_user(uptr, "The user help file is not available at the moment."); + send_to_user(uptr, "The user help file is not available at the moment (%s).", strerror(errno)); return(FALSE); } } Index: x2/source/config.h diff -u x2/source/config.h:1.75 x2/source/config.h:1.76 --- x2/source/config.h:1.75 Tue Mar 16 20:43:03 2004 +++ x2/source/config.h Wed Jun 9 16:33:03 2004 @@ -67,9 +67,8 @@ #define GATEURL "http://www.afternet.org/support/proxy.html" /* Uncomment the following for debugging. - * - * #define debugon */ +/* #define debugon */ /* If you dont want the word warez in channel names, define this. * TODO : This is a hack, and would do better in a config file. Do it! @@ -181,6 +180,10 @@ #define MAXRECVLEN 2000 #define MAXLINELEN 300 +/* Enable this if your ircu has ssl compiled in (mode +z) + */ +/* #define HAVE_SSL_MODE_z */ + /* Channels unvisited by (co)owner will be automatically * removed when they reach this many days old. */ @@ -206,6 +209,13 @@ /* These are for channel mode parsing */ #define NOMODES 0 +#define CMODET 1048576 +#define CMODEz 524288 +#define CMODEQ 262144 +#define CMODEO 131072 +#define CMODEN 65536 +#define CMODEM 32768 +#define CMODES 16384 #define CMODEu 8192 #define CMODEC 4096 #define CMODEc 2048 @@ -222,6 +232,7 @@ #define CMODEm 1 /* These are for User mode parsing.. */ +#define UMODEf 16384 #define UMODEh 8192 #define UMODEB 4096 #define UMODEaway 2048 Index: x2/source/help.c diff -u x2/source/help.c:1.1 x2/source/help.c:1.2 --- x2/source/help.c:1.1 Fri Mar 2 06:06:26 2001 +++ x2/source/help.c Wed Jun 9 16:33:03 2004 @@ -1,6 +1,6 @@ #include "config.h" -HelpSub(char *Target, char *Source) +int HelpSub(char *Target, char *Source) { char* ptr; int i; @@ -51,6 +51,7 @@ Target++; } *Target=0; + return 0; } int ShowCommHelp(UserListType uptr, FILE * HelpFile) Index: x2/source/parse.c diff -u x2/source/parse.c:1.85 x2/source/parse.c:1.86 --- x2/source/parse.c:1.85 Wed Jun 9 13:09:01 2004 +++ x2/source/parse.c Wed Jun 9 16:33:03 2004 @@ -99,6 +99,7 @@ { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, { "402", m_noop, TRUE, TRUE }, + { "FA", m_sethost, TRUE, FALSE }, { NULL, NULL, FALSE, FALSE } }; /* *INDENT-ON* */ @@ -121,6 +122,12 @@ return(0); } +int m_sethost(M_PARAMS) +{ + /* TODO: Change the host part of the structure */ + return(0); +} + int m_notice(M_PARAMS) { char* to; @@ -189,6 +196,7 @@ { char* to; char CSHOST[MAXLEN]; + char buff[MAXLEN]; to = (char *) strtok(rest, " "); rest = (char *) strtok(NULL, "\r\n\0"); @@ -197,7 +205,10 @@ sprintf(CSHOST, "%s@%s", IrcNick, ServiceName); if(!strcasecmp(to, CSHOST)) - strcpy(to, NumNick); + { + to = buff; + strcpy(buff, NumNick); + } if(to[0] == '#') { if(rest[0] == CommandMark) @@ -385,7 +396,7 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes, *account, *hiddenhost; + char* modes, *account, *hiddenhost, *modef; UserListType UserPtr; unsigned int IP; @@ -418,6 +429,10 @@ { hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka only) */ } + if(strchr(modes, 'f')) + { + hiddenhost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask */ + } Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } else Index: x2/source/parse.h diff -u x2/source/parse.h:1.11 x2/source/parse.h:1.12 --- x2/source/parse.h:1.11 Thu Jun 12 20:03:51 2003 +++ x2/source/parse.h Wed Jun 9 16:33:03 2004 @@ -27,4 +27,5 @@ int m_quit(M_PARAMS); int m_kill(M_PARAMS); int m_squit(M_PARAMS); +int m_sethost(M_PARAMS); Index: x2/source/set.c diff -u x2/source/set.c:1.6 x2/source/set.c:1.7 --- x2/source/set.c:1.6 Thu Feb 13 00:25:58 2003 +++ x2/source/set.c Wed Jun 9 16:33:03 2004 @@ -342,7 +342,7 @@ ConvertModeString(param, &cptr->PlusModes, &cptr->MinModes, &cptr->Key, &cptr->Limit); if(cptr->settings[INCHAN]) { - send_chanmode(cptr, "-k %s", cptr->CurrentKey); + /* ircu doesnt require this anymore: send_chanmode(cptr, "-k %s", cptr->CurrentKey); */ send_chanmode(cptr, "%s", GetModeString(ModeString, cptr->PlusModes, cptr->MinModes, cptr->Key, cptr->Limit)); } Index: x2/source/user.c diff -u x2/source/user.c:1.35 x2/source/user.c:1.36 --- x2/source/user.c:1.35 Sat Jun 14 13:24:18 2003 +++ x2/source/user.c Wed Jun 9 16:33:03 2004 @@ -569,6 +569,8 @@ case 'R': UserMode = UMODER; break; + case 'f': + UserMode = UMODEf; case '-': Operator = ch; break; ----------------------- End of diff ----------------------- |