diff -druN ircd-hybrid-7rc8/doc/example.conf opz/doc/example.conf
--- ircd-hybrid-7rc8/doc/example.conf	2002-10-30 19:44:51.000000000 +0200
+++ opz/doc/example.conf	2003-02-04 09:38:07.000000000 +0200
@@ -763,6 +763,9 @@
 	fname_operlog = "logs/operlog";
 	fname_foperlog = "logs/foperlog";
 
+	services_host = "Services.DarkChild.Cx";
+	services_qline = "Service's nick";
+
 	/* max targets: the maximum amount of targets in a single 
 	 * PRIVMSG/NOTICE.  set to 999 NOT 0 for unlimited.
 	 */
@@ -855,6 +858,9 @@
 	 * Set to 0 to disable.
 	 */
 	throttle_time = 10;
+	
+	/* 5 weeks */
+	how_old = 3024000;
 };
 
 modules {
diff -druN ircd-hybrid-7rc8/include/channel.h opz/include/channel.h
--- ircd-hybrid-7rc8/include/channel.h	2003-01-17 06:18:16.000000000 +0200
+++ opz/include/channel.h	2003-02-03 13:02:56.000000000 +0200
@@ -73,6 +73,7 @@
 #ifdef HALFOPS
   dlink_list      halfops;
 #endif
+  dlink_list	  nokick;
   dlink_list      voiced;
   dlink_list      peons;                /* non ops, just members */
   dlink_list	  deopped;              /* users deopped on sjoin */
@@ -180,7 +181,8 @@
 #ifdef INTENSIVE_DEBUG
 void do_channel_integrity_check(void);
 #endif
-
+void DelNokick(struct Channel *cptr, struct Client *source_p);
+void AddNokick(struct Channel *cptr, struct Client *source_p);
 void set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_info, time_t topicts); 
 void free_topic(struct Channel *);
 int allocate_topic(struct Channel *);
diff -druN ircd-hybrid-7rc8/include/channel_mode.h opz/include/channel_mode.h
--- ircd-hybrid-7rc8/include/channel_mode.h	2002-10-28 23:09:20.000000000 +0200
+++ opz/include/channel_mode.h	2003-02-05 10:10:05.000000000 +0200
@@ -100,6 +100,10 @@
 #define MODE_EXCEPTION  0x0800
 #define MODE_INVEX	0x2000
 #define MODE_HIDEOPS    0x4000
+#define MODE_NOCOLOR    0x8000
+#define MODE_JOINF	    0x10000
+#define MODE_NOCTCP	    0x20000
+#define MODE_NOTALK	    0x40000
 
 /*
  * mode flags which take another parameter (With PARAmeterS)
diff -druN ircd-hybrid-7rc8/include/client.h opz/include/client.h
--- ircd-hybrid-7rc8/include/client.h	2003-01-20 14:44:00.000000000 +0200
+++ opz/include/client.h	2003-02-05 12:49:48.000000000 +0200
@@ -180,6 +180,8 @@
    * considered a read-only field after the client has registered.
    */
   char              host[HOSTLEN + 1];     /* client's hostname */
+
+  char              realhost[HOSTLEN + 1];     /* client's hostname */
   /*
    * client->info for unix clients will normally contain the info from the 
    * gcos field in /etc/passwd but anything can go here.
@@ -201,7 +203,8 @@
   
   
   struct LocalUser *localClient;
-
+  time_t ns_reg; /* when the nick was registered in NS */
+  
 };
 
 struct LocalUser
@@ -419,6 +422,13 @@
 /* user information flags, only settable by remote mode or local oper */
 #define FLAGS_OPER         0x20000 /* Operator */
 #define FLAGS_ADMIN        0x40000 /* Admin on server */
+#define FLAGS_NK_ID        0x80000 /* NetKeeper */
+#define FLAGS_OS_ID        0x100000 /* Idented in OS */
+#define FLAGS_NS_ID        0x200000 /* Idented in NS */
+#define FLAGS_SILENCE      0x400000 /* user's mode +S */
+#define FLAGS_AVFH         0x800000 /* user's mode +h */
+#define FLAGS_TRANSWIN     0x1000000 /* translate cyrillic Windows-1251 */
+#define FLAGS_TRANSISO     0x2000000 /* translate cyrillic ISO-8859-5 */
 
 #define FLAGS_ALL	   FLAGS_SERVNOTICE
 
@@ -455,14 +465,19 @@
 #define FLAGS2_IP_SPOOFING      0x80000        /* client IP is spoofed */
 #define FLAGS2_FLOODDONE        0x200000      /* Flood grace period has
                                                * been ended. */
+#define FLAGS2_IP_HIDDEN        0x400000        /* client IP should be hidden
+                                                   from non opers */
 
 #define SEND_UMODES  (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP | \
-                      FLAGS_ADMIN)
+                      FLAGS_ADMIN | FLAGS_SILENCE)
 #define ALL_UMODES   (SEND_UMODES | FLAGS_SERVNOTICE | FLAGS_CCONN | \
                       FLAGS_REJ | FLAGS_SKILL | FLAGS_FULL | FLAGS_SPY | \
                       FLAGS_NCHANGE | FLAGS_OPERWALL | FLAGS_DEBUG | \
                       FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOPS | \
- 		      FLAGS_ADMIN | FLAGS_UNAUTH | FLAGS_CALLERID)
+		              FLAGS_ADMIN | FLAGS_UNAUTH | FLAGS_CALLERID | FLAGS_NS_ID | \
+      			      FLAGS_OS_ID | FLAGS_NK_ID | FLAGS_SILENCE | FLAGS_AVFH | \
+					  FLAGS_TRANSWIN | FLAGS_TRANSISO)
+
 
 #define FLAGS_ID     (FLAGS_NEEDID | FLAGS_GOTID)
 
@@ -530,7 +545,19 @@
 #define SetWallops(x)           ((x)->umodes |= FLAGS_WALLOP)
 #define SetCallerId(x)		((x)->umodes |= FLAGS_CALLERID)
 #define IsSetCallerId(x)	((x)->umodes & FLAGS_CALLERID)
-
+#define IsNetKeeper(x)          ((x)->umodes & FLAGS_NK_ID)
+#define SetNetKeeper(x)         ((x)->umodes |= FLAGS_NK_ID)
+#define ClearNetKeeper(x)       ((x)->umodes &= ~FLAGS_NK_ID)
+#define IsOSId(x)               ((x)->umodes & FLAGS_OS_ID)
+#define SetOSId(x)              ((x)->umodes |= FLAGS_OS_ID)
+#define ClearOSId(x)            ((x)->umodes &= ~FLAGS_OS_ID)
+#define IsNSId(x)               ((x)->umodes & FLAGS_NS_ID)
+#define SetNSId(x)              ((x)->umodes |= FLAGS_NS_ID)
+#define ClearNSId(x)            ((x)->umodes &= ~FLAGS_NS_ID)
+#define HasSilence(x)           ((x)->umodes & FLAGS_SILENCE)
+#define SetSilence(x)           ((x)->umodes |= FLAGS_SILENCE)
+#define IsSetTransWin(x)        ((x)->umodes & FLAGS_TRANSWIN)
+#define IsSetTransISO(x)        ((x)->umodes & FLAGS_TRANSISO)
 #define SetIpHash(x)            ((x)->flags |= FLAGS_IPHASH)
 #define ClearIpHash(x)          ((x)->flags &= ~FLAGS_IPHASH)
 #define IsIpHash(x)             ((x)->flags & FLAGS_IPHASH)
@@ -552,6 +579,8 @@
 #define SetExemptGline(x)       ((x)->flags2 |= FLAGS2_EXEMPTGLINE)
 #define SetIPSpoof(x)           ((x)->flags2 |= FLAGS2_IP_SPOOFING)
 #define IsIPSpoof(x)            ((x)->flags2 & FLAGS2_IP_SPOOFING)
+#define SetIPHidden(x)          ((x)->flags2 |= FLAGS2_IP_HIDDEN)
+#define IsIPHidden(x)           ((x)->flags2 & FLAGS2_IP_HIDDEN)
 
 #define SetIdlelined(x)         ((x)->flags2 |= FLAGS2_IDLE_LINED)
 #define IsIdlelined(x)          ((x)->flags2 & FLAGS2_IDLE_LINED)
@@ -620,5 +649,6 @@
                              char *nick);
 extern void dead_link_on_write(struct Client *client_p, int ierrno);
 extern void dead_link_on_read(struct Client *client_p, int error);
+extern char *translate(struct Client *client_p, char *buf);
 #endif /* INCLUDED_client_h */
 
diff -druN ircd-hybrid-7rc8/include/ircd.h opz/include/ircd.h
--- ircd-hybrid-7rc8/include/ircd.h	2003-01-24 09:01:57.000000000 +0200
+++ opz/include/ircd.h	2003-02-03 09:51:43.000000000 +0200
@@ -94,6 +94,7 @@
 #define CurrentTime SystemTime.tv_sec
 extern time_t         nextconnect;
 extern int            default_server_capabs;
+extern int            ServicesOn;
 
 extern int splitmode;
 extern int splitchecking;
diff -druN ircd-hybrid-7rc8/include/numeric.h opz/include/numeric.h
--- ircd-hybrid-7rc8/include/numeric.h	2002-11-27 17:46:24.000000000 +0200
+++ opz/include/numeric.h	2003-02-05 12:30:32.000000000 +0200
@@ -158,6 +158,7 @@
 
 #define RPL_LOCALUSERS       265
 #define RPL_GLOBALUSERS      266
+#define RPL_IDENTUSERS        267
 
 #define RPL_VCHANEXIST       276
 #define RPL_VCHANLIST        277
@@ -218,7 +219,6 @@
 #define RPL_WHOISUSER        311
 #define RPL_WHOISSERVER      312
 #define RPL_WHOISOPERATOR    313
-
 #define RPL_WHOWASUSER       314
 /* rpl_endofwho below (315) */
 #define RPL_ENDOFWHOWAS      369
@@ -228,22 +228,29 @@
 
 #define RPL_ENDOFWHOIS       318
 #define RPL_WHOISCHANNELS    319
+#define RPL_SERVICESCHANS    320
 /*      RPL_WHOIS_HIDDEN     320         Anothernet +h, ick! */
 /*	RPL_WHOISSPECIAL     320	unreal */
 #define RPL_LISTSTART        321
 #define RPL_LIST             322
 #define RPL_LISTEND          323
 #define RPL_CHANNELMODEIS    324
+#define RPL_NS_ID 325
+#define RPL_OS_ID 326
+#define RPL_NK_ID 327
+#define RPL_SILENCE 328
 /*      RPL_CHANNELPASSIS    325           IRCnet extension */
 /*      RPL_UNIQOPIS         325           IRCnet extension */
 /*      RPL_NOCHANPASS       326           IRCnet extension */
 /*      RPL_CHPASSUNKNOWN    327           IRCnet extension */
 /*      RPL_CHANNEL_URL      328           dalnet, anothernet */
 #define RPL_CREATIONTIME     329
+#define RPL_AVFH			 330
 /*      RPL_WHOWAS_TIME      330               ? */
 #define RPL_NOTOPIC          331
 #define RPL_TOPIC            332
 #define RPL_TOPICWHOTIME     333
+#define RPL_WHOISREALHOST	 334
 /*	RPL_COMMANDSYNTAX    334	   Dalnet */
 /*	RPL_LISTSYNTAX	     334	   unreal */
 /*      RPL_CHANPASSOK       338           IRCnet extension (?)*/
@@ -275,7 +282,7 @@
 #define RPL_BANLIST          367
 #define RPL_ENDOFBANLIST     368
 /* rpl_endofwhowas above (369) */
-
+#define RPL_LINKSUSERS		 370
 #define RPL_INFO             371
 #define RPL_MOTD             372
 #define RPL_INFOSTART        373
@@ -396,6 +403,11 @@
 #define ERR_CANTKILLSERVER   483
 #define ERR_RESTRICTED       484
 #define ERR_BANNEDNICK       485
+#define ERR_SERVICESNICKHOP  486
+#define ERR_SERVICESNICKKICK 487 
+#define ERR_NOKICK			 488
+#define ERR_NOCOLOR			 489
+#define ERR_JOINF			 490
 /*	ERR_DESYNC	     484	 Dalnet,PTlink */
 /*	ERR_ATTACKDENY	     484	 unreal */
 /*	ERR_RESTRICTED	     484	   IRCnet extension */
@@ -407,7 +419,9 @@
 /*      ERR_TSLESSCHAN       488           IRCnet extension (?) */
 /*	ERR_VOICENEEDED      489           Undernet extension */
 #define ERR_NOOPERHOST       491
+#define ERR_NOCTCP       	 492
 /*      ERR_NOSERVICEHOST    492 	   IRCnet extension */
+#define ERR_NOTALK       	 493
 
 #define ERR_UMODEUNKNOWNFLAG 501
 #define ERR_USERSDONTMATCH   502
diff -druN ircd-hybrid-7rc8/include/s_conf.h opz/include/s_conf.h
--- ircd-hybrid-7rc8/include/s_conf.h	2003-01-16 05:28:20.000000000 +0200
+++ opz/include/s_conf.h	2003-02-05 12:17:27.000000000 +0200
@@ -131,6 +131,7 @@
 #define CONF_FLAGS_COMPRESSED           0x00020000
 #define CONF_FLAGS_TEMPORARY            0x00040000
 #define CONF_FLAGS_CRYPTLINK            0x00080000
+#define CONF_FLAGS_MASKHOST             0x00100000
 /* Macros for struct ConfItem */
 
 #define IsLimitIp(x)            ((x)->flags & CONF_FLAGS_LIMIT_IP)
