--- src/modules/m_svsmode.c.orig	2006-06-16 14:29:17.000000000 -0400
+++ src/modules/m_svsmode.c	2006-07-04 17:57:59.833442210 -0400
@@ -199,6 +199,7 @@ int channel_svsmode(aClient *cptr, aClie
 				if (parc >= i) {
 					char uhost[NICKLEN+USERLEN+HOSTLEN+6], vhost[NICKLEN+USERLEN+HOSTLEN+6];
 					char ihost[NICKLEN+USERLEN+HOSTLEN+6];
+					char chost[NICKLEN+USERLEN+HOSTLEN+6];
 					if (!(acptr = find_person(parv[i-1], NULL))) {
 						i++;
 						break;
@@ -218,6 +219,9 @@ int channel_svsmode(aClient *cptr, aClie
 					strlcpy(ihost, make_nick_user_host(acptr->name,
 						acptr->user->username, GetIP(acptr)),
 						sizeof ihost);
+					strlcpy(chost, make_nick_user_host(acptr->name, 
+						acptr->user->username, acptr->user->cloakedhost),
+						sizeof chost);
 					ban = chptr->banlist;
 					while (ban) {
 						bnext = ban->next;
@@ -232,7 +236,7 @@ int channel_svsmode(aClient *cptr, aClie
 								}
 							}
 						}
-						else if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost)) {
+						else if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost) || !match(ban->banstr, chost)) {
 							add_send_mode_param(chptr, sptr, '-',  'b', 
 								ban->banstr);
 							del_listmode(&chptr->banlist, chptr, ban->banstr);
@@ -265,6 +269,7 @@ int channel_svsmode(aClient *cptr, aClie
 				if (parc >= i) {
 					char uhost[NICKLEN+USERLEN+HOSTLEN+6], vhost[NICKLEN+USERLEN+HOSTLEN+6];
 					char ihost[NICKLEN+USERLEN+HOSTLEN+6];
+					char chost[NICKLEN+USERLEN+HOSTLEN+6];
 					if (!(acptr = find_person(parv[i-1], NULL))) {
 						i++;
 						break;
@@ -284,6 +289,9 @@ int channel_svsmode(aClient *cptr, aClie
 					strlcpy(ihost, make_nick_user_host(acptr->name,
 						acptr->user->username, GetIP(acptr)),
 						sizeof ihost);
+					strlcpy(chost, make_nick_user_host(acptr->name, 
+						acptr->user->username, acptr->user->cloakedhost),
+						sizeof chost);
 
 					ban = chptr->exlist;
 					while (ban) {
@@ -299,7 +307,7 @@ int channel_svsmode(aClient *cptr, aClie
 								}
 							}
 						}
-						else if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost)) {
+						else if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost) || !match(ban->banstr, chost)) {
 							add_send_mode_param(chptr, sptr, '-',  'e', 
 								ban->banstr);
 							del_listmode(&chptr->exlist, chptr, ban->banstr);
@@ -331,6 +339,7 @@ int channel_svsmode(aClient *cptr, aClie
 				if (parc >= i) {
 					char uhost[NICKLEN+USERLEN+HOSTLEN+6], vhost[NICKLEN+USERLEN+HOSTLEN+6];
 					char ihost[NICKLEN+USERLEN+HOSTLEN+6];
+					char chost[NICKLEN+USERLEN+HOSTLEN+6];
 					if (!(acptr = find_person(parv[i-1], NULL))) {
 						i++;
 						break;
@@ -350,11 +359,14 @@ int channel_svsmode(aClient *cptr, aClie
 					strlcpy(ihost, make_nick_user_host(acptr->name,
 						acptr->user->username, GetIP(acptr)),
 						sizeof ihost);
+					strlcpy(chost, make_nick_user_host(acptr->name, 
+						acptr->user->username, acptr->user->cloakedhost),
+						sizeof chost);
 
 					ban = chptr->invexlist;
 					while (ban) {
 						bnext = ban->next;
-						if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost)) {
+						if (!match(ban->banstr, uhost) || !match(ban->banstr, vhost) || !match(ban->banstr, ihost) || !match(ban->banstr, chost)) {
 							add_send_mode_param(chptr, sptr, '-',  'I', 
 								ban->banstr);
 							del_listmode(&chptr->invexlist, chptr, ban->banstr);
