diff -crN ../ircu2.10.06-DBH7-noproxy2/CAMBIOS ../ircu2.10.06-DBH8/CAMBIOS *** ../ircu2.10.06-DBH7-noproxy2/CAMBIOS Thu Jul 29 01:28:13 1999 --- ../ircu2.10.06-DBH8/CAMBIOS Thu Jul 29 01:32:24 1999 *************** *** 1,3 **** --- 1,14 ---- + * 1999/07/29 savage@apostols.org (patch.dbh8) + ----------------------------------------------------------------------- + Implementa el nuevo modo de usuario -/+h, conocido en otras redes como + HelpOperator, que vendrian a ser los Oper del irc-hispano. + Este modo (+h) se activa automaticamente si el nick esta registrado y + ademas en la tabla O (de OPERS). Los oper se lo pueden quitar o poner a + su antojo. La unica finalidad del modo +h es aparecer en el /WHOIS + indicando que el usuario es un Operador de Servicios IRC (raw 310) + Ademas mejora la implementacion de los modos automaticos al cambiar + de nick. + * 1999/07/28 savage@apostols.org (patch.noproxy2) ----------------------------------------------------------------------- Algunos cambios cosmeticos en los textos enviados al usuario. diff -crN ../ircu2.10.06-DBH7-noproxy2/include/numeric.h ../ircu2.10.06-DBH8/include/numeric.h *** ../ircu2.10.06-DBH7-noproxy2/include/numeric.h Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/include/numeric.h Wed Jul 28 16:41:54 1999 *************** *** 138,144 **** #define RPL_NOWAWAY 306 #if defined(DB_HISPANO) || defined(DB_ESNET) ! #define RPL_WHOISNICKREGISTERED 307 #else #define RPL_USERIP 307 /* Undernet extension */ #endif --- 138,145 ---- #define RPL_NOWAWAY 306 #if defined(DB_HISPANO) || defined(DB_ESNET) ! #define RPL_WHOISREGNICK 307 /* Hispano extension */ ! #define RPL_WHOISHELPOP 310 /* Hispano extension */ #else #define RPL_USERIP 307 /* Undernet extension */ #endif diff -crN ../ircu2.10.06-DBH7-noproxy2/include/s_bsd.h ../ircu2.10.06-DBH8/include/s_bsd.h *** ../ircu2.10.06-DBH7-noproxy2/include/s_bsd.h Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/include/s_bsd.h Wed Jul 28 18:33:58 1999 *************** *** 188,197 **** #define HMODE_NICKREGISTERED 0x00000001 /* Nick is registered (HISPANO/ESNET) */ #define HMODE_SOCKS 0x00000004 /* se esta chekeando socks */ #define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ /* Modos hispano a propagar */ #define SEND_HMODES \ ! (HMODE_NICKREGISTERED) /* Modos hispano TODOS */ #define ALL_HMODES \ --- 188,198 ---- #define HMODE_NICKREGISTERED 0x00000001 /* Nick is registered (HISPANO/ESNET) */ #define HMODE_SOCKS 0x00000004 /* se esta chekeando socks */ #define HMODE_WRSOCKS 0x00000008 /* se tiene ke escribir en socks */ + #define HMODE_HELPOP 0x00000010 /* Es un oper con modo +h */ /* Modos hispano a propagar */ #define SEND_HMODES \ ! (HMODE_NICKREGISTERED | HMODE_HELPOP) /* Modos hispano TODOS */ #define ALL_HMODES \ *************** *** 201,216 **** --- 202,220 ---- #define IsNickRegistered(x) ((x)->hmodes & HMODE_NICKREGISTERED) #define DoingSocks(x) ((x)->hmodes & HMODE_SOCKS) #define DoingWrSocks(x) ((x)->hmodes & HMODE_WRSOCKS) + #define IsHelpOp(x) ((x)->hmodes & HMODE_HELPOP) /* Macros para poner modos hispano */ #define SetNickRegistered(x) ((x)->hmodes |= HMODE_NICKREGISTERED) #define SetSocks(x) ((x)->hmodes |= HMODE_SOCKS) #define SetWrSocks(x) ((x)->hmodes |= HMODE_WRSOCKS) + #define SetHelpOp(x) ((x)->hmodes |= HMODE_HELPOP) /* Macros para borrar modos hispano */ #define ClearNickRegistered(x) ((x)->hmodes &= ~HMODE_NICKREGISTERED) #define ClearSocks(x) ((x)->hmodes &= ~HMODE_SOCKS) #define ClearWrSocks(x) ((x)->hmodes &= ~HMODE_WRSOCKS) + #define ClearHelpOp(x) ((x)->hmodes &= ~HMODE_HELPOP) #endif /* DB_HISPANO || DB_ESNET */ diff -crN ../ircu2.10.06-DBH7-noproxy2/include/s_user.h ../ircu2.10.06-DBH8/include/s_user.h *** ../ircu2.10.06-DBH7-noproxy2/include/s_user.h Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/include/s_user.h Thu Jul 29 00:54:39 1999 *************** *** 59,65 **** extern int m_ison(aClient *cptr, aClient *sptr, int parc, char *parv[]); extern char *umode_str(aClient *cptr); #if defined(DB_HISPANO) || defined(DB_ESNET) - void dbh_cambiar_registro_nick(char *nick, char modo); extern void send_umode(aClient *cptr, aClient *sptr, int old, int sendmask, int oldh, int sendhmask); #else extern void send_umode(aClient *cptr, aClient *sptr, int old, int sendmask); --- 59,64 ---- diff -crN ../ircu2.10.06-DBH7-noproxy2/ircd/s_debug.c ../ircu2.10.06-DBH8/ircd/s_debug.c *** ../ircu2.10.06-DBH7-noproxy2/ircd/s_debug.c Thu Jul 29 01:21:55 1999 --- ../ircu2.10.06-DBH8/ircd/s_debug.c Thu Jul 29 01:30:38 1999 *************** *** 202,208 **** #endif #ifdef DB_HISPANO '.','I','R','C','-', 'H','I','S','P','A','N','O','.','O','R','G',':', ! 'D','B','H' ,'7','+', 'N','+', --- 202,208 ---- #endif #ifdef DB_HISPANO '.','I','R','C','-', 'H','I','S','P','A','N','O','.','O','R','G',':', ! 'D','B','H' ,'8','+', 'N','+', diff -crN ../ircu2.10.06-DBH7-noproxy2/ircd/s_err.c ../ircu2.10.06-DBH8/ircd/s_err.c *** ../ircu2.10.06-DBH7-noproxy2/ircd/s_err.c Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/ircd/s_err.c Wed Jul 28 16:45:00 1999 *************** *** 311,328 **** {RPL_UNAWAY, ":You are no longer marked as being away"}, /* 306 */ {RPL_NOWAWAY, ":You have been marked as being away"}, - /* 307 */ #if defined(DB_HISPANO) || defined(DB_ESNET) ! {RPL_WHOISNICKREGISTERED, "%s :Tiene el nick Registrado y Protegido"}, #else {RPL_USERIP, ":"}, - #endif /* 308 */ {0, (char *)NULL}, /* 309 */ {0, (char *)NULL}, /* 310 */ {0, (char *)NULL}, /* 311 */ {RPL_WHOISUSER, "%s %s %s * :%s"}, /* 312 */ --- 311,335 ---- {RPL_UNAWAY, ":You are no longer marked as being away"}, /* 306 */ {RPL_NOWAWAY, ":You have been marked as being away"}, #if defined(DB_HISPANO) || defined(DB_ESNET) ! /* 307 */ ! {RPL_WHOISREGNICK, "%s :Tiene el nick Registrado y Protegido"}, ! /* 308 */ ! {0, (char *)NULL}, ! /* 309 */ ! {0, (char *)NULL}, ! /* 310 */ ! {RPL_WHOISHELPOP, "%s :Es un OPERador de los servicios de red"}, #else + /* 307 */ {RPL_USERIP, ":"}, /* 308 */ {0, (char *)NULL}, /* 309 */ {0, (char *)NULL}, /* 310 */ {0, (char *)NULL}, + #endif /* 311 */ {RPL_WHOISUSER, "%s %s %s * :%s"}, /* 312 */ diff -crN ../ircu2.10.06-DBH7-noproxy2/ircd/s_user.c ../ircu2.10.06-DBH8/ircd/s_user.c *** ../ircu2.10.06-DBH7-noproxy2/ircd/s_user.c Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/ircd/s_user.c Thu Jul 29 00:53:40 1999 *************** *** 735,740 **** --- 735,741 ---- #if defined(DB_HISPANO) || defined(DB_ESNET) static int user_hmodes[] = { HMODE_NICKREGISTERED, 'r', + HMODE_HELPOP, 'h', 0, 0 }; #endif /* DB_HISPANO || DB_ESNET */ *************** *** 1360,1374 **** return CPTR_KILLED; } } #if defined(DB_HISPANO) || defined(DB_ESNET) if( !IsServer(sptr) ) { ! dbh_cambiar_registro_nick(nick, hflag); ! if(hflag=='+') SetNickRegistered(sptr); /* por si era nuevo */ ! else ClearNickRegistered(sptr); /* por si era nuevo */ } #endif --- 1361,1386 ---- return CPTR_KILLED; } } + #if defined(DB_HISPANO) || defined(DB_ESNET) if( !IsServer(sptr) ) { ! int of, oh; ! static void send_umode_out(aClient *a, aClient *b, int c, int d); ! ! of=sptr->flags; ! oh=sptr->hmodes; ! if(hflag=='+') { SetNickRegistered(sptr); /* por si era nuevo */ ! if( dbh_buscar_registro_local(DBH_OPERDB, nick) ) ! SetHelpOp(sptr); ! } else { ClearNickRegistered(sptr); /* por si era nuevo */ + ClearHelpOp(sptr); + } + + send_umode_out(cptr, sptr, of, oh); } #endif *************** *** 2302,2354 **** #if defined(DB_HISPANO) || defined(DB_ESNET) /* - * Buscamos en memoria el nick y si es nuestro le cambiamos el estado, - * le informamos del cambio, asi como al resto de servers - * 1999/07/06 savage@apostols.org - */ - void dbh_cambiar_registro_nick(char *nick, char modo) - { - int i, *s; - aClient *acptr; - char flag='r', *n; - - acptr=FindClient(nick); - if( !acptr || !MyUser(acptr)) - return; /* no esta conectado o no es mio*/ - - /* busco la letra del flag en la tabla */ - for (s = user_hmodes; (i = *s); s += 2) - if (i == HMODE_NICKREGISTERED) { - flag=(char)(s[1]); - break; - } - - switch(modo) - { - case '+': - if(IsNickRegistered(acptr)) - return; /* ya tiene modo 'r' */ - SetNickRegistered(acptr); - break; - case '-': - if(!IsNickRegistered(acptr)) - return; /* ya no tiene modo 'r' */ - ClearNickRegistered(acptr); - break; - } - - n=acptr->name; - - /* Informamos al usuario */ - sendto_one(acptr, ":%s MODE %s :%c%c", n, n, modo, flag); - - /* Y a todos mis servers */ - for (i = highest_fd; i >= 0; i--) - if ((acptr = loc_clients[i]) && IsServer(acptr)) - sendto_one(acptr, ":%s MODE %s :%c%c", n, n, modo, flag); - } - - /* * Ampliacion de modos de usuario (sptr->hmodes) * 1999/07/06 savage@apostols.org */ --- 2314,2319 ---- *************** *** 2846,2851 **** --- 2811,2820 ---- SetNickRegistered(sptr); else ClearNickRegistered(sptr); + + /* el modo +h solo se lopueden poner los OPER y kitar a voluntad */ + if( !(sethmodes & HMODE_HELPOP) && !( IsNickRegistered(sptr) && dbh_buscar_registro_local(DBH_OPERDB,sptr->name)) ) + ClearHelpOp(sptr); } #endif diff -crN ../ircu2.10.06-DBH7-noproxy2/ircd/whocmds.c ../ircu2.10.06-DBH8/ircd/whocmds.c *** ../ircu2.10.06-DBH7-noproxy2/ircd/whocmds.c Thu Jul 29 01:08:31 1999 --- ../ircu2.10.06-DBH8/ircd/whocmds.c Wed Jul 28 16:47:38 1999 *************** *** 781,787 **** #if defined(DB_HISPANO) || defined(DB_ESNET) if (IsNickRegistered(acptr)) ! sendto_one(sptr, rpl_str(RPL_WHOISNICKREGISTERED), me.name, parv[0], name); #endif --- 781,791 ---- #if defined(DB_HISPANO) || defined(DB_ESNET) if (IsNickRegistered(acptr)) ! sendto_one(sptr, rpl_str(RPL_WHOISREGNICK), ! me.name, parv[0], name); ! ! if (IsHelpOp(acptr)) ! sendto_one(sptr, rpl_str(RPL_WHOISHELPOP), me.name, parv[0], name); #endif