@@ -151,6 +152,7 @@
 #define IsConfEncrypted(x)      ((x)->flags & CONF_FLAGS_ENCRYPTED)
 #define IsConfCompressed(x)     ((x)->flags & CONF_FLAGS_COMPRESSED)
 #define IsConfCryptLink(x)      ((x)->flags & CONF_FLAGS_CRYPTLINK)
+#define IsConfMaskHost(x)       ((x)->flags & CONF_FLAGS_MASKHOST)
 
 /* port definitions for Opers */
 
@@ -164,10 +166,15 @@
 #define CONF_OPER_DIE           0x0080
 #define CONF_OPER_ADMIN         0x0100
 
+#define MAXNETID 6
+
 struct config_file_entry
 {
   char *dpath;          /* DPATH if set from command line */
   char *configfile;
+  char *services_host;
+  char *services_qline;
+  char *network_server_site;
   char *klinefile;
   char *dlinefile;
 
@@ -187,6 +194,8 @@
   char fname_userlog[MAXPATHLEN];
   char fname_foperlog[MAXPATHLEN];
 
+  char netid[MAXNETID + 1];
+
   MessageFile motd;
   MessageFile opermotd;
   MessageFile linksfile;
@@ -231,9 +240,12 @@
   int           client_flood;
   /* 0 == don't use throttle... */
   int           throttle_time;
+  int			how_old;
   int           use_egd;
   int		ping_cookie;
   int           use_help;
+  int           silence_default;
+  int           no_colors_quit_msg;
 #ifdef IPV6  
   int		fallback_to_ip6_int;
 #endif
diff -druN ircd-hybrid-7rc8/include/s_serv.h opz/include/s_serv.h
--- ircd-hybrid-7rc8/include/s_serv.h	2002-05-25 02:34:08.000000000 +0300
+++ opz/include/s_serv.h	2003-02-05 12:46:27.000000000 +0200
@@ -74,12 +74,13 @@
 
 #define CAP_TBURST	0x00040000   /* supports TBURST */
 #define CAP_PARA	0x00080000   /* supports invite broadcasting for +p */
+#define CAP_HOSTMASK 0x00100000
 
 #define CAP_MASK        (CAP_QS  | CAP_EX   | CAP_CHW  | \
                          CAP_IE  | CAP_EOB  | CAP_KLN  | \
                          CAP_GLN | CAP_HOPS | CAP_AOPS | \
                          CAP_UID | CAP_ZIP  | CAP_ENC | \
-                         CAP_KNOCK  | CAP_PARA)
+                         CAP_KNOCK  | CAP_PARA | CAP_HOSTMASK)
 
 #ifdef HAVE_LIBZ
 #define CAP_ZIP_SUPPORTED       CAP_ZIP
@@ -252,6 +253,9 @@
 
 extern int MaxClientCount;     /* GLOBAL - highest number of clients */
 extern int MaxConnectionCount; /* GLOBAL - highest number of connections */
+extern int CurrentIdentUsers;  /* Currently identified users to services */
+extern int MaxIdentUsers;  /* Max identified users to services */
+
 
 extern int refresh_user_links;
 
diff -druN ircd-hybrid-7rc8/include/s_user.h opz/include/s_user.h
--- ircd-hybrid-7rc8/include/s_user.h	2002-05-25 02:34:08.000000000 +0300
+++ opz/include/s_user.h	2003-02-05 12:43:19.000000000 +0200
@@ -44,7 +44,7 @@
 			   char* ,char *,char *,char *);
 
 extern int   do_remote_user(char* ,struct Client* ,struct Client*,
-			    char* ,char *,char *,char *,char *);
+			    char* ,char *,char *,char *,char *, char *);
 
 extern int   user_modes_from_c_to_bitmask[];
 extern void  show_isupport(struct Client *);
diff -druN ircd-hybrid-7rc8/modules/Makefile.in opz/modules/Makefile.in
--- ircd-hybrid-7rc8/modules/Makefile.in	2002-06-16 19:31:25.000000000 +0300
+++ opz/modules/Makefile.in	2003-02-03 09:51:59.000000000 +0200
@@ -66,6 +66,8 @@
   m_help.c \
   m_info.c \
   m_invite.c \
+  m_svscmds.c \
+  m_servid.c \
   m_ison.c \
   m_join.c \
   m_kline.c \
diff -druN ircd-hybrid-7rc8/modules/core/m_kick.c opz/modules/core/m_kick.c
--- ircd-hybrid-7rc8/modules/core/m_kick.c	2002-08-15 18:01:02.000000000 +0300
+++ opz/modules/core/m_kick.c	2003-02-03 20:44:07.000000000 +0200
@@ -24,21 +24,27 @@
 
 #include "stdinc.h"
 #include "tools.h"
+#include "common.h"
 #include "handlers.h"
+#include "client.h"
+#include "hash.h"
 #include "channel.h"
 #include "channel_mode.h"
 #include "vchannel.h"
-#include "client.h"
-#include "irc_string.h"
+#include "hash.h"
 #include "ircd.h"
 #include "numeric.h"
+#include "s_conf.h"
+#include "s_serv.h"
 #include "send.h"
+#include "list.h"
+#include "irc_string.h"
+#include "s_conf.h"
 #include "msg.h"
-#include "modules.h"
 #include "parse.h"
-#include "hash.h"
-#include "packet.h"
-
+#include "modules.h"
+#include "hook.h"
+#include "resv.h"
 
 static void m_kick(struct Client*, struct Client*, int, char**);
 static void ms_kick(struct Client*, struct Client*, int, char**);
@@ -74,6 +80,7 @@
                   int parc,
                   char *parv[])
 {
+  struct ResvNick *resv;
   struct Client *who;
   struct Channel *chptr;
 #ifdef VCHANS
@@ -84,6 +91,7 @@
   char  *name;
   char  *p = (char *)NULL;
   char  *user;
+  dlink_node *ptr;
   static char     buf[BUFSIZE];
 
   if (*parv[2] == '\0')
@@ -185,6 +193,20 @@
       return;
     }
 
+  if ((resv = return_nick_resv(who->name)) && !irccmp(resv->reason, ConfigFileEntry.services_qline))
+  {
+    sendto_one(source_p, form_str(ERR_SERVICESNICKKICK), me.name,
+               who->name, chptr->chname);
+	return;
+  }
+
+  if ((ptr = dlinkFind(&chptr->nokick, who)) != NULL)
+  {
+    sendto_one(source_p, form_str(ERR_NOKICK), me.name,
+               who->name, chptr->chname);
+	return;
+  }
+
   if (IsMember(who, chptr))
     {
       /* half ops cannot kick other halfops on private channels */
diff -druN ircd-hybrid-7rc8/modules/core/m_kill.c opz/modules/core/m_kill.c
--- ircd-hybrid-7rc8/modules/core/m_kill.c	2002-07-27 16:27:14.000000000 +0300
+++ opz/modules/core/m_kill.c	2003-02-03 09:51:43.000000000 +0200
@@ -89,6 +89,12 @@
       return;
     }
 
+  if (!irccmp(parv[0], parv[1]))
+  {
+   sendto_one(source_p, ":%s NOTICE %s :You can't kill yourself!", me.name, parv[0]);
+   return;
+  }
+
   if (!BadPtr(reason))
     {
       if(strlen(reason) > (size_t) KILLLEN)
@@ -188,6 +194,12 @@
       return;
     }
 
+  if (!irccmp(parv[0], parv[1]))
+  {
+   sendto_one(source_p, ":%s NOTICE %s :You can't kill yourself!", me.name, parv[0]);
+   return;
+  }
+
   user = parv[1];
 
   if(BadPtr(parv[2]))
diff -druN ircd-hybrid-7rc8/modules/core/m_message.c opz/modules/core/m_message.c
--- ircd-hybrid-7rc8/modules/core/m_message.c	2003-01-17 04:58:25.000000000 +0200
+++ opz/modules/core/m_message.c	2003-02-05 11:42:20.000000000 +0200
@@ -43,6 +43,7 @@
 #include "class.h"
 #include "msg.h"
 #include "packet.h"
+#include "resv.h"
 
 
 struct entity
@@ -62,6 +63,7 @@
 static int flood_attack_channel(int p_or_n, struct Client *source_p,
                                 struct Channel *chptr, char *chname);
 static struct Client* find_userhost (char *, char *, int *);
+int find_color_ctcp(char *, int);
 
 #define ENTITY_NONE    0
 #define ENTITY_CHANNEL 1
@@ -182,6 +184,9 @@
           struct Client *source_p, int parc, char *parv[])
 {
   int i;
+  struct Client *target_p;
+  struct Channel *cptr;
+  struct ResvNick *ptr;
 
   if (parc < 2 || *parv[1] == '\0')
   {
@@ -203,6 +208,43 @@
   if(MyClient(source_p) && !IsFloodDone(source_p))
     flood_endgrace(source_p);
 
+  if ((target_p = find_person(parv[1]))) {
+	if (source_p->user && ServicesOn && HasSilence(target_p) &&
+	    (target_p != source_p) && !IsOper(target_p) && (!IsNSId(source_p) ||
+		source_p->ns_reg + ConfigFileEntry.how_old >= time(NULL)) &&
+		!((ptr = return_nick_resv(parv[0])) && !irccmp(ptr->reason, ConfigFileEntry.services_qline)))
+	{
+	  sendto_one(source_p, ":%s NOTICE %s :Error: %s is in silence mode and does NOT accept messages from unregistered/unidentified (too recently registered) nicknames",
+				 me.name, parv[0], parv[1]);
+	  sendto_one(source_p, ":%s NOTICE %s :Error: If you want to send messages to %s you will have to identify or register your nickname",
+				 me.name, parv[0], parv[1]);
+	  return;
+	} else if (source_p->user && (IsSetTransWin(target_p) || IsSetTransISO(target_p))) {
+	  parv[2] = translate(target_p, parv[2]);
+	}
+  }
+  else if ((cptr = hash_find_channel(parv[1])) != NULL)
+  {
+	if (find_color_ctcp(parv[2], 1) && (cptr->mode.mode & MODE_NOCOLOR))
+	{
+      sendto_one(source_p, form_str(ERR_NOCOLOR), me.name,
+                 source_p->name, cptr->chname);
+	  return;
+	} else if (find_color_ctcp(parv[2], 0) && (cptr->mode.mode & MODE_NOCTCP) &&
+			   !is_any_op(cptr, source_p) && !is_voiced(cptr, source_p)) {
+      sendto_one(source_p, form_str(ERR_NOCTCP), me.name,
+                 source_p->name, cptr->chname);
+	  return;
+	} else if ((cptr->mode.mode & MODE_NOTALK) && ServicesOn &&
+			   (!IsNSId(source_p) || source_p->ns_reg + ConfigFileEntry.how_old >= time(NULL)) &&
+			   !((ptr = return_nick_resv(parv[0])) && !irccmp(ptr->reason, ConfigFileEntry.services_qline)) &&
+			   !IsOper(source_p)) {
+      sendto_one(source_p, form_str(ERR_NOTALK), me.name,
+                 source_p->name, cptr->chname);
+	  return;
+	}
+  }
+
   if (build_target_list(p_or_n, command, client_p, source_p, parv[1],
                         parv[2]) < 0)
   {
@@ -467,8 +509,8 @@
 
   if (MyClient(source_p))
   {
-    /* idle time shouldnt be reset by notices --fl */
-    if ((p_or_n != NOTICE) && source_p->user)
+    /* idle time shouldnt be reset by notices --fl it should be - FUIS */
+/*    if ((p_or_n != NOTICE) && source_p->user) */
       source_p->user->last = CurrentTime;
   }
 
@@ -981,3 +1023,28 @@
     }
   return (res);
 }
+/*
+ * finds color or ctcp depending on ctcpcolor
+ * 1 - color
+ * 0 - ctcp
+ *
+ * main procedur from UniBG IRCd
+ */
+int find_color_ctcp(char *msg, int ctcpcolor)
+{
+  char *c = msg;
+
+  while (*c)
+  {
+	if (ctcpcolor && (*c == '\003' || *c == '\033') ||
+		!ctcpcolor && (*c == '\001'))
+	  break;
+	else
+	  c++;
+  }
+
+  if (*c)
+	return 1;
+
+  return 0;
+}
diff -druN ircd-hybrid-7rc8/modules/core/m_nick.c opz/modules/core/m_nick.c
--- ircd-hybrid-7rc8/modules/core/m_nick.c	2002-10-03 18:33:43.000000000 +0300
+++ opz/modules/core/m_nick.c	2003-02-05 12:45:16.000000000 +0200
@@ -733,7 +733,8 @@
       }
 
       return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-                            parv[7], parv[8], NULL);
+                            parv[7], (parc > 9)? parv[9] : parv[8],
+		                (parc > 9)? parv[8] : NULL, NULL);
     }
   }
   else if(source_p->name[0])
@@ -815,7 +816,7 @@
   }
 
   return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-                        parv[7], name, id);
+                        parv[7], name, (parc > 10)? parv[9] : NULL, id);
 }			
   
 static int 
diff -druN ircd-hybrid-7rc8/modules/core/m_quit.c opz/modules/core/m_quit.c
--- ircd-hybrid-7rc8/modules/core/m_quit.c	2002-07-12 04:01:22.000000000 +0300
+++ opz/modules/core/m_quit.c	2003-02-05 11:28:39.000000000 +0200
@@ -36,6 +36,7 @@
 
 static void m_quit(struct Client*, struct Client*, int, char**);
 static void ms_quit(struct Client*, struct Client*, int, char**);
+static char *strip_color(const char *, int);
 
 struct Message quit_msgtab = {
   "QUIT", 0, 0, 0, 0, MFLG_SLOW | MFLG_UNREG, 0,
@@ -91,6 +92,11 @@
       comment = "Client Quit";
     }
 
+  if (ConfigFileEntry.no_colors_quit_msg)
+  {
+	comment = strip_color(comment, 1);
+  }
+
   exit_client(client_p, source_p, source_p, comment);
 }
 
