diff -r 972de6ab7b60 include/h.h
--- a/include/h.h	Sun Jul 18 19:00:03 2010 -0400
+++ b/include/h.h	Tue Jul 20 12:39:18 2010 -0400
@@ -16,7 +16,7 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *   $Id$
+ *   $Id: h.h,v 1.1.1.1.6.1.2.173.2.66 2010-06-17 02:41:42 binki Exp $
  */
 
 /*
@@ -193,7 +193,7 @@
 #ifndef DISABLE_EXTBAN_STACKING
 extern int ban_check_mask(aClient *, aChannel *, char *, int, int);
 extern int extban_is_ok_nuh_extban(aClient *, aChannel *, char *, int, int, int);
-extern char* extban_conv_param_nuh_extban(char *);
+extern char* extban_conv_param_nuh_or_extban(char *);
 #endif
 extern Ban *is_banned(aClient *, aChannel *, int);
 extern Ban *is_banned_with_nick(aClient *, aChannel *, int, char *);
diff -r 972de6ab7b60 src/modules/Makefile.in
--- a/src/modules/Makefile.in	Sun Jul 18 19:00:03 2010 -0400
+++ b/src/modules/Makefile.in	Tue Jul 20 12:39:18 2010 -0400
@@ -16,7 +16,7 @@
 #*   along with this program; if not, write to the Free Software
 #*   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #*   
-#*   $Id$
+#*   $Id: Makefile.in,v 1.1.2.41.2.22 2010-07-12 01:25:14 binki Exp $
 #*/
 # major edit from fez - to compile objects individually...
 
@@ -54,7 +54,7 @@
 	 m_connect.so m_dccallow.so m_userip.so m_nick.so m_user.so \
 	 m_mode.so m_watch.so m_part.so m_join.so m_motd.so m_opermotd.so \
 	 m_botmotd.so m_lusers.so m_names.so m_svsnolag.so m_addmotd.so \
-	 m_svslusers.so m_starttls.so
+	 m_svslusers.so m_starttls.so m_extban_join.so
 
 #note change of .c to .o
 COMMANDS=m_sethost.o m_chghost.o m_chgident.o m_setname.o m_setident.o \
@@ -826,6 +826,10 @@
 	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
 		-o m_starttls.so m_starttls.c
 
+m_extban_join.so: m_extban_join.c $(INCLUDES)
+	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
+		-o m_extban_join.so m_extban_join.c
+
 #############################################################################
 #             and now the remaining modules...
 #############################################################################
diff -r 972de6ab7b60 src/modules/m_extban_join.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/modules/m_extban_join.c	Tue Jul 20 12:39:18 2010 -0400
@@ -0,0 +1,94 @@
+/*
+ * UnrealIRCd src/modules/m_extban_join.c
+ * (C) 2010 The UnrealIRCd 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.
+ */
+
+#include "config.h"
+#include "struct.h"
+#include "common.h"
+#include "sys.h"
+#include "msg.h"
+#include "proto.h"
+#include "channel.h"
+#include "h.h"
+#include "modules.h"
+
+ModuleHeader MOD_HEADER(m_extban_join)
+  = {
+	"m_extban_join",
+	"$Id $",
+	"/mode +b ~j:*!*@*",
+	"3.2-b8-1",
+	NULL
+    };
+
+DLLFUNC int m_extban_join_is_banned(aClient *sptr, aChannel *chptr, char *ban, int type);
+
+/**
+ * Modeled after extban_init().
+ */
+DLLFUNC int MOD_INIT(m_extban_join)(ModuleInfo *modinfo)
+{
+	ExtbanInfo req;
+
+	memset(&req, 0, sizeof(ExtbanInfo));
+	req.flag = 'j';
+#ifdef DISABLE_STACKED_EXTBANS
+	req.conv_param = extban_conv_param_nuh;
+#else
+	req.conv_param = extban_conv_param_nuh_or_extban;
+#endif
+	req.is_banned = m_extban_join_is_banned;
+	req.is_ok = extban_is_ok_nuh_extban;
+	if (ExtbanAdd(modinfo->handle, req))
+	{
+		config_error("m_extban_join: Unable to register ~j:*!*@* extended ban.");
+		return MOD_FAILED;
+	}
+
+	return MOD_SUCCESS;
+}
+
+DLLFUNC int MOD_LOAD(m_extban_join)(int module_load)
+{
+	return MOD_SUCCESS;
+}
+
+DLLFUNC int MOD_UNLOAD(m_addmotd)(int module_unload)
+{
+	/*
+	 * No need to call ExtbanDel() here because the module
+	 * unloading subsystem does that for us.
+	 */
+	return MOD_SUCCESS;
+}
+
+DLLFUNC int m_extban_join_is_banned(aClient *sptr, aChannel *chptr, char *banin, int type)
+{
+	char *sub_ban;
+
+	if (type != BANCHK_JOIN)
+		return 0;
+
+	sub_ban = banin + 3;
+
+#ifdef DISABLE_STACKED_EXTBANS
+	return extban_is_banned_helper(sub_ban);
+#else
+	return ban_check_mask(sptr, chptr, sub_ban, type, 0);
+#endif
+}
