Index: src/channel.c
===================================================================
--- src/channel.c	(revision 1)
+++ src/channel.c	(revision 3)
@@ -3496,6 +3496,21 @@
 		}
 }
 
+/* 
+*	Tells if an user is ivited in a channel
+*/
+int IsInvited (aClient *cptr, aChannel *chptr) { //By Sac
+	
+	Link **inv, *tmp;
+
+	for (inv = &(chptr->invites); (tmp = *inv); inv = &tmp->next)
+		if (tmp->value.cptr == cptr)
+		{
+			return 1;
+		}
+	return 0;
+}
+
 /*
 **  Subtract one user from channel i (and free channel
 **  block, if channel became empty).
@@ -4193,7 +4208,8 @@
 			{
 				if (SecretChannel(chptr)
 				    && !IsMember(cptr, chptr)
-				    && !IsAnOper(cptr))
+				    && !IsAnOper(cptr)
+				    && !IsInvited(cptr, chptr)) // If we are invited to the channel it is returned too -- sac
 					continue;
 
 				/* Much more readable like this -- codemastr */
Index: include/struct.h
===================================================================
--- include/struct.h	(revision 1)
+++ include/struct.h	(revision 3)
@@ -1598,7 +1598,7 @@
 /* channel not shown but names are */
 #define	HiddenChannel(x)	((x) && ((x)->mode.mode & MODE_PRIVATE))
 /* channel visible */
-#define	ShowChannel(v,c)	(PubChannel(c) || IsMember((v),(c)))
+#define	ShowChannel(v,c)	(PubChannel(c) || IsMember((v),(c)) || IsInvited((v),(c)))
 #define	PubChannel(x)		((!x) || ((x)->mode.mode &\
 				 (MODE_PRIVATE | MODE_SECRET)) == 0)
 