@@ -113,3 +119,67 @@
   exit_client(client_p, source_p, source_p, comment);
 }
 
+/*
+ * this will strip mIRC and ANSI color, bolds and underlines
+ *                                               -demond
+ */
+static char *strip_color(const char *p, int b)
+{
+  static char buf[512];
+  char *r, *q = buf;
+  int m, n;
+
+  do switch (*p) {
+    case '\003':
+  	  p++;
+	  if (isdigit(*p)) {
+    	p++;
+		m = *p >= '0' && *p<='6';
+    	n = *(p-1) == '1' || *(p-1)=='0';
+    	if (m && n) {
+  		  p++;
+		  if (*p == ',') {
+  			p++;
+			if (isdigit(*p)) {
+      		  p++; m = *p >= '0' && *p<='6';
+    	  	  n = *(p-1) == '1' || *(p-1) == '0';
+  		  	  if (m && n) {
+        	    p++;
+		  	  }
+    		}
+  		  }
+    	} else if (*p == ',') {
+  		  p++;
+		  if (isdigit(*p)) {
+  		    p++;
+			m = *p >= '0' && *p <= '6';
+  		    n = *(p-1)=='1' || *(p-1)=='0';
+		    if (m && n) {
+      		  p++;
+  			}
+		  }
+  	    }
+  	  }
+  	  break;
+	case '\033':
+  	  p++;
+	  if (*p == '[') {
+    	p++;
+		r = strchr(p, 'm');
+    	if (r)
+		  p = r + 1;
+  	  }
+  	  break;
+    case '\002':
+    case '\037':
+  	  if (b) {
+    	p++; break;
+  	  }
+    default:
+  	  *q++ = *p++;
+  	  break;
+  } while (*p);
+
+  *q = 0;
+  return buf;
+}
diff -druN ircd-hybrid-7rc8/modules/core/m_server.c opz/modules/core/m_server.c
--- ircd-hybrid-7rc8/modules/core/m_server.c	2003-01-10 05:47:35.000000000 +0200
+++ opz/modules/core/m_server.c	2003-02-03 10:27:07.000000000 +0200
@@ -245,6 +245,13 @@
    */
 
   strlcpy(client_p->name, name, HOSTLEN+1);
+
+  if (!irccmp(ConfigFileEntry.services_host, client_p->name)) {
+	ServicesOn = 1;
+	sendto_realops_flags(FLAGS_EXTERNAL, L_ALL,
+	"Services (%s) become up", client_p->name);
+   }
+								 
   set_server_gecos(client_p, info);
   client_p->hopcount = hop;
   server_estab(client_p);
@@ -524,6 +531,12 @@
 		 target_p->info);
     }
       
+    if (!irccmp(ConfigFileEntry.services_host, target_p->name)) {
+	   ServicesOn = 1;
+	   sendto_realops_flags(FLAGS_EXTERNAL, L_ALL,
+	     "Services (%s) become up", target_p->name);
+    }
+
   sendto_realops_flags(FLAGS_EXTERNAL, L_ALL,
                        "Server %s being introduced by %s",
 		       target_p->name, source_p->name);
diff -druN ircd-hybrid-7rc8/modules/m_gline.c opz/modules/m_gline.c
--- ircd-hybrid-7rc8/modules/m_gline.c	2002-12-28 09:02:38.000000000 +0200
+++ opz/modules/m_gline.c	2003-02-03 22:09:48.000000000 +0200
@@ -465,7 +465,7 @@
   aconf = make_conf();
   aconf->status = CONF_KILL;
 
-  ircsprintf(buffer, "%s (%s)",reason,current_date);
+  ircsprintf(buffer, "%s (%s by %s)",reason,current_date, oper_nick);
       
   DupString(aconf->passwd, buffer);
   DupString(aconf->name, (char *)user);
diff -druN ircd-hybrid-7rc8/modules/m_invite.c opz/modules/m_invite.c
--- ircd-hybrid-7rc8/modules/m_invite.c	2003-01-23 06:24:06.000000000 +0200
+++ opz/modules/m_invite.c	2003-02-04 09:37:17.000000000 +0200
@@ -196,6 +196,16 @@
 
   if (MyConnect(source_p))
   {
+	if (ServicesOn && HasSilence(target_p) && (target_p != source_p) &&
+		!IsOper(target_p) && (!IsNSId(source_p) ||
+		source_p->ns_reg + ConfigFileEntry.how_old >= CurrentTime))
+	{
+	  sendto_one(source_p, ":%s NOTICE %s :Error: %s is in silence mode and does NOT accept invites from unregistered/unidentified (too recently registered) nicknames",
+				 me.name, parv[0], target_p->name);
+	  sendto_one(source_p, ":%s NOTICE %s :Error: If you want to invite %s you will have to identify or register your nickname",
+				 me.name, parv[0], target_p->name);
+	  return;
+	}
     sendto_one(source_p, form_str(RPL_INVITING), me.name, parv[0],
                target_p->name, parv[2]);
     if (target_p->user->away)
diff -druN ircd-hybrid-7rc8/modules/m_join.c opz/modules/m_join.c
--- ircd-hybrid-7rc8/modules/m_join.c	2002-10-28 23:09:22.000000000 +0200
+++ opz/modules/m_join.c	2003-02-04 12:31:03.000000000 +0200
@@ -108,6 +108,11 @@
       return;
     }
 
+  if (!irccmp(parv[1], "#help"))
+  {
+	parv[1] = "#irchelp";
+  }
+
 #ifdef VCHANS
   if (parc > 3)
     {
@@ -283,6 +288,12 @@
     if (!IsOper(source_p))
      check_spambot_warning(source_p, name);
       
+    if ((chptr->mode.mode & MODE_JOINF) && ServicesOn && (!IsNSId(source_p) ||
+	    (source_p->ns_reg + ConfigFileEntry.how_old >= time(NULL)))) {
+	  sendto_one(source_p, form_str(ERR_JOINF), me.name, source_p->name, chptr->chname);
+	  return;
+	}
+
       /*
        * can_join checks for +i key, bans.
        */
diff -druN ircd-hybrid-7rc8/modules/m_kline.c opz/modules/m_kline.c
--- ircd-hybrid-7rc8/modules/m_kline.c	2002-11-13 15:12:02.000000000 +0200
+++ opz/modules/m_kline.c	2003-02-03 22:06:18.000000000 +0200
@@ -235,18 +235,20 @@
   if (tkline_time)
     {
       ircsprintf(buffer,
-		 "Temporary K-line %d min. - %s (%s)",
+		 "Temporary K-line %d min. - %s (%s by %s)",
 		 (int)(tkline_time/60),
 		 reason,
-		 current_date);
+		 current_date,
+		 source_p->name);
       DupString(aconf->passwd, buffer);
       apply_tkline(source_p, aconf, current_date, tkline_time);
     }
   else
     {
-      ircsprintf(buffer, "%s (%s)",
+      ircsprintf(buffer, "%s (%s by %s)",
 		 reason,
-		 current_date);
+		 current_date,
+		 source_p->name);
       DupString(aconf->passwd, buffer);
       apply_kline(source_p, aconf, reason, oper_reason,
 		  current_date, cur_time);
diff -druN ircd-hybrid-7rc8/modules/m_links.c opz/modules/m_links.c
--- ircd-hybrid-7rc8/modules/m_links.c	2002-07-31 19:24:07.000000000 +0300
+++ opz/modules/m_links.c	2003-02-03 21:48:42.000000000 +0200
@@ -77,6 +77,13 @@
 static void m_links(struct Client *client_p, struct Client *source_p,
                    int parc, char *parv[])
 {
+  if (!IsOper(source_p))
+  {
+    sendto_one(source_p, form_str(RPL_LINKSUSERS),
+  	           me.name, parv[0], ConfigFileEntry.network_server_site);
+	return;
+  }
+
   if (!ConfigServerHide.flatten_links)
     {
       mo_links(client_p, source_p, parc, parv);
diff -druN ircd-hybrid-7rc8/modules/m_list.c opz/modules/m_list.c
--- ircd-hybrid-7rc8/modules/m_list.c	2003-01-17 07:11:53.000000000 +0200
+++ opz/modules/m_list.c	2003-02-03 23:22:09.000000000 +0200
@@ -245,7 +245,7 @@
 #endif
     ircsprintf(id_and_topic, "%s", chptr->topic == NULL ? "" : chptr->topic);
 
-  if (ShowChannel(source_p, chptr))
+  if (ShowChannel(source_p, chptr) && chptr->users > 2)
     sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
                chptr->chname, chptr->users, id_and_topic);
       
@@ -256,7 +256,7 @@
     {
       tmpchptr = ptr->data;
 
-      if (ShowChannel(source_p, tmpchptr))
+      if (ShowChannel(source_p, tmpchptr) && chptr->users > 2)
 	{
           root_chptr = find_bchan(tmpchptr);
           ircsprintf(id_and_topic, "<!%s> %s", pick_vchan_id(tmpchptr), tmpchptr->topic == NULL ? "" : chptr->topic);
@@ -288,20 +288,20 @@
     {
       root_chptr = find_bchan(chptr);
       
-      if(root_chptr != NULL)
+      if(root_chptr != NULL && chptr->users > 2)
         {
           ircsprintf(id_and_topic, "<!%s> %s", pick_vchan_id(chptr), chptr->topic == NULL ? "" : chptr->topic );
           sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
                      root_chptr->chname, chptr->users, id_and_topic);
         }
-      else
+      else if (chptr->users > 2)
         {
           ircsprintf(id_and_topic, "<!%s> %s", pick_vchan_id(chptr), chptr->topic == NULL ? "" : chptr->topic );
           sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
                      chptr->chname, chptr->users, id_and_topic);     
         }
     }
-  else
+  else if (chptr->users > 2)
 #endif
     {
       sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
diff -druN ircd-hybrid-7rc8/modules/m_servid.c opz/modules/m_servid.c
--- ircd-hybrid-7rc8/modules/m_servid.c	1970-01-01 02:00:00.000000000 +0200
+++ opz/modules/m_servid.c	2003-02-03 23:17:21.000000000 +0200
@@ -0,0 +1,265 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, modules/m_servid.c
+ *   Copyright (C) 2001 Hybrid Development Team
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: m_servid.c,v 1.0 2003/01/02 22:15:33 FUIS Exp $
+ */
+
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "common.h"
+#include "ircd.h"
+#include "config.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "channel.h"
+#include "hash.h"
+
+static void ns_parse(struct Client *, struct Client *, int, char **);
+static void nk_parse(struct Client *, struct Client *, int, char **);
+static void os_parse(struct Client *, struct Client *, int, char **);
+static void ms_servid(struct Client *, struct Client *, int, char **);
+static void nokick_parse(struct Client *, struct Client *, int, char **);
+
+struct ServIDStruct
+{
+  char *cmd;
+  void (*handler)();
+};
+
+static struct ServIDStruct servid_cmd_table[] =
+{
+  { "NS", ns_parse, },
+  { "OS", os_parse, },
+  { "NK", nk_parse, },
+  { "NOKICK", nokick_parse, },
+  { (char *) 0, (void (*)()) 0, }
+};
+
+struct Message servid_msgtab = {
+  "SERVID", 0, 0, 1, 1, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_servid, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&servid_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&servid_msgtab);
+}
+
+const char *_version = "$Revision: 1.0 $";
+#endif
+
+/*
+ * ms_servid
+ *
+ *      parv[0] = sender prefix
+ *		parv[1] = NS | OS | NK | NOKICK
+ *		parv[2..4] = some args (no need to tell them here)
+ */
+static void ms_servid(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+  int i;
+
+  if (!IsServer(source_p) || irccmp(parv[0], ConfigFileEntry.services_host)) {
+    sendto_realops_flags(FLAGS_ALL, L_ALL, "Non U-Lined Server %s is attempting to use servid", source_p->name);
+	return;
+  }
+
+  for (i = 0; servid_cmd_table[i].handler; i++)
+  {
+	if (!irccmp(servid_cmd_table[i].cmd, parv[1]))
+	{
+	  servid_cmd_table[i].handler(client_p, source_p, parc, parv);
+	}
+  }
+}    
+
+/*
+ * ns_parse
+ *
+ *      parv[0] = sender prefix
+ *		parv[1] = NS
+ *		parv[2] = nickname
+ *		parv[3] = 1 | 0
+ *	    parv[4] = TS (maybe NULL)
+ */
+static void ns_parse(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+  struct Client *target_p;
+
+  if (parc < 4)
+	return;
+
+  if ((target_p = find_person(parv[2])) == NULL) {
+	sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], parv[2]);
+    return;
+  }
+
+  if (!IsClient(target_p))
+	return;
+
+  if (parv[3][0] == '1')
+  {
+    if (!IsNSId(target_p) && ServicesOn)
+	{
+	  CurrentIdentUsers++;
+	  if (CurrentIdentUsers > MaxIdentUsers)
+		MaxIdentUsers = CurrentIdentUsers;
+	}
+
+	SetNSId(target_p);
+  }
+  else if (parv[3][0] == '0')
+  {
+    if (IsNSId(target_p) && ServicesOn)
+	  CurrentIdentUsers--;
+
+	ClearNSId(target_p);
+  }
+
+  if (parv[4])
+	target_p->ns_reg = (long) atoi(parv[4]);
+
+  if (source_p->hopcount == 0) /* it's our hub ?! */
+	sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SERVID NS %s %s :%lu",
+				  source_p->name, target_p->name, parv[3][0], target_p->ns_reg ? target_p->ns_reg : time(NULL));
+}
+
+/*
+ * nk_parse
+ *      parv[0] = sender prefix
+ *		parv[1] = NK
+ *		parv[2] = nickname
+ *		parv[3] = 1
+ */
+static void nk_parse(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+  struct Client *target_p;
+
+  if (parc < 4)
+	return;
+
+  if ((target_p = find_person(parv[2])) == NULL) {
+	sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], parv[2]);
+    return;
+  }
+
+  if (!IsClient(target_p))
+	return;
+
+  if (source_p->hopcount == 0) /* it's our hub ?! */
+	sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SERVID NK %s %s",
+			  	  source_p->name, target_p->name, parv[3][0]);
+  SetNetKeeper(target_p);
+}
+
+/*
+ * os_parse
+ *      parv[0] = sender prefix
+ *		parv[1] = OS
+ *		parv[2] = nickname
+ *		parv[3] = 1 | 0
+ */
+static void os_parse(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+  struct Client *target_p;
+
+  if (parc < 4)
+	return;
+
+  if ((target_p = find_person(parv[2])) == NULL) {
+	sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], parv[2]);
+    return;
+  }
+
+  if (!IsClient(target_p))
+	return;
+
+  if (parv[3][0] == '1')
+	SetOSId(target_p);
+  else if (parv[3][0] == '0')
+	ClearOSId(target_p);
+
+  if (source_p->hopcount == 0) /* it's our hub ?! */
+	sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SERVID OS %s %s",
+			  	  source_p->name, target_p->name, parv[3][0]);
+}
+
+/*
+ * nokick_parse
+ *      parv[0] = sender prefix
+ *		parv[1] = NOKICK
+ *		parv[2] = channel
+ *		parv[3] = nickname
+ *		parv[4] = 1 | 0
+ */
+static void nokick_parse(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+  struct Client *target_p;
+  struct Channel *cptr;
+
+  if (parc < 5)
+	return;
+
+  if ((target_p = find_person(parv[3])) == NULL) {
+	sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, parv[0], parv[3]);
+    return;
+  }
+
+  if (!IsClient(target_p))
+	return;
+
+  if (!IsChannelName(parv[2]))
+	return;
+
+  if ((cptr = hash_find_channel(parv[2])) == NULL) {
+	sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, parv[0], parv[2]);
+    return;
+  }
+
+  if (parv[4][0] == '1')
+	AddNokick(cptr, target_p);
+  else if (parv[4][0] == '0')
+	DelNokick(cptr, target_p);
+
+  if (source_p->hopcount == 0)
+	sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SERVID NOKICK %s %s %s",
+			  	  source_p->name, cptr->chname, target_p->name, parv[3][0]);
+}
diff -druN ircd-hybrid-7rc8/modules/m_stats.c opz/modules/m_stats.c
--- ircd-hybrid-7rc8/modules/m_stats.c	2003-01-17 15:00:50.000000000 +0200
+++ opz/modules/m_stats.c	2003-02-05 13:00:44.000000000 +0200
@@ -978,20 +978,21 @@
 	}
       else
 	{
+
           /* If its a hidden ip, an admin, or a server, mask the real IP */
 	  if(IsIPSpoof(target_p) || IsServer(target_p) || IsAdmin(target_p)
-	     || IsHandshake(target_p) || IsConnecting(target_p))
-	    sendto_one(source_p, Lformat, me.name,
-		       RPL_STATSLINKINFO, source_p->name,
-		       get_client_name(target_p, MASK_IP),
-		       (int)linebuf_len(&target_p->localClient->buf_sendq),
-		       (int)target_p->localClient->sendM,
-		       (int)target_p->localClient->sendK,
-		       (int)target_p->localClient->receiveM,
-		       (int)target_p->localClient->receiveK,
-		       CurrentTime - target_p->firsttime,
-		       (CurrentTime > target_p->since) ? (CurrentTime - target_p->since):0,
-		       IsServer(target_p) ? show_capabilities(target_p) : "-");
+	     || IsHandshake(target_p) || IsConnecting(target_p) || IsIPHidden(target_p))
+        sendto_one(source_p, Lformat, me.name,
+               RPL_STATSLINKINFO, source_p->name,
+               get_client_name(target_p, MASK_IP),
+               (int)linebuf_len(&target_p->localClient->buf_sendq),
+               (int)target_p->localClient->sendM,
+               (int)target_p->localClient->sendK,
+               (int)target_p->localClient->receiveM,
+               (int)target_p->localClient->receiveK,
+               CurrentTime - target_p->firsttime,
+               (CurrentTime > target_p->since) ? (CurrentTime - target_p->since):0,
+               IsServer(target_p) ? show_capabilities(target_p) : "-");
 	  else /* show the real IP */
 	    sendto_one(source_p, Lformat, me.name,
 		       RPL_STATSLINKINFO, source_p->name,
diff -druN ircd-hybrid-7rc8/modules/m_svscmds.c opz/modules/m_svscmds.c
--- ircd-hybrid-7rc8/modules/m_svscmds.c	1970-01-01 02:00:00.000000000 +0200
+++ opz/modules/m_svscmds.c	2003-02-05 10:33:57.000000000 +0200
@@ -0,0 +1,445 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, m_svscmds.c
+ *   Copyright (C) 2002 NeoIRCd Development Team
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: m_svscmds.c,v 1.9 2002/10/31 13:01:56 fishwaldo + FUIS Exp $
+ */
+
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "channel.h"
+#include "channel_mode.h"
+#include "common.h"
+#include "ircd.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "s_user.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "hash.h"
+#include "whowas.h"
+
+static void ms_svsnick(struct Client *client_p, struct Client *source_p,
+					   int parc, char *parv[]);
+static void ms_svsjoin(struct Client *client_p, struct Client *source_p,
+                       int parc, char *parv[]);
+static void ms_svspart(struct Client *client_p, struct Client *source_p,
+		               int parc, char *parv[]);
+static void ms_svsmode(struct Client *client_p, struct Client *source_p,
+		               int parc, char *parv[]);
+static void m_netname(struct Client *client_p, struct Client *source_p,
+		              int parc, char *parv[]);
+static int clean_nick_name(char *);
+
+struct Message netname_msgtab = {
+  "NETNAME", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_ignore, m_netname, m_netname, m_netname}
+};
+
+struct Message svsnick_msgtab = {
+  "SVSNICK", 0, 0, 4, 4, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsnick, m_ignore}
+};
+
+struct Message svsjoin_msgtab = {
+  "SVSJOIN", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsjoin, m_ignore}
+};
+
+struct Message svspart_msgtab = {
+  "SVSPART", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svspart, m_ignore}
+};
+
+struct Message svsmode_msgtab = {
+  "SVSMODE", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsmode, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&netname_msgtab);
+  mod_add_cmd(&svsnick_msgtab);
+  mod_add_cmd(&svsjoin_msgtab);
+  mod_add_cmd(&svspart_msgtab);
+  mod_add_cmd(&svsmode_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&netname_msgtab);
+  mod_del_cmd(&svsnick_msgtab);
+  mod_del_cmd(&svsjoin_msgtab);
+  mod_del_cmd(&svspart_msgtab);
+  mod_del_cmd(&svsmode_msgtab);
+}
+
+const char *_version = "$Revision: 1.91 $";
+#endif
+/* m_netname
+ *
+ * Displays the current ServerInfo.network_name
+ *
+ * parv[0] = sender prefix
+ */
+static void m_netname(struct Client *client_p, struct Client *source_p,
+		              int parc, char *parv[])
+{
+  if (!source_p->user)
+	return;
+
+  /* now it's a user requesting the netname give it to him */
+  sendto_one(source_p, ":%s NOTICE %s :The network name is: %s", me.name, source_p->name, ServerInfo.network_name);
+}
+
+
+/* ms_svsnick
+ *
+ *	Changes the targets nickname
+ * 	parv[0] = sender prefix
+ *	parv[1] = target 
+ *	parv[2] = new nickname
+ *	parv[3] = ts
+ */
+static void ms_svsnick(struct Client *client_p, struct Client *source_p,
+			           int parc, char *parv[])
+{
+  struct Client *target_p;
+
+  target_p = find_person(parv[1]);
+
+  if (target_p == NULL) {
+	ilog(L_WARN, "SVSNICK from %s was invalid. Can't find the client", parv[1]);
+	return;
+  }
+
+  if (!IsClient(target_p)) 
+	return;
+
+  if (irccmp(ConfigFileEntry.services_host, source_p->name)) {
+	sendto_realops_flags(FLAGS_ALL, L_ALL, "Non U-Lined Server %s is attempting to use svsnick on %s", source_p->name, target_p->name);
+	return;
+  }
+
+  if (MyClient(target_p)) {
+    if (!clean_nick_name(parv[2]) || !irccmp(target_p->name, parv[2])) {
+	  ilog(L_WARN, "SVSNICK: Invalid Nickname");
+	  return;
+	}
+
+	target_p->tsinfo = parv[4] ? atol(parv[3]) : CurrentTime;
+	sendto_common_channels_local(target_p, ":%s!%s@%s NICK :%s", target_p->name, target_p->username, target_p->host, parv[2]);
+
+	if (target_p->user) {
+	  add_history(target_p, 1);
+	  sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s NICK %s :%lu", target_p->name, parv[2], target_p->tsinfo);
+	}	
+
+	if (target_p->name[0])
+	  del_from_client_hash_table(target_p->name, target_p);
+
+	strcpy(target_p->name, parv[2]);
+	add_to_client_hash_table(target_p->name, target_p);
+
+	del_all_accepts(target_p);
+  } else {
+	/* just relay the svsnick to a server that has this client */
+	sendto_one(target_p, ":%s SVSNICK %s %s :%lu", source_p->name, target_p->name, parv[2], atol(parv[3]));
+  }
+  return;
+}
+
+/* clean_nick_name()
+ *
+ * input	- nickname
+ * output	- none
+ * side effects - walks through the nickname, returning 0 if erroneous
+ */
+static int clean_nick_name(char *nick)
+{
+  assert(nick);
+  if (nick == NULL)
+	return 0;
+
+  if (*nick == '-' || IsDigit(*nick))
+    return 0;
+
+  for(; *nick; nick++)
+  {
+    if(!IsNickChar(*nick))
+      return 0;
+  }
+
+  return 1;
+}
+
+/* ms_svsjoin
+ *
+ *  parv[0] = sender prefix
+ *  parv[1] = user to force
+ *  parv[2] = channel to force them into
+ *	parv[3] = key
+ */
+static void ms_svsjoin(struct Client *client_p, struct Client *source_p,
+                         int parc, char *parv[])
+{
+  struct Client *target_p;
+  struct Channel *chptr;
+  int type;
+  char mode;
+  char sjmode;
+  char *newch;
+
+  if (irccmp(ConfigFileEntry.services_host, source_p->name) && IsServer(source_p)) {
+	sendto_realops_flags(FLAGS_ALL, L_ALL, "Non U-Lined Server %s is attempting to use svsjoin on %s", source_p->name, target_p->name);
+	return;
+  }
+
+  if ((hunt_server(client_p, source_p, ":%s SVSJOIN %s %s", 1, parc, parv)) != HUNTED_ISME)
+    return;
+
+  if ((target_p = find_client(parv[1])) == NULL)
+  {
+    if (IsClient(source_p))
+	  sendto_one(source_p, form_str(ERR_NOSUCHNICK),
+				 me.name, source_p->name, parv[1]);
+    return;
+  }
+
+  if(!IsClient(target_p))
+    return;
+
+  if (parv[2][0] == '@')
+  {
+    type = CHFL_CHANOP;
+    mode = 'o';
+    sjmode = '@';
+  }
+  else if (parv[2][0] == '%')
+  {
+    type = CHFL_HALFOP;
+    mode = 'h';
+    sjmode = '%';
+  }
+  else if (parv[2][0] == '+')
+  {
+    type = CHFL_VOICE;
+    mode = 'v';
+    sjmode = '+';
+  }
+  else
+  {
+    type = CHFL_PEON;
+    mode = sjmode = '\0';
+  }
+    
+  if (mode != '\0')
+    parv[2]++;
+    
+  if ((chptr = hash_find_channel(parv[2])) != NULL)
+  {
+    if (IsMember(target_p, chptr))
+    {
+	  sendto_one(target_p, ":%s NOTICE %s :*** Notice -- You are already in %s, if you want I may SVSPART you?!",
+				 me.name, target_p->name, chptr->chname);
+	  return;
+    }
+
+	if (!BadPtr(chptr->mode.key) && irccmp(chptr->mode.key, parc >= 4 ? parv[3] : "") && !IsOper(target_p))
+	{
+	  sendto_one(target_p, ":%s NOTICE %s :*** Notice -- You've messed up the key brother!",
+			     me.name, target_p->name);
+	  return;
+	}
+
+	if ((chptr->mode.mode & MODE_INVITEONLY) && !IsOper(target_p))
+	{
+	  sendto_one(target_p, ":%s NOTICE %s :*** Notice -- The channel is invite only, and you're not invited to the party!:P",
+				 me.name, target_p->name);
+	  return;
+	}
+
+	if ((chptr->mode.limit) && chptr->users >= chptr->mode.limit && !IsOper(target_p))
+	{
+	  sendto_one(target_p, ":%s NOTICE %s :*** Notice -- There's not enough room for the both of us, esse (channel is full)!",
+			     me.name, target_p->name);
+	  return;
+	}
+
+    add_user_to_channel(chptr, target_p, type);
+
+    if (chptr->chname[0] != '&')
+      sendto_server(NULL, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+	  			    ":%s SJOIN %lu %s + :%c%s",
+	          		me.name, (unsigned long) chptr->channelts,
+	          		chptr->chname, type ? sjmode : ' ', target_p->name);
+
+	sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
+                           target_p->name, target_p->username,
+                           target_p->host, chptr->chname);
+
+    if (type)
+  	  sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +%c %s",
+	                    	 me.name, chptr->chname, mode, target_p->name);
+        
+    if (chptr->topic != NULL)
+    {
+	  sendto_one(target_p, form_str(RPL_TOPIC), me.name,
+	  		     target_p->name, chptr->chname, chptr->topic);
+      sendto_one(target_p, form_str(RPL_TOPICWHOTIME),
+	        	 me.name, source_p->name, chptr->chname,
+	          	 chptr->topic_info, chptr->topic_time);
+    }
+
+    channel_member_names(target_p, chptr, chptr->chname, 1);
+  }
+  else
+  {
+    newch = parv[2];
+    if (!check_channel_name(newch))
+    {
+      if (IsClient(source_p))
+	    sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name, source_p->name, (unsigned char*)newch);
+	  return;
+	}
+
+    if (!IsChannelName(newch))
+    {
+      if (IsClient(source_p))
+		sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name, source_p->name, (unsigned char*)newch);
+      return;
+    }
+
+    if (ConfigServerHide.disable_local_channels && (*newch == '&'))
+    {
+      if (IsClient(source_p))
+	    sendto_one(source_p, ":%s NOTICE %s :No such channel (%s)", me.name, source_p->name, newch);
+      return;
+    }
+
+    if (strlen(newch) > CHANNELLEN)
+    {
+	  if (IsClient(source_p))
+	    sendto_one(source_p, ":%s NOTICE %s :Channel name is too long", me.name, source_p->name);
+      return;
+    }
+
+    chptr = get_or_create_channel(target_p, newch, NULL);
+    add_user_to_channel(chptr, target_p, CHFL_CHANOP);
+
+    if (chptr->chname[0] != '&')
+      sendto_server(NULL, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+                    ":%s SJOIN %lu %s +nt :!%s", me.name,
+				    (unsigned long) chptr->channelts, chptr->chname,
+		    	    target_p->name);
+
+    sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
+                         target_p->name, target_p->username,
+                         target_p->host, chptr->chname);
+
+    chptr->mode.mode |= MODE_TOPICLIMIT;
+    chptr->mode.mode |= MODE_NOPRIVMSGS;
+
+    sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +nt", me.name,
+                         chptr->chname);
+
+    target_p->localClient->last_join_time = CurrentTime;
+    channel_member_names(target_p, chptr, chptr->chname, 1);
+  }
+}
+
+/* ms_svspart
+ *
+ * parv[0] - sender
+ * parv[1] - nickname
+ * parv[2] - channel to part from
+ */
+static void ms_svspart(struct Client *client_p, struct Client *source_p,
+		               int parc, char *parv[])
+{
+  struct Client *target_p;
+  struct Channel *chptr;
+
+  if (irccmp(ConfigFileEntry.services_host, source_p->name) && IsServer(source_p))
+    return;
+
+  if ((hunt_server(client_p, source_p, ":%s SVSPART %s %s", 1, parc, parv)) != HUNTED_ISME)
+    return;
+
+  if ((target_p = find_client(parv[1])) == NULL)
+  {
+    if (IsClient(source_p))
+	  sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]);
+    return;
+  }
+
+  if (!IsClient(target_p))
+    return;
+
+  if ((chptr = hash_find_channel(parv[2])) == NULL)
+  {
+    if (IsClient(source_p))
+	  sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL), me.name, parv[0], parv[1]);
+    return;
+  }
+
+  if (!IsMember(target_p, chptr))
+  {
+    if (IsClient(source_p))
+	  sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL), me.name, parv[0], parv[2], parv[1]);
+    return;
+  }
+  
+  if (chptr->chname[0] != '&')
+    sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+			      ":%s PART %s :%s",
+		  		  target_p->name, chptr->chname,
+				  target_p->name);
+
+  sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
+                       target_p->name, target_p->username,
+	   	               target_p->host, chptr->chname,
+				       target_p->name);
+
+  remove_user_from_channel(chptr, target_p);
+}
+
+/* ms_svsmode
+ *
+ * parv[0] - sender
+ * parv[1] - username to change mode for
+ * parv[2] - modes to change
+ */
+static void ms_svsmode(struct Client *client_p, struct Client *source_p,
+                       int parc, char *parv[])
+{
+  if (irccmp(ConfigFileEntry.services_host, source_p->name))
+	return;
+
+  user_mode(client_p, source_p, parc, parv);
+}
diff -druN ircd-hybrid-7rc8/modules/m_trace.c opz/modules/m_trace.c
--- ircd-hybrid-7rc8/modules/m_trace.c	2002-09-05 04:10:24.000000000 +0300
+++ opz/modules/m_trace.c	2003-02-05 12:59:03.000000000 +0200
@@ -171,7 +171,7 @@
           sendto_one(source_p, form_str(RPL_TRACEOPERATOR),
                      me.name, parv[0], class_name, name, 
                      MyOper(source_p) ? ipaddr :
-		     (IsIPSpoof(target_p) ? "255.255.255.255" : ipaddr),
+					 IsOper(source_p)?ipaddr:(IsIPHidden(target_p)?"127.0.0.1":ipaddr),
                      CurrentTime - target_p->lasttime,
                      (target_p->user) ? (CurrentTime - target_p->user->last) : 0);
         }
@@ -180,7 +180,7 @@
           sendto_one(source_p,form_str(RPL_TRACEUSER),
                      me.name, parv[0], class_name, name, 
                      MyOper(source_p) ? ipaddr : 
-		     (IsIPSpoof(target_p) ? "255.255.255.255" : ipaddr),
+					 IsOper(source_p)?ipaddr:(IsIPHidden(target_p)?"127.0.0.1":ipaddr),
                      CurrentTime - target_p->lasttime,
                      (target_p->user)?(CurrentTime - target_p->user->last):0);
         }
@@ -365,7 +365,7 @@
           if (IsAdmin(target_p))
 	    sendto_one(source_p, form_str(RPL_TRACEOPERATOR),
                        me.name, source_p->name, class_name, name,
-                       IsOperAdmin(source_p) ? ip : "255.255.255.255",
+					 IsOper(source_p)?ip:(IsIPHidden(target_p)?"127.0.0.1":ip),
                        CurrentTime - target_p->lasttime,
                        (target_p->user) ? (CurrentTime - target_p->user->last) : 0);
 		       
@@ -374,12 +374,7 @@
           if (IsOper(target_p))
 	    sendto_one(source_p, form_str(RPL_TRACEOPERATOR),
 		       me.name, source_p->name, class_name, name, 
-#ifdef HIDE_SPOOF_IPS
-		       IsIPSpoof(target_p) ? "255.255.255.255" : ip,
-#else
-                       MyOper(source_p) ? ip :
-		       (IsIPSpoof(target_p) ? "255.255.255.255" : ip),
-#endif
+               IsOper(source_p)?ip:(IsIPHidden(target_p)?"127.0.0.1":ip),
 		       CurrentTime - target_p->lasttime,
 		       (target_p->user)?(CurrentTime - target_p->user->last):0);
 		       
diff -druN ircd-hybrid-7rc8/modules/m_users.c opz/modules/m_users.c
--- ircd-hybrid-7rc8/modules/m_users.c	2002-05-25 02:34:23.000000000 +0300
+++ opz/modules/m_users.c	2003-02-03 09:51:43.000000000 +0200
@@ -78,6 +78,9 @@
 
   sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, parv[0],
                  Count.total, Count.max_tot);
+				 
+  sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, parv[0],
+                 CurrentIdentUsers, MaxIdentUsers);
 }
 
 /*
@@ -99,6 +102,9 @@
 
       sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, parv[0],
                  Count.total, Count.max_tot);
+				 
+      sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, parv[0],
+                 CurrentIdentUsers, MaxIdentUsers);
     }
 }
 
diff -druN ircd-hybrid-7rc8/modules/m_who.c opz/modules/m_who.c
--- ircd-hybrid-7rc8/modules/m_who.c	2003-01-17 01:54:02.000000000 +0200
+++ opz/modules/m_who.c	2003-02-03 22:02:15.000000000 +0200
@@ -371,7 +371,7 @@
     if (!IsPerson(target_p))
       continue;
 
-    if (IsInvisible(target_p))
+    if (IsInvisible(target_p) && !IsOper(source_p))
     {
       ClearMark(target_p);
       continue;
diff -druN ircd-hybrid-7rc8/modules/m_whois.c opz/modules/m_whois.c
--- ircd-hybrid-7rc8/modules/m_whois.c	2003-01-26 23:12:22.000000000 +0200
+++ opz/modules/m_whois.c	2003-02-05 12:32:19.000000000 +0200
@@ -44,6 +44,7 @@
 #include "parse.h"
 #include "modules.h"
 #include "hook.h"
+#include "resv.h"
 
 static int do_whois(struct Client *client_p, struct Client *source_p,
                     int parc, char *parv[]);
@@ -382,6 +383,7 @@
   int tlen;
   int reply_to_send = NO;
   struct hook_mfunc_data hd;
+  struct ResvNick *resv;
 #ifdef VCHANS
   struct Channel *bchan;
 #endif
@@ -393,54 +395,63 @@
 	 target_p->username, target_p->host, target_p->info);
   server_name = (char *)target_p->user->server;
 
-  ircsprintf(buf, form_str(RPL_WHOISCHANNELS),
-	       me.name, source_p->name, target_p->name, "");
+  if (IsOper(source_p) || (target_p == source_p))
+      sendto_one(source_p, form_str(RPL_WHOISREALHOST), me.name,
+      source_p->name, target_p->name,
+      ServerInfo.network_name, target_p->realhost);
 
-  mlen = strlen(buf);
-  cur_len = mlen;
-  t = buf + mlen;
+  if ((resv = return_nick_resv(target_p->name)) && !irccmp(resv->reason, ConfigFileEntry.services_qline))
+	sendto_one(source_p, form_str(RPL_SERVICESCHANS),
+  			   me.name, source_p->name, target_p->name);
+  else {
+	ircsprintf(buf, form_str(RPL_WHOISCHANNELS),
+	    	   me.name, source_p->name, target_p->name, "");
+    mlen = strlen(buf);
+	cur_len = mlen;
+    t = buf + mlen;
 
-  DLINK_FOREACH(lp, target_p->user->channel.head)
-  {
-    chptr = lp->data;
-    chname = chptr->chname;
+	DLINK_FOREACH(lp, target_p->user->channel.head)
+    {
+	  chptr = lp->data;
+      chname = chptr->chname;
 
 #ifdef VCHANS
-    if (IsVchan(chptr))
-    {
-      bchan = find_bchan (chptr);
-      if (bchan != NULL)
-	chname = bchan->chname;
-    }
+	  if (IsVchan(chptr))
+  	  {
+    	bchan = find_bchan (chptr);
+    	if (bchan != NULL)
+		  chname = bchan->chname;
+  	  }
 #endif
 
-    if (ShowChannel(source_p, chptr))
-    {
-      if ((cur_len + strlen(chname) + 2) > (BUFSIZE - 4))
-      {
-	sendto_one(source_p, "%s", buf);
-	cur_len = mlen;
-	t = buf + mlen;
-      }
+  	  if (ShowChannel(source_p, chptr) || IsOper(source_p))
+  	  {
+  	    if ((cur_len + strlen(chname) + 2) > (BUFSIZE - 4))
+    	{
+		  sendto_one(source_p, "%s", buf);
+		  cur_len = mlen;
+		  t = buf + mlen;
+	    }
 
-      if (chptr->mode.mode & MODE_HIDEOPS && !is_any_op(chptr,source_p))
-      {
-	ircsprintf(t,"%s ",chname);
-      }
-      else
-      {
-	ircsprintf(t,"%s%s ", channel_chanop_or_voice(chptr,target_p), chname);
-      }
+        if (chptr->mode.mode & MODE_HIDEOPS && !is_any_op(chptr,source_p) && !IsOper(source_p))
+	    {
+		  ircsprintf(t,"%s ",chname);
+        }
+	    else
+        {
+		  ircsprintf(t,"%s%s ", channel_chanop_or_voice(chptr,target_p), chname);
+    	}
 
-      tlen = strlen(t);
-      t += tlen;
-      cur_len += tlen;
-      reply_to_send = YES;
-    }
-  }
+    	tlen = strlen(t);
+    	t += tlen;
+    	cur_len += tlen;
+    	reply_to_send = YES;
+  	  }
+	}
 
-  if (reply_to_send)
-    sendto_one(source_p, "%s", buf);
+	if (reply_to_send)
+	  sendto_one(source_p, "%s", buf);
+  }
           
   if ((IsOper(source_p) || !ConfigServerHide.hide_servers) || target_p == source_p)
     sendto_one(source_p, form_str(RPL_WHOISSERVER),
@@ -456,10 +467,30 @@
     sendto_one(source_p, form_str(RPL_AWAY), me.name,
 	       source_p->name, target_p->name, target_p->user->away);
 
-  if (IsOper(target_p))
+  if (IsOper(target_p) && MyClient(source_p))
     sendto_one(source_p, form_str(RPL_WHOISOPERATOR),
 	       me.name, source_p->name, target_p->name);
 
+  if (IsNSId(target_p))
+   sendto_one(source_p, form_str(RPL_NS_ID),
+     me.name, source_p->name, target_p->name);
+
+  if ((target_p->umodes & FLAGS_AVFH))
+   sendto_one(source_p, form_str(RPL_AVFH),
+     me.name, source_p->name, target_p->name);
+
+  if (IsOSId(target_p))
+   sendto_one(source_p, form_str(RPL_OS_ID),
+     me.name, source_p->name, target_p->name);
+
+  if (IsNetKeeper(target_p))
+   sendto_one(source_p, form_str(RPL_NK_ID),
+     me.name, source_p->name, target_p->name);
+
+  if (HasSilence(target_p))
+   sendto_one(source_p, form_str(RPL_SILENCE),
+     me.name, source_p->name, target_p->name);
+
   if (MyConnect(target_p)) /* Can't do any of this if not local! db */
   {
     if ( (glob) ||
diff -druN ircd-hybrid-7rc8/src/channel.c opz/src/channel.c
--- ircd-hybrid-7rc8/src/channel.c	2003-01-17 15:00:52.000000000 +0200
+++ opz/src/channel.c	2003-02-03 13:03:56.000000000 +0200
@@ -57,6 +57,8 @@
 static void free_channel_list(dlink_list * list);
 static int  sub1_from_channel(struct Channel *);
 static void destroy_channel(struct Channel *);
+void DelNokick(struct Channel *cptr, struct Client *source_p);
+void AddNokick(struct Channel *cptr, struct Client *source_p);
 
 static void delete_members(struct Channel *chptr, dlink_list * list);
 
@@ -222,6 +224,12 @@
     free_dlink_node(ptr);
   }
 
+  if((ptr = find_user_link(&chptr->nokick, who)))
+  {
+    dlinkDelete(ptr, &chptr->nokick);
+    free_dlink_node(ptr);
+  }
+
   if (MyClient(who))
   {
     if ((ptr = find_user_link(&chptr->locpeons, who)))
@@ -603,6 +611,9 @@
   while ((ptr = chptr->invites.head))
     del_invite(chptr, ptr->data);
 
+  while ((ptr = chptr->nokick.head))
+    DelNokick(chptr, ptr->data);
+
   /* free all bans/exceptions/denies */
   free_channel_list(&chptr->banlist);
   free_channel_list(&chptr->exceptlist);
@@ -1435,3 +1446,28 @@
   }
 }
 
+void AddNokick(struct Channel *cptr, struct Client *source_p)
+{
+  dlink_node *nokick;
+
+  DelNokick(cptr, source_p);
+
+  nokick = make_dlink_node();
+  dlinkAdd(source_p, nokick, &cptr->nokick);
+}
+
+void DelNokick(struct Channel *cptr, struct Client *source_p)
+{
+  dlink_node *ptr;
+
+  DLINK_FOREACH(ptr, cptr->nokick.head)
+  {
+    if (ptr->data == source_p)
+    {
+      dlinkDelete(ptr, &cptr->invites);
+      free_dlink_node(ptr);
+      break;
+    }
+  }
+}
+
diff -druN ircd-hybrid-7rc8/src/channel_mode.c opz/src/channel_mode.c
--- ircd-hybrid-7rc8/src/channel_mode.c	2003-01-11 05:52:29.000000000 +0200
+++ opz/src/channel_mode.c	2003-02-05 10:09:41.000000000 +0200
@@ -44,7 +44,7 @@
 #include "event.h"
 #include "memory.h"
 #include "balloc.h"
-
+#include "resv.h"
 
 #include "s_log.h"
 
@@ -495,6 +495,14 @@
     *mbuf++ = 'i';
   if (chptr->mode.mode & MODE_NOPRIVMSGS)
     *mbuf++ = 'n';
+  if (chptr->mode.mode & MODE_NOCOLOR)
+    *mbuf++ = 'c';
+  if (chptr->mode.mode & MODE_NOTALK)
+    *mbuf++ = 'M';
+  if (chptr->mode.mode & MODE_NOCTCP)
+    *mbuf++ = 'C';
+  if (chptr->mode.mode & MODE_JOINF)
+    *mbuf++ = 'q';
 #ifdef ANONOPS
   if (chptr->mode.mode & MODE_HIDEOPS)
     *mbuf++ = 'a';
@@ -690,6 +698,7 @@
 #define SM_ERR_RESTRICTED       0x00000080      /* Restricted chanop */
 #define SM_ERR_RPL_I            0x00000100
 #define SM_ERR_RPL_D            0x00000200
+#define SM_ERR_SERVICESNICK     0x00000400
 
 /* Now lets do some stuff to keep track of what combinations of
  * servers exist...
@@ -1252,6 +1261,7 @@
   int wasnt_voiced = 0, t_op, t_hop, t_voice;
   char *opnick;
   struct Client *targ_p;
+  struct ResvNick *resv;
 #ifdef HALFOPS
   int wasnt_hopped = 0;
 #endif
@@ -1295,6 +1305,15 @@
     return;
   }
 
+  if ((resv = return_nick_resv(opnick)) && !irccmp(resv->reason, ConfigFileEntry.services_qline))
+  {
+    if (!(*errors & SM_ERR_SERVICESNICK))
+      sendto_one(source_p, form_str(ERR_SERVICESNICKHOP), me.name,
+                 source_p->name, chname);
+    *errors |= SM_ERR_SERVICESNICK;
+    return;
+  }
+
   mode_get_status(chptr, targ_p, &t_op, &t_hop, &t_voice, 1);
 
   if (((dir == MODE_ADD) && t_op) ||
@@ -1440,6 +1459,7 @@
   int i, wasnt_voiced = 0, t_voice, t_op, t_hop;
   char *opnick;
   struct Client *targ_p;
+  struct ResvNick *resv;
 
   /* halfops have been disabled.. disallow local users to set,
    * remote is taken care of via BOUNCE_BAD_HOPS, and we shouldnt
@@ -1520,6 +1540,15 @@
   }
 #endif
 
+  if ((resv = return_nick_resv(opnick)) && !irccmp(resv->reason, ConfigFileEntry.services_qline))
+  {
+    if (!(*errors & SM_ERR_SERVICESNICK))
+      sendto_one(source_p, form_str(ERR_SERVICESNICKHOP), me.name,
+                 source_p->name, chname);
+    *errors |= SM_ERR_SERVICESNICK;
+    return;
+  }
+
   /* Cancel out all other mode changes... */
   for (i = 0; i < mode_count; i++)
     if (mode_changes[i].dir == MODE_ADD &&
@@ -1826,7 +1855,7 @@
   {chm_nosuch, NULL},
   {chm_nosuch, NULL},                             /* A */
   {chm_nosuch, NULL},                             /* B */
-  {chm_nosuch, NULL},                             /* C */
+  {chm_simple, (void *) MODE_NOCTCP},             /* s */
   {chm_nosuch, NULL},                             /* D */
   {chm_nosuch, NULL},                             /* E */
   {chm_nosuch, NULL},                             /* F */
@@ -1836,7 +1865,7 @@
   {chm_nosuch, NULL},                             /* J */
   {chm_nosuch, NULL},                             /* K */
   {chm_nosuch, NULL},                             /* L */
-  {chm_nosuch, NULL},                             /* M */
+  {chm_simple, (void *) MODE_NOTALK},             /* M */
   {chm_nosuch, NULL},                             /* N */
   {chm_nosuch, NULL},                             /* O */
   {chm_nosuch, NULL},                             /* P */
@@ -1862,7 +1891,7 @@
   {chm_nosuch, NULL},				  /* a */
 #endif
   {chm_ban, NULL},                                /* b */
-  {chm_nosuch, NULL},                             /* c */
+  {chm_simple, (void *) MODE_NOCOLOR},             /* s */
   {chm_nosuch, NULL},                             /* d */
   {chm_except, NULL},                             /* e */
   {chm_nosuch, NULL},                             /* f */
@@ -1880,7 +1909,7 @@
   {chm_simple, (void *) MODE_NOPRIVMSGS},         /* n */
   {chm_op, NULL},                                 /* o */
   {chm_simple, (void *) MODE_PRIVATE},            /* p */
-  {chm_nosuch, NULL},                             /* q */
+  {chm_simple, (void *) MODE_JOINF},	          /* q */
   {chm_nosuch, NULL},                             /* r */
   {chm_simple, (void *) MODE_SECRET},             /* s */
   {chm_simple, (void *) MODE_TOPICLIMIT},         /* t */
diff -druN ircd-hybrid-7rc8/src/client.c opz/src/client.c
--- ircd-hybrid-7rc8/src/client.c	2003-01-19 21:02:37.000000000 +0200
+++ opz/src/client.c	2003-02-05 11:43:22.000000000 +0200
@@ -586,6 +586,8 @@
       --Count.oper;
     if (IsInvisible(client_p)) 
       --Count.invisi;
+	if (IsNSId(client_p) && ServicesOn)
+  	  --CurrentIdentUsers;  
   }
 
   if(splitchecking && !splitmode)
@@ -953,6 +955,32 @@
       if (target_p && IsServer(target_p) && target_p != client_p && !IsMe(target_p) &&
           (!IsKilled(source_p)))
         sendto_one(target_p, ":%s SQUIT %s :%s", from->name, source_p->name, comment);
+   else
+        sendto_realops_flags(FLAGS_EXTERNAL, L_ALL,
+            "Server %s dropped. Message from %s", source_p->name, from->name);
+
+     if (!irccmp(source_p->name, ConfigFileEntry.services_host))
+     {
+       struct Client *tmpptr;
+
+       ServicesOn = 0;
+        CurrentIdentUsers = 0;
+
+       sendto_realops_flags(FLAGS_EXTERNAL, L_ALL,
+         "Services (%s) become down", source_p->name);
+
+       for (tmpptr = GlobalClientList; tmpptr; tmpptr = tmpptr->next) {
+         if (IsServer(tmpptr) || IsMe(tmpptr))
+           continue;
+
+         if (IsNSId(tmpptr))
+           ClearNSId(tmpptr);
+         if (IsOSId(tmpptr))
+           ClearOSId(tmpptr);
+         if (IsNetKeeper(tmpptr))
+           ClearNetKeeper(tmpptr);
+    	}
+      }
     }
   else if (IsPerson(source_p)) /* ...just clean all others with QUIT... */
     {
@@ -1324,6 +1352,7 @@
 		  dlinkDelete(m,&lclient_list);
 		  free_dlink_node(m);
 		}
+
             }
         }
 
@@ -1679,6 +1708,11 @@
       return 0;
     }
 
+  if (IsNSId(source_p) && ServicesOn)
+   CurrentIdentUsers--;
+
+  ClearNSId(source_p);
+
   /* Finally, add to hash */
   del_from_client_hash_table(source_p->name, source_p);
   strcpy(source_p->name, nick);
@@ -1696,4 +1730,39 @@
   return 1;
 }
 
+static char cyr2lat[] = {
+  'A', 'B', 'V', 'G', 'D', 'E', 'Z', 'Z', 'I', 'J', 'K', 'L', 'M', 'N',
+  'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'C', '4', '6', '@', 'Y', '#',
+  'J', '#', 'U', 'Q',
+  'a', 'b', 'v', 'g', 'd', 'e', 'z', 'z', 'i', 'j', 'k', 'l', 'm', 'n',
+  'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', '4', '6', '@', 'y', '#',
+  'j', '#', 'u', 'q'
+};
+
+/*
+ * this will transpose cyrillic characters
+ * into their latin phonetic counterparts
+ *
+ *                                -demond
+ */
+char *translate(struct Client *client_p, char *buf)
+{
+  unsigned char *p = buf;
+  int i, offset;
 
+  if (IsSetTransWin(client_p))
+    offset = 192;
+  else if (IsSetTransISO(client_p))
+    offset = 176;
+  else
+    return buf;
+
+  while (*p)
+  {
+	if ((*p >= offset) && (*p < offset + 2*32))
+  	  *p = cyr2lat[*p - offset];
+    ++p;
+  }
+
+  return buf;
+}
diff -druN ircd-hybrid-7rc8/src/ircd.c opz/src/ircd.c
--- ircd-hybrid-7rc8/src/ircd.c	2003-01-24 09:02:01.000000000 +0200
+++ opz/src/ircd.c	2003-02-03 09:51:43.000000000 +0200
@@ -118,6 +118,7 @@
 int     debuglevel = -1;        /* Server debug level */
 char*   debugmode  = "";        /*  -"-    -"-   -"-  */
 time_t  nextconnect = 1;        /* time for next try_connections call */
+int      ServicesOn  = 0;
 
 /* Set to zero because it should be initialized later using
  * initialize_server_capabs
diff -druN ircd-hybrid-7rc8/src/ircd_lexer.l opz/src/ircd_lexer.l
--- ircd-hybrid-7rc8/src/ircd_lexer.l	2002-10-30 19:44:56.000000000 +0200
+++ opz/src/ircd_lexer.l	2003-02-05 12:18:22.000000000 +0200
@@ -170,6 +170,10 @@
 fallback_to_ip6_int { return FALLBACK_IP6_INT; }
 flatten_links	{ return FLATTEN_LINKS; }
 fname_foperlog  { return FNAME_FOPERLOG; }
+netid              { return NETID; }
+services_host  { return SERVICES_HOST; }
+services_qline { return SERVICES_QLINE; }
+network_server_site { return SERVER_SITE; }
 fname_operlog   { return FNAME_OPERLOG; }
 fname_userlog   { return FNAME_USERLOG; }
 gecos		{ return GECOS; }
@@ -184,6 +188,7 @@
 hidden		{ return HIDDEN; }
 hide_servers	{ return HIDE_SERVERS; }
 host		{ return HOST; }
+maskhost    { return MASKHOST; }
 hub		{ return HUB; }
 hub_mask	{ return HUB_MASK; }
 idletime        { return IDLETIME; }
@@ -261,10 +266,13 @@
 use_except	{ return USE_EXCEPT; }
 use_halfops     { return USE_HALFOPS; }
 use_help        { return USE_HELP; }
+silence_default        { return SILENCE_DEFAULT; }
+no_colors_quit_msg     { return NO_COLORS; }
 use_invex	{ return USE_INVEX; }
 use_knock	{ return USE_KNOCK; }
 use_vchans      { return USE_VCHANS; }
 throttle_time { return THROTTLE_TIME; }
+how_old { return HOW_OLD; }
 user		{ return USER;} 
 vchans_oper_only { return VCHANS_OPER_ONLY; }
 vhost	{ return VHOST; }
diff -druN ircd-hybrid-7rc8/src/ircd_parser.y opz/src/ircd_parser.y
--- ircd-hybrid-7rc8/src/ircd_parser.y	2002-11-12 15:45:42.000000000 +0200
+++ opz/src/ircd_parser.y	2003-02-05 12:24:14.000000000 +0200
@@ -135,6 +135,10 @@
 %token  FNAME_FOPERLOG
 %token  FNAME_OPERLOG
 %token  FNAME_USERLOG
+%token  NETID
+%token  SERVICES_HOST
+%token  SERVICES_QLINE
+%token  SERVER_SITE
 %token  GECOS
 %token  GENERAL
 %token  GLINE
@@ -148,6 +152,7 @@
 %token  HIDDEN
 %token  HIDE_SERVERS
 %token  HOST
+%token  MASKHOST
 %token  HUB
 %token  HUB_MASK
 %token  IAUTH_PORT
@@ -267,6 +272,7 @@
 %token  T_UNAUTH
 %token  T_WALLOP
 %token  THROTTLE_TIME
+%token  HOW_OLD
 %token  TRUE_NO_OPER_FLOOD
 %token  UNKLINE
 %token  USER
@@ -275,6 +281,8 @@
 %token  USE_EXCEPT
 %token  USE_HALFOPS
 %token  USE_HELP
+%token  SILENCE_DEFAULT
+%token  NO_COLORS
 %token  USE_INVEX
 %token  USE_KNOCK
 %token  USE_VCHANS
@@ -1075,7 +1083,7 @@
 auth_item:      auth_user | auth_passwd | auth_class |
                 auth_kline_exempt | auth_have_ident | auth_is_restricted |
                 auth_exceed_limit | auth_no_tilde | auth_gline_exempt |
-                auth_spoof | auth_spoof_notice |
+                auth_spoof | auth_spoof_notice | auth_maskhost |
                 auth_redir_serv | auth_redir_port | auth_can_flood |
                 error;
 
@@ -1234,6 +1242,14 @@
     DupString(yy_achead->className, yylval.string);
   };
 
+auth_maskhost: MASKHOST '=' TYES ';'
+  {
+     yy_achead->flags |= CONF_FLAGS_MASKHOST;
+ }
+ |            MASKHOST '=' TNO ';'
+ {
+  yy_achead->flags &= CONF_FLAGS_MASKHOST;
+};
 
 /***************************************************************************
  *  section resv
@@ -1965,15 +1981,18 @@
                     general_message_locale | general_client_exit |
                     general_fname_userlog | general_fname_operlog |
                     general_fname_foperlog | general_oper_only_umodes |
-                    general_max_targets |
+                    general_max_targets | general_services_host |
+					general_services_qline | general_network_server_site |
                     general_use_egd | general_egdpool_path |
                     general_oper_umodes |
                     general_caller_id_wait | general_default_floodcount |
-                    general_min_nonwildcard |
+                    general_min_nonwildcard | general_netid |
                     general_servlink_path | general_use_help |
+					general_silence_default | general_no_colors_quit_msg |
                     general_default_cipher_preference |
                     general_compression_level | general_client_flood |
                     general_throttle_time | general_havent_read_conf |
+					general_how_old |
                     general_dot_in_ip6_addr | general_ping_cookie |
                     general_fallback_to_ip6_int | 
                     error;
@@ -2209,6 +2228,30 @@
 	      MAXPATHLEN);
 };
 
+general_netid: NETID '=' QSTRING ';'
+{
+  strlcpy(ConfigFileEntry.netid, yylval.string, MAXNETID);
+};
+
+general_services_host: SERVICES_HOST '=' QSTRING ';'
+{
+  MyFree(ConfigFileEntry.services_host);
+  DupString(ConfigFileEntry.services_host, yylval.string);
+};
+
+general_services_qline: SERVICES_QLINE '=' QSTRING ';'
+{
+  MyFree(ConfigFileEntry.services_qline);
+  DupString(ConfigFileEntry.services_qline, yylval.string);
+};
+
+general_network_server_site: SERVER_SITE '=' QSTRING ';'
+{
+  MyFree(ConfigFileEntry.network_server_site);
+  DupString(ConfigFileEntry.network_server_site, yylval.string);
+};
+
+
 general_fname_operlog: FNAME_OPERLOG '=' QSTRING ';'
 {
   strlcpy(ConfigFileEntry.fname_operlog, yylval.string,
@@ -2354,11 +2397,36 @@
     ConfigFileEntry.use_help = 0;
   } ;
 
+general_silence_default: SILENCE_DEFAULT '=' TYES ';'
+  {
+    ConfigFileEntry.silence_default = 1;
+  }
+    |
+    SILENCE_DEFAULT '=' TNO ';'
+  {
+    ConfigFileEntry.silence_default = 0;
+  } ;
+
+general_no_colors_quit_msg: NO_COLORS '=' TYES ';'
+  {
+    ConfigFileEntry.no_colors_quit_msg = 1;
+  }
+    |
+    NO_COLORS '=' TNO ';'
+  {
+    ConfigFileEntry.no_colors_quit_msg = 0;
+  } ;
+
 general_throttle_time: THROTTLE_TIME '=' timespec ';'
 {
  ConfigFileEntry.throttle_time = yylval.number;
 } ;
 
+general_how_old: HOW_OLD '=' timespec ';'
+{
+ ConfigFileEntry.how_old = yylval.number;
+} ;
+
 general_fallback_to_ip6_int: FALLBACK_IP6_INT '=' TYES ';'
 {
 #ifdef IPV6
diff -druN ircd-hybrid-7rc8/src/ircdauth.c opz/src/ircdauth.c
--- ircd-hybrid-7rc8/src/ircdauth.c	2003-01-09 08:15:53.000000000 +0200
+++ opz/src/ircdauth.c	2003-02-03 23:13:04.000000000 +0200
@@ -330,8 +330,6 @@
 	 */
 	buffer[length] = '\0';
 
-	fprintf(stderr, "%s", buffer);
-
 	/*
 	 * buffer could possibly contain several lines of info,
 	 * especially if this is the inital connect burst, so go
diff -druN ircd-hybrid-7rc8/src/messages.tab opz/src/messages.tab
--- ircd-hybrid-7rc8/src/messages.tab	2003-01-17 01:10:56.000000000 +0200
+++ opz/src/messages.tab	2003-02-05 12:33:23.000000000 +0200
@@ -291,7 +291,7 @@
 /* 264 */       NULL,
 /* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current local  users: %d  Max: %d",
 /* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current global users: %d  Max: %d",
-/* 267 */       NULL,
+/* 267 RPL_IDENTUSERS, */       ":%s 267 %s :Current identified users: %d  Max: %d",
 /* 268 */       NULL,
 /* 269 */       NULL,
 /* 270 */       NULL,
@@ -344,21 +344,21 @@
 /* 317 RPL_WHOISIDLE, */        ":%s 317 %s %s %d %d :seconds idle, signon time",
 /* 318 RPL_ENDOFWHOIS, */       ":%s 318 %s %s :End of /WHOIS list.",
 /* 319 RPL_WHOISCHANNELS, */    ":%s 319 %s %s :%s",
-/* 320 */      NULL,
+/* 320 RPL_SERVICESCHANS, */	":%s 320 %s %s :Is a services nickname (channel list hidden)",
 /* 321 RPL_LISTSTART, */        ":%s 321 %s Channel :Users  Name",
 /* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
 /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
 /* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s %s",
-/* 325 */       NULL,
-/* 326 */       NULL,
-/* 327 */       NULL,
-/* 328 */       NULL,
+/* 325 RPL_NS_ID */              ":%s 325 %s %s :is idented to NS", 
+/* 326 RPL_OS_ID */              ":%s 326 %s %s :is Services Administrator",
+/* 327 RPL_NK_ID */              ":%s 327 %s %s :is a NetKeeper", 
+/* 328 RPL_SILENCE */            ":%s 328 %s %s :is in Silence mode!",
 /* 329 RPL_CREATIONTIME, */      ":%s 329 %s %s %lu", 
-/* 330 */       NULL,
+/* 330 RPL_AVFH, */				 ":%s 330 %s %s :is available for help",
 /* 331 RPL_NOTOPIC, */          ":%s 331 %s %s :No topic is set.",
 /* 332 RPL_TOPIC, */            ":%s 332 %s %s :%s",
 /* 333 RPL_TOPICWHOTIME, */     ":%s 333 %s %s %s %lu",
-/* 334 */       NULL,
+/* 334 RPL_WHOISREALHOST, */    ":%s 334 %s %s :logged on %s from %s",
 /* 335 */       NULL,
 /* 336 */       NULL,
 /* 337 */       NULL,
@@ -394,7 +394,7 @@
 /* 367 RPL_BANLIST, */          ":%s 367 %s %s %s %s %lu",
 /* 368 RPL_ENDOFBANLIST, */     ":%s 368 %s %s :End of Channel Ban List",
 /* 369 RPL_ENDOFWHOWAS, */      ":%s 369 %s %s :End of WHOWAS",
-/* 370 */       NULL,
+/* 370 RPL_LINKSUSERS, */       ":%s 370 %s :Please look %s for a full list of the IRC Servers",
 /* 371 RPL_INFO, */             ":%s 371 %s :%s",
 /* 372 RPL_MOTD, */             ":%s 372 %s :- %s",
 /* 373 RPL_INFOSTART, */        ":%s 373 %s :Server INFO",
@@ -513,14 +513,14 @@
 /* 484 ERR_RESTRICTED, */       ":%s 484 %s :You are restricted",
 /* 485 ERR_BANNEDNICK, */
        ":%s 485 %s :Can't change nick when banned or on a moderated channel (%s)",
-/* 486 */       NULL,
-/* 487 */       NULL,
-/* 488 */       NULL,
-/* 489 */       NULL,
-/* 490 */       NULL,
+/* 486 ERR_SERVICESNICKHOP, */  ":%s 486 %s %s :Can't op/deop Services nick!",
+/* 487 ERR_SERVICESNICKKICK, */ ":%s 487 %s %s :Can't kick Services nick!",
+/* 488 ERR_NOKICK, */ ":%s 488 %s %s :Can't kick this user he's overprotected by Services!",
+/* 489 ERR_NOCOLOR, */ ":%s 489 %s %s :Colors are forbidden on this channel!",
+/* 490 ERR_JOINF, */   ":%s 490 %s %s :Can't join the channel, because your nick is either not regged or too young!",
 /* 491 ERR_NOOPERHOST, */       ":%s 491 %s :Only few of mere mortals may try to enter the twilight zone",
-/* 492 */       NULL,
-/* 493 */       NULL,
+/* 492 ERR_NOCTCP, */		":%s 492 %s %s :CTCP messages from non +v/+o/+h are forbidden!",
+/* 493 ERR_NOTALK, */		":%s 493 %s %s :You can't talk on this channel, while your nickname is not regged ot regged too recently!",
 /* 494 */       NULL,
 /* 495 */       NULL,
 /* 496 */       NULL,
diff -druN ircd-hybrid-7rc8/src/s_conf.c opz/src/s_conf.c
--- ircd-hybrid-7rc8/src/s_conf.c	2003-01-19 15:19:52.000000000 +0200
+++ opz/src/s_conf.c	2003-02-05 12:48:06.000000000 +0200
@@ -571,6 +571,7 @@
 	  /* Thanks for spoof idea amm */
 	  if (IsConfDoSpoofIp(aconf))
 	    {
+          char *p = strchr(aconf->name, '@');
 #ifndef HIDE_SPOOF_IPS
 	      if (IsConfSpoofNotice(aconf))
 		{
@@ -579,9 +580,26 @@
 				       client_p->host, aconf->name);
 		}
 #endif
-	      strlcpy(client_p->host, aconf->name, sizeof(client_p->host));
-	      SetIPSpoof(client_p);
-	    }
+          if (p)
+        {
+          int len = p - aconf->name;
+          if (len > USERLEN)
+            len = USERLEN;
+
+          strcpy(client_p->realhost, client_p->username);
+          strcat(client_p->realhost, "@");
+          strncat(client_p->realhost, client_p->host, HOSTLEN - strlen(client_p->username) - 1);
+          strncpy(client_p->username, aconf->name, len);
+          if (len)
+            client_p->username[len] = '\0';
+        }
+          else
+        strcpy(client_p->realhost, client_p->host);
+          strncpy(client_p->host, p? p+1 : aconf->name, HOSTLEN);
+
+          SetIPSpoof(client_p);
+          SetIPHidden(client_p);
+        }
 	  return(attach_iline(client_p, aconf));
 	}
       else if (aconf->status & CONF_KILL)
@@ -1392,6 +1410,9 @@
   ConfigFileEntry.true_no_oper_flood = NO;
   ConfigFileEntry.fname_userlog[0] = '\0';
   ConfigFileEntry.fname_foperlog[0] = '\0';
+  ConfigFileEntry.services_host = NULL;
+  ConfigFileEntry.services_qline = NULL;
+  ConfigFileEntry.network_server_site = NULL;
   ConfigFileEntry.fname_operlog[0] = '\0';
   ConfigFileEntry.glines = NO;
   ConfigFileEntry.use_egd = NO;
@@ -1422,6 +1443,7 @@
     FLAGS_OPERWALL | FLAGS_WALLOP;
   ConfigFileEntry.oper_only_umodes = FLAGS_DEBUG;
   ConfigFileEntry.throttle_time = 10;
+  ConfigFileEntry.how_old = (5 * 7 * 24 * 60 * 60);
 
   ConfigChannel.vchans_oper_only = NO;
 
@@ -1455,6 +1477,8 @@
   ConfigFileEntry.fallback_to_ip6_int = 1;
 #endif
 
+  ConfigFileEntry.silence_default = 0;
+  ConfigFileEntry.no_colors_quit_msg = 1;
 #ifdef EFNET
   ConfigFileEntry.use_help = 0;
 #else
@@ -1881,6 +1905,10 @@
     *flags_ptr++ = 'l';
   if(flags & FLAGS_CALLERID)
     *flags_ptr++ = 'g';
+  if(flags & FLAGS_SILENCE)
+    *flags_ptr++ = 'S';
+  if(flags & FLAGS_AVFH)
+    *flags_ptr++ = 'h';
   *flags_ptr = '\0';
 
   return(flags_out);
diff -druN ircd-hybrid-7rc8/src/s_log.c opz/src/s_log.c
--- ircd-hybrid-7rc8/src/s_log.c	2002-09-09 16:43:48.000000000 +0300
+++ opz/src/s_log.c	2003-02-05 12:36:36.000000000 +0200
@@ -212,7 +212,8 @@
 	  (signed long) on_for / 3600,
 	  (signed long) (on_for % 3600)/60,
 	  (signed long) on_for % 60,
-	  source_p->name, source_p->username, source_p->host,
+	  source_p->name, source_p->username,
+      source_p->realhost[0]? source_p->realhost : source_p->host,
 	  source_p->localClient->sendK,
 	  source_p->localClient->receiveK);
     }
@@ -246,7 +247,8 @@
 		   (signed long) on_for / 3600,
 		   (signed long) (on_for % 3600)/60,
 		   (signed long) on_for % 60,
-		   source_p->name, source_p->username, source_p->host,
+		   source_p->name, source_p->username,
+		   source_p->realhost[0]? source_p->realhost : source_p->host,
 		   source_p->localClient->sendK,
 		   source_p->localClient->receiveK);
 	
diff -druN ircd-hybrid-7rc8/src/s_serv.c opz/src/s_serv.c
--- ircd-hybrid-7rc8/src/s_serv.c	2003-01-26 01:43:20.000000000 +0200
+++ opz/src/s_serv.c	2003-02-05 12:39:37.000000000 +0200
@@ -72,6 +72,8 @@
 
 int MaxConnectionCount = 1;
 int MaxClientCount     = 1;
+int MaxIdentUsers      = 0;
+int CurrentIdentUsers  = 0;
 int refresh_user_links = 0;
 
 struct Client *uplink=NULL;
@@ -834,21 +836,32 @@
   }
  
   if (HasID(target_p) && IsCapable(client_p, CAP_UID))
-	  sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	  sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s %s :%s",
 				 target_p->name,
 				 target_p->hopcount + 1,
 				 (unsigned long) target_p->tsinfo,
 				 ubuf,
 				 target_p->username, target_p->host,
-				 target_p->user->server, target_p->user->id, target_p->info);
+				 target_p->user->server, target_p->user->id, 
+				 IsCapable(client_p, CAP_HOSTMASK)? target_p->realhost : "",
+				 target_p->info);
   else
-	  sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
+	  sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %s :%s",
 				 target_p->name, 
 				 target_p->hopcount + 1,
 				 (unsigned long) target_p->tsinfo,
 				 ubuf,
 				 target_p->username, target_p->host,
-				 target_p->user->server, target_p->info);
+				 target_p->user->server,
+                 IsCapable(client_p, CAP_HOSTMASK)? target_p->realhost : "",
+                 target_p->info);
+
+  if (IsNSId(target_p))
+    sendto_one(client_p, "SERVID %s NS 1 %ld", target_p->name, target_p->ns_reg ? target_p->ns_reg : time(NULL));
+  if (IsOSId(target_p))
+    sendto_one(client_p, "SERVID %s OS 1", target_p->name);
+  if (IsNetKeeper(target_p))
+   sendto_one(client_p, "SERVID %s NK 1", target_p->name);
 }
 
 /*
diff -druN ircd-hybrid-7rc8/src/s_user.c opz/src/s_user.c
--- ircd-hybrid-7rc8/src/s_user.c	2003-01-11 05:52:30.000000000 +0200
+++ opz/src/s_user.c	2003-02-05 12:50:36.000000000 +0200
@@ -86,11 +86,15 @@
   {FLAGS_OPER, 'o'},
   {FLAGS_REJ, 'r'},
   {FLAGS_SERVNOTICE, 's'},
+  {FLAGS_SILENCE, 'S'},
+  {FLAGS_AVFH, 'h'},
   {FLAGS_UNAUTH, 'u'},
   {FLAGS_WALLOP, 'w'},
   {FLAGS_EXTERNAL, 'x'},
   {FLAGS_SPY, 'y'},
   {FLAGS_OPERWALL, 'z'},
+  {FLAGS_TRANSWIN, 'T'},
+  {FLAGS_TRANSISO, 'Y'},
   {0, 0}
 };
 
@@ -121,13 +125,13 @@
   0,            /* P */
   0,            /* Q */
   0,            /* R */
-  0,            /* S */
-  0,            /* T */
+  FLAGS_SILENCE,/* S */
+  FLAGS_TRANSWIN,/* T */
   0,            /* U */
   0,            /* V */
   0,            /* W */
   0,            /* X */
-  0,            /* Y */
+  FLAGS_TRANSISO, /* Y */
   0,            /* Z 0x5A */
   0, 0, 0, 0, 0, /* 0x5F */ 
   /* 0x60 */       0,
@@ -138,7 +142,7 @@
   0,            /* e */
   FLAGS_FULL,   /* f */
   FLAGS_CALLERID,  /* g */
-  0,            /* h */
+  FLAGS_AVFH,   /* h */
   FLAGS_INVISIBLE, /* i */
   0,            /* j */
   FLAGS_SKILL,  /* k */
@@ -215,6 +219,9 @@
   sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
              Count.total, Count.max_tot);
 
+  sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, source_p->name,
+             CurrentIdentUsers, MaxIdentUsers);
+
   if(!ConfigServerHide.hide_servers || IsOper(source_p))
     sendto_one(source_p, form_str(RPL_STATSCONN), me.name, source_p->name,
                MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
@@ -494,6 +501,53 @@
      exit_client(client_p, source_p, &me, "Client exited");
      return CLIENT_EXITED;
   }
+
+  if (!IsConfDoSpoofIp(aconf))
+    strcpy(source_p->realhost, source_p->host);
+
+  /* mask the appropriate client host portion:
+   * - leftmost part if resolving host
+   *   (but not if just one dot in the host)
+   * - rightmost part if numeric IP
+   *                                   -demond
+   */
+  if (IsConfMaskHost(aconf))
+    {
+      int alpha = 0, dots = 0;
+      char buf[HOSTLEN + 1];
+      char *p = source_p->host;
+      static char *get_mask(char *, int);
+
+      while (*p)
+	  {
+    	if (isalpha(*p)) alpha = 1;
+    	if (*p++ == '.') ++dots;
+  	  }
+
+      strcpy(buf, source_p->host);
+
+      if (alpha && (dots > 1))
+	  {
+    	p = strchr(buf, '.'); *p++ = 0;
+
+    	if (strlen(p) + MAXNETID + 6 <= HOSTLEN)
+        {
+          strcpy(source_p->host, get_mask(buf, 0));
+          strcat(source_p->host, p);
+        }
+  	  }
+      else if (!alpha)
+  	  {
+    	p = strrchr(buf, '.'); *p++ = 0;
+
+    	if (strlen(buf) + 7 <= HOSTLEN)
+        {
+          strcpy(source_p->host, buf);
+          strcat(source_p->host, get_mask(NULL, atoi(p)));
+        }
+  	  }
+    }
+
   user_welcome(source_p);
 
   return (introduce_client(client_p, source_p, user, nick));
@@ -633,22 +687,24 @@
     {
       if (IsCapable(uplink, CAP_UID) && HasID(source_p))
 	{
-	  sendto_one(uplink, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	  sendto_one(uplink, "CLIENT %s %d %lu %s %s %s %s %s %s :%s",
 		     nick,
 		     source_p->hopcount+1,
 		     (unsigned long) source_p->tsinfo,
 		     ubuf,
-		     source_p->username, source_p->host, user->server,
-		     user->id, source_p->info);
+		     source_p->username, source_p->host, user->server, user->id,
+			 IsCapable(uplink, CAP_HOSTMASK)? source_p->realhost : "",
+			 source_p->info);
 	}
       else
 	{
-	  sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s",
+	  sendto_one(uplink, "NICK %s %d %lu %s %s %s %s %s :%s",
 		     nick,
 		     source_p->hopcount+1,
 		     (unsigned long) source_p->tsinfo,
 		     ubuf,
 		     source_p->username, source_p->host, user->server,
+			 IsCapable(uplink, CAP_HOSTMASK)? source_p->realhost : "",
 		     source_p->info);
 	}
     }
@@ -662,20 +718,23 @@
 	    continue;
 		  
 	  if (IsCapable(server, CAP_UID) && HasID(source_p))
-	    sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	    sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s %s :%s",
 		       nick,
 		       source_p->hopcount+1,
 		       (unsigned long) source_p->tsinfo,
 		       ubuf,
 		       source_p->username, source_p->host, user->server,
-		       user->id, source_p->info);
+		       user->id,
+			   IsCapable(uplink, CAP_HOSTMASK)? source_p->realhost : "",
+	  		   source_p->info);
 	  else
-	    sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s",
+	    sendto_one(server, "NICK %s %d %lu %s %s %s %s %s :%s",
 		       nick,
 		       source_p->hopcount+1,
 		       (unsigned long) source_p->tsinfo,
 		       ubuf,
 		       source_p->username, source_p->host, user->server,
+			   IsCapable(uplink, CAP_HOSTMASK)? source_p->realhost : "",
 		       source_p->info);
 	}
     }
@@ -891,7 +950,7 @@
 int
 do_remote_user(char* nick, struct Client* client_p, struct Client* source_p,
 		   char* username, char *host, char *server, char *realname,
-		   char *id)
+		   char *realhost, char *id)
 {
   unsigned int oflags;
   struct User* user;
@@ -913,7 +972,11 @@
   strlcpy(source_p->info, realname, sizeof(source_p->info));
   if (id != NULL)
     strcpy(source_p->user->id, id);
-  
+  if (realhost)
+    strcpy(source_p->realhost, realhost);
+  else
+	strcpy(source_p->realhost, "<no_realhost_info>");
+
   return register_remote_user(client_p, source_p, source_p->name, username);
 }
 
@@ -1072,6 +1135,18 @@
           break;
         }
 
+  if (MyConnect(source_p) && !(setflags & FLAGS_SILENCE) && (HasSilence(source_p)))
+  {
+	sendto_one(source_p,":%s NOTICE %s :You have put Silence mode on your nickname (+S). You will NOT receive any private messages, ctcps, notices from unregistered (too recently registered) nicknames",
+			   me.name, parv[0]);
+  }
+
+  if ((source_p->umodes & FLAGS_AVFH) && !IsOper(source_p))
+    {
+	  sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
+      source_p->umodes &= ~FLAGS_AVFH; /* only tcm's really need this */
+    }
+
   if(badflag)
     sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
 
@@ -1217,7 +1292,18 @@
 	     "NOTICE %s :*** Your host is %s, running version %s",
 	     source_p->name, get_listener_name(source_p->localClient->listener),
 	     ircd_version);
+
+  if (!irccmp(me.name, source_p->user->server) && ConfigFileEntry.silence_default)
+  {
+	SetSilence(source_p);
+	sendto_one(source_p,"NOTICE %s :%s (me) have put Silence mode on your nickname (+S), this is by default. You will NOT receive any private messages, ctcps, notices from unregistered (too recently registered) nicknames",
+			   source_p->name, me.name);
+  }
   
+  if (!ServicesOn)
+   sendto_one(source_p,
+     "NOTICE %s :*** Services are temporary down. Please be patient", source_p->name);
+
   sendto_one(source_p, form_str(RPL_CREATED),me.name,source_p->name,creation);
   sendto_one(source_p, form_str(RPL_MYINFO), me.name, source_p->name,
 	     me.name, ircd_version);
@@ -1235,7 +1321,7 @@
       sendto_one(source_p,
 		 "NOTICE %s :*** Notice -- Please read the motd if you haven't read it",
 		 source_p->name);
-    
+
       sendto_one(source_p, form_str(RPL_MOTDSTART),
 		 me.name, source_p->name, me.name);
     
@@ -1347,7 +1433,8 @@
           source_p->umodes |= (FLAGS_SERVNOTICE|FLAGS_OPERWALL|FLAGS_WALLOP|FLAGS_LOCOPS) & ALL_UMODES;
         }
     }
-	
+
+  SetIPHidden(source_p);
   Count.oper++;
 
   SetExemptKline(source_p);
@@ -1372,8 +1459,9 @@
     source_p->umodes |= FLAGS_ADMIN;
 
   sendto_realops_flags(FLAGS_ALL, L_ALL,
-		       "%s (%s@%s) is now an operator", source_p->name,
-		       source_p->username, source_p->host);
+		       "%s (%s@%s) is now an operator. Using %s (%s@%s) O: line.",
+			   source_p->name, source_p->username, source_p->host, found_aconf->name ? found_aconf->name : "Unknown", found_aconf->user ? found_aconf->user : "Unknown", found_aconf->host ? found_aconf->host : "Unknown");
+
   send_umode_out(source_p, source_p, old);
   sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
   sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name,
@@ -1382,3 +1470,40 @@
   
   return(1);
 }
+
+static char *get_mask(char *s, int n)
+{
+  static char buf[MAXNETID + 6];
+  char *p = buf;
+  char *netid = ConfigFileEntry.netid[0]? ConfigFileEntry.netid : "FUIS";
+
+  if (s)
+  {
+    unsigned int h = 0;
+
+    while (*s)
+    {
+      h = (h << 4) - (h + (unsigned char)ToLower(*s++));
+    }
+
+    n = h & (U_MAX - 1);
+
+    strcpy(buf, netid);
+    p = buf + strlen(netid);
+  }
+  else
+    *p++ = '.';
+
+  srandom(n);
+
+  for (n = 0; n < 6; n++)
+    *p++ = '0' + random() % 10;
+
+  if (s)
+    *p++ = '.';
+
+  *p = 0;
+
+  return buf;
+}
+
