🢀︎ unrealircd :: 81f5d3a


commit 81f5d3a9ab35c6f7326c6bd9d772d9337414cef1
Author: acidvegas <acid.vegas@acid.vegas>
Date:   Sat Feb 15 15:00:02 2020 -0500

    Updated to 5.0.3.1

diff --git a/Makefile.in b/Makefile.in
index 3db18f1..48853d6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -171,9 +171,7 @@ install: all
 	$(INSTALL) -m 0700 -d @CONFDIR@
 	$(INSTALL) -m 0600 doc/conf/*.conf @CONFDIR@
 	$(INSTALL) -m 0600 doc/conf/*.motd @CONFDIR@
-	$(INSTALL) -m 0600 doc/conf/modules.sources.list @CONFDIR@ ; \
-	fi
-	-@extras/patches/patch_spamfilter_conf "@CONFDIR@"
+	$(INSTALL) -m 0600 doc/conf/modules.sources.list @CONFDIR@
 	$(INSTALL) -m 0700 unrealircd @SCRIPTDIR@
 	$(INSTALL) -m 0700 -d @MODULESDIR@
 	@rm -f @MODULESDIR@/*.so 1>/dev/null 2>&1
diff --git a/Makefile.windows b/Makefile.windows
index b70d90c..d8acb23 100644
--- a/Makefile.windows
+++ b/Makefile.windows
@@ -269,6 +269,7 @@ DLL_FILES=SRC/MODULES/CLOAK.DLL \
  SRC/MODULES/EXTBANS/MSGBYPASS.DLL \
  SRC/MODULES/EXTBANS/TIMEDBAN.DLL \
  SRC/MODULES/EXTBANS/PARTMSG.DLL \
+ SRC/MODULES/ACCOUNT-NOTIFY.DLL \
  SRC/MODULES/MESSAGE-TAGS.DLL \
  SRC/MODULES/BATCH.DLL \
  SRC/MODULES/ACCOUNT-TAG.DLL \
@@ -1014,6 +1015,9 @@ src/modules/extbans/timedban.dll: src/modules/extbans/timedban.c $(INCLUDES)
 src/modules/extbans/partmsg.dll: src/modules/extbans/partmsg.c $(INCLUDES)
 	$(CC) $(MODCFLAGS) /Fosrc/modules/extbans/ /Fesrc/modules/extbans/ src/modules/extbans/partmsg.c $(MODLFLAGS)
 
+src/modules/account-notify.dll: src/modules/account-notify.c $(INCLUDES)
+	$(CC) $(MODCFLAGS) /Fosrc/modules/ /Fesrc/modules/ src/modules/account-notify.c $(MODLFLAGS)
+
 src/modules/message-tags.dll: src/modules/message-tags.c $(INCLUDES)
 	$(CC) $(MODCFLAGS) /Fosrc/modules/ /Fesrc/modules/ src/modules/message-tags.c $(MODLFLAGS)
 
diff --git a/configure b/configure
index f1518fa..125017a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for unrealircd 5.0.3.
+# Generated by GNU Autoconf 2.69 for unrealircd 5.0.3.1.
 #
 # Report bugs to <https://bugs.unrealircd.org/>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='unrealircd'
 PACKAGE_TARNAME='unrealircd'
-PACKAGE_VERSION='5.0.3'
-PACKAGE_STRING='unrealircd 5.0.3'
+PACKAGE_VERSION='5.0.3.1'
+PACKAGE_STRING='unrealircd 5.0.3.1'
 PACKAGE_BUGREPORT='https://bugs.unrealircd.org/'
 PACKAGE_URL='https://unrealircd.org/'
 
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures unrealircd 5.0.3 to adapt to many kinds of systems.
+\`configure' configures unrealircd 5.0.3.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1391,7 +1391,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of unrealircd 5.0.3:";;
+     short | recursive ) echo "Configuration of unrealircd 5.0.3.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1544,7 +1544,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-unrealircd configure 5.0.3
+unrealircd configure 5.0.3.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1913,7 +1913,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by unrealircd $as_me 5.0.3, which was
+It was created by unrealircd $as_me 5.0.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2331,7 +2331,7 @@ _ACEOF
 # The version suffix such as a beta marker or release candidate
 # marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
 # string instead of an integer because it contains arbitrary data.
-UNREAL_VERSION_SUFFIX=""
+UNREAL_VERSION_SUFFIX=".1"
 
 cat >>confdefs.h <<_ACEOF
 #define UNREAL_VERSION_SUFFIX "$UNREAL_VERSION_SUFFIX"
@@ -8249,7 +8249,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by unrealircd $as_me 5.0.3, which was
+This file was extended by unrealircd $as_me 5.0.3.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8312,7 +8312,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-unrealircd config.status 5.0.3
+unrealircd config.status 5.0.3.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 7f649fe..983b6dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ dnl src/windows/unrealinst.iss
 dnl doc/Config.header
 dnl src/version.c.SH
 
-AC_INIT([unrealircd], [5.0.3], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
+AC_INIT([unrealircd], [5.0.3.1], [https://bugs.unrealircd.org/], [], [https://unrealircd.org/])
 AC_CONFIG_SRCDIR([src/ircd.c])
 AC_CONFIG_HEADER([include/setup.h])
 AC_CONFIG_AUX_DIR([autoconf])
@@ -40,7 +40,7 @@ AC_DEFINE_UNQUOTED([UNREAL_VERSION_MINOR], [$UNREAL_VERSION_MINOR], [Minor versi
 # The version suffix such as a beta marker or release candidate
 # marker. (e.g.: -rcX for unrealircd-3.2.9-rcX). This macro is a
 # string instead of an integer because it contains arbitrary data.
-UNREAL_VERSION_SUFFIX=[""]
+UNREAL_VERSION_SUFFIX=[".1"]
 AC_DEFINE_UNQUOTED([UNREAL_VERSION_SUFFIX], ["$UNREAL_VERSION_SUFFIX"], [Version suffix such as a beta marker or release candidate marker. (e.g.: -rcX for unrealircd-3.2.9-rcX)])
 
 AC_PATH_PROG(RM,rm)
diff --git a/doc/Config.header b/doc/Config.header
index 0647f06..caeeb18 100644
--- a/doc/Config.header
+++ b/doc/Config.header
@@ -7,7 +7,7 @@
  \___/|_| |_|_|  \___|\__,_|_|\___/\_| \_| \____/\__,_|
 
                                Configuration Program
-                                for UnrealIRCd 5.0.3
+                                for UnrealIRCd 5.0.3.1
                                     
 This program will help you to compile your IRC server, and ask you
 questions regarding the compile-time settings of it during the process. 
diff --git a/doc/RELEASE-NOTES.md b/doc/RELEASE-NOTES.md
index 47051a2..b7625dc 100644
--- a/doc/RELEASE-NOTES.md
+++ b/doc/RELEASE-NOTES.md
@@ -1,5 +1,9 @@
-UnrealIRCd 5.0.3 Release Notes
-===============================
+UnrealIRCd 5.0.3.1 Release Notes
+=================================
+
+UnrealIRCd 5.0.3.1
+-------------------
+This fixes a crash issue after REHASH in 5.0.3.
 
 UnrealIRCd 5.0.3
 -----------------
@@ -30,7 +34,7 @@ Changes:
   if you use highly customized [operclass blocks](https://www.unrealircd.org/docs/Operclass_block)
 
 Are you upgrading from UnrealIRCd 4.x to UnrealIRCd 5? If so,
-then check out the *UnrealIRCd 5* release notes further down. At the
+then check out the *UnrealIRCd 5* release notes [further down](#unrealircd-5). At the
 very least, check out [Upgrading from 4.x](https://www.unrealircd.org/docs/Upgrading_from_4.x).
 
 UnrealIRCd 5.0.2
diff --git a/doc/conf/new/auth.conf b/doc/conf/new/auth.conf
deleted file mode 100644
index 1a0ecab..0000000
--- a/doc/conf/new/auth.conf
+++ /dev/null
@@ -1,122 +0,0 @@
-admin { ""; }
-
-class clients { pingfreq 120; maxclients 100; sendq 1M; options { nofakelag; } }
-class servers { pingfreq 120; maxclients   2; sendq 1M; connfreq 30;       }
-
-allow { ip *; class clients; maxperip 2; }
-
-listen { ip *; port REDACTED; options { clientsonly; tls; } }
-listen { ip *; port REDACTED; options { serversonly; tls; } }
-
-require authentication {
-	mask *@*;
-	reason "8,4   E N T E R   T H E   V O I D   ";
-}
-
-link irc.supernets.org {
-	incoming { mask REDACTED; }
-	outgoing {
-		bind-ip *;
-		hostname REDACTED;
-		port REDACTED;
-		options { tls; autoconnect; }
-	}
-	password "REDACTED" { spkifp; }
-	class servers;
-}
-
-log "errors.log" { flags { errors; } maxsize 1K; }
-
-tld { mask *@*; motd remote.motd; rules remote.motd; options { remote; } }
-
-ulines { services.supernets.org; }
-
-set {
-	kline-address "8,4   E N T E R   T H E   V O I D   ";
-	gline-address "8,4   E N T E R   T H E   V O I D   ";
-	modes-on-connect "+ipRTx";
-	modes-on-oper "+HIq";
-	modes-on-join "+Cns";
-	level-on-join "op";
-	restrict-usermodes "ipRTx";
-	restrict-channelmodes "CnPps";
-	oper-auto-join "#help";
-	static-quit "EMO-QUIT";
-	static-part "EMO-PART";
-	who-limit 1;
-	nick-length 20;
-	maxchannelsperuser 10;
-	channel-command-prefix "`!@$.";
-	options { hide-ulines; flat-map; identd-check; }
-	network-name "SuperNETs";
-	default-server "irc.supernets.org";
-	services-server "services.supernets.org";
-	sasl-server "services.supernets.org";
-	help-channel "#help";
-	cloak-method ip;
-	cloak-keys {
-		"REDACTED";
-		"REDACTED";
-		"REDACTED";
-	}
-	hiddenhost-prefix "SUPER";
-	outdated-tls-policy {
-		user warn;
-		oper deny;
-		user-message "4WARNING: You are using an outdated SSL/TLS protocol or cipher";
-		oper-message "Network operators must connect using an up-to-date SSL/TLS protocol or cipher";
-	}
-	anti-flood {
-		away-flood 3:300;
-		connect-flood 3:300;
-		invite-flood 3:300;
-		join-flood 3:300;
-		knock-flood 3:300;
-		max-concurrent-conversations { users 5; new-user-every 60s; }
-		nick-flood 3:300;
-		unknown-flood-amount 2048;
-		unknown-flood-bantime 1h;
-	}
-	default-bantime 30d;
-	modef-default-unsettime 5;
-	spamfilter {
-		ban-time 30d;
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
-		except "#anythinggoes";
-	}
-	max-targets-per-command { kick 1; notice 1; part 1; privmsg 1; }
-	hide-ban-reason yes;
-	reject-message {
-		gline                "8,4   E N T E R   T H E   V O I D   ";
-		kline                "8,4   E N T E R   T H E   V O I D   ";
-		password-mismatch    "8,4   E N T E R   T H E   V O I D   ";
-		server-full          "8,4   E N T E R   T H E   V O I D   ";
-		too-many-connections "8,4   E N T E R   T H E   V O I D   ";
-		unauthorized         "8,4   E N T E R   T H E   V O I D   ";
-	}
-	antimixedutf8 {
-		score 10;
-		ban-action block;
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
-		ban-time 1d;
-	}
-	connthrottle {
-		known-users   { minimum-reputation-score 24; sasl-bypass yes;       }
-		new-users     { local-throttle 20:60;        global-throttle 30:60; }
-		disabled-when { reputation-gathering 1w;     start-delay 3m;        }
-	}
-	history {
-		channel {
-			playback-on-join        { lines 1000; time 1w; }
-			max-storage-per-channel { lines 1000; time 1w; }
-		}
-	}
-	manual-ban-target ip;
-}
-
-hideserver {
-	disable-map yes;
-	disable-links yes;
-	map-deny-message "Denied";
-	links-deny-message "Denied";
-}
\ No newline at end of file
diff --git a/doc/conf/new/public.conf b/doc/conf/new/public.conf
deleted file mode 100644
index d3f0da1..0000000
--- a/doc/conf/new/public.conf
+++ /dev/null
@@ -1,154 +0,0 @@
-admin { ""; }
-
-class clients { pingfreq 120; maxclients 100; sendq 100000; recvq 8000;  }
-class servers { pingfreq 120; maxclients   2; sendq 100000; connfreq 30; }
-
-allow { ip *; class clients; maxperip 2; }
-
-listen { ip *; port 6667;      options { clientsonly;      } }
-listen { ip *; port 6697;      options { clientsonly; tls; } }
-listen { ip *; port REDACTED;  options { serversonly; tls; } }
-
-link sasl.supernets.org {
-	incoming { mask REDACTED; }
-	outgoing {
-		bind-ip *;
-		hostname REDACTED;
-		port REDACTED;
-		options { tls; autoconnect; }
-	}
-	password "REDACTED" { spkifp; }
-	class servers;
-}
-
-log "errors.log" { flags { errors; } maxsize 1K; }
-
-tld { mask *@*; motd remote.motd; rules remote.motd; options { remote; } }
-
-ulines { services.supernets.org; }
-
-blacklist dronebl {
-	dns {
-		name dnsbl.dronebl.org;
-		type record;
-		reply { 3; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; }
-	}
-	action gzline;
-	ban-time 30d;
-	reason "8,4   E N T E R   T H E   V O I D   ";
-}
-
-blacklist efnetrbl {
-	dns {
-		name rbl.efnetrbl.org;
-		type record;
-		reply { 1; 4; 5; }
-	}
-	action gzline;
-	ban-time 30d;
-	reason "8,4   E N T E R   T H E   V O I D   ";
-}
-
-blacklist torbl {
-	dns {
-		name torexit.dan.me.uk;
-		type record;
-		reply { 100; }
-	}
-	action gzline;
-	ban-time 30d;
-	reason "8,4   E N T E R   T H E   V O I D   ";
-}
-
-set {
-	kline-address "8,4   E N T E R   T H E   V O I D   ";
-	gline-address "8,4   E N T E R   T H E   V O I D   ";
-	modes-on-connect "+ipRTx";
-	modes-on-oper "+HIq";
-	modes-on-join "+Cns";
-	level-on-join "op";
-	restrict-usermodes "ipRTx";
-	restrict-channelmodes "CnPps";
-	restrict-commands {
-		list { connect-delay 30; exempt-identified yes; }
-	}
-	static-quit "EMO-QUIT";
-	static-part "EMO-PART";
-	nick-length 20;
-	maxchannelsperuser 5;
-	channel-command-prefix "`!@$.";
-	options { hide-ulines; flat-map; identd-check; }
-	network-name "SuperNETs";
-	default-server "irc.supernets.org";
-	services-server "services.supernets.org";
-	sasl-server "services.supernets.org";
-	help-channel "#help";
-	cloak-method ip;
-	cloak-keys {
-		"REDACTED";
-		"REDACTED";
-		"REDACTED";
-	}
-	hiddenhost-prefix "SUPER";
-	plaintext-policy {
-		user warn;
-		user-message "4WARNING: You are not using a secure connection with SSL/TLS";
-	}
-	outdated-tls-policy {
-		user warn;
-		user-message "4WARNING: You are using an outdated SSL/TLS protocol or cipher";
-	}
-	anti-flood {
-		away-flood 3:300;
-		connect-flood 3:300;
-		invite-flood 3:300;
-		join-flood 3:300;
-		knock-flood 3:300;
-		max-concurrent-conversations { users 5; new-user-every 60s; }
-		nick-flood 3:300;
-		unknown-flood-amount 2048;
-		unknown-flood-bantime 1h;
-	}
-	default-bantime 30d;
-	modef-default-unsettime 5;
-	spamfilter {
-		ban-time 30d;
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
-		except "#anythinggoes";
-	}
-	max-targets-per-command { kick 1; notice 1; part 1; privmsg 1; }
-	hide-ban-reason yes;
-	reject-message {
-		gline                "8,4   E N T E R   T H E   V O I D   ";
-		kline                "8,4   E N T E R   T H E   V O I D   ";
-		password-mismatch    "8,4   E N T E R   T H E   V O I D   ";
-		server-full          "8,4   E N T E R   T H E   V O I D   ";
-		too-many-connections "8,4   E N T E R   T H E   V O I D   ";
-		unauthorized         "8,4   E N T E R   T H E   V O I D   ";
-	}
-	antimixedutf8 {
-		score 10;
-		ban-action block;
-		ban-reason "8,4   E N T E R   T H E   V O I D   ";
-		ban-time 1d;
-	}
-	connthrottle {
-		known-users   { minimum-reputation-score 24; sasl-bypass yes;       }
-		new-users     { local-throttle 20:60;        global-throttle 30:60; }
-		disabled-when { reputation-gathering 1w;     start-delay 3m;        }
-	}
-	history {
-		channel {
-			playback-on-join        { lines 1000; time 1w; }
-			max-storage-per-channel { lines 1000; time 1w; }
-		}
-	}
-	manual-ban-target ip;
-}
-
-hideserver {
-	disable-map yes;
-	disable-links yes;
-	map-deny-message "Denied";
-	links-deny-message "Denied";
-}
\ No newline at end of file
diff --git a/extras/tls.cnf b/extras/tls.cnf
index 46a9611..7a04a4a 100644
--- a/extras/tls.cnf
+++ b/extras/tls.cnf
@@ -18,7 +18,7 @@ stateOrProvinceName_default     = New York
 localityName                    = Locality Name (eg, city)
 
 0.organizationName              = Organization Name (eg, company)
-0.organizationName_default      = IRC geeks
+0.organizationName_default      = SuperNETs
 
 organizationalUnitName          = Organizational Unit Name (eg, section)
 organizationalUnitName_default  = IRCd  
diff --git a/include/modules.h b/include/modules.h
index f3156ca..dad5f0a 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -1007,6 +1007,7 @@ extern void SavePersistentLongX(ModuleInfo *modinfo, char *varshortname, long va
 #define HOOKTYPE_CONFIGRUN_EX 104
 #define HOOKTYPE_CAN_SEND_TO_USER 105
 #define HOOKTYPE_SERVER_SYNC 106
+#define HOOKTYPE_ACCOUNT_LOGIN 107
 
 /* Adding a new hook here?
  * 1) Add the #define HOOKTYPE_.... with a new number
@@ -1087,7 +1088,7 @@ int hooktype_rawpacket_in(Client *client, char *readbuf, int *length);
 int hooktype_packet(Client *from, Client *to, Client *intended_to, char **msg, int *length);
 int hooktype_handshake(Client *client);
 int hooktype_free_client(Client *acptr);
-int hooktype_free_user(ClientUser *user, Client *acptr);
+int hooktype_free_user(Client *acptr);
 int hooktype_can_join_limitexceeded(Client *client, Channel *channel, char *key, char *parv[]);
 int hooktype_visible_in_channel(Client *client, Channel *channel);
 int hooktype_join_data(Client *who, Channel *channel);
@@ -1118,6 +1119,7 @@ void hooktype_new_message(Client *sender, MessageTag *recv_mtags, MessageTag **m
 int hooktype_is_handshake_finished(Client *acptr);
 char *hooktype_pre_local_quit_chan(Client *client, Channel *channel, char *comment);
 int hooktype_ident_lookup(Client *acptr);
+int hooktype_account_login(Client *client, MessageTag *mtags);
 
 #ifdef GCC_TYPECHECKING
 #define ValidateHook(validatefunc, func) __builtin_types_compatible_p(__typeof__(func), __typeof__(validatefunc))
@@ -1225,7 +1227,8 @@ _UNREAL_ERROR(_hook_error_incompatible, "Incompatible hook function. Check argum
         ((hooktype == HOOKTYPE_IS_HANDSHAKE_FINISHED) && !ValidateHook(hooktype_is_handshake_finished, func)) || \
         ((hooktype == HOOKTYPE_PRE_LOCAL_QUIT_CHAN) && !ValidateHook(hooktype_pre_local_quit_chan, func)) || \
         ((hooktype == HOOKTYPE_IDENT_LOOKUP) && !ValidateHook(hooktype_ident_lookup, func)) || \
-        ((hooktype == HOOKTYPE_CONFIGRUN_EX) && !ValidateHook(hooktype_configrun_ex, func)) ) \
+        ((hooktype == HOOKTYPE_CONFIGRUN_EX) && !ValidateHook(hooktype_configrun_ex, func)) || \
+        ((hooktype == HOOKTYPE_ACCOUNT_LOGIN) && !ValidateHook(hooktype_account_login, func)) ) \
         _hook_error_incompatible();
 #endif /* GCC_TYPECHECKING */
 
diff --git a/include/windows/setup.h b/include/windows/setup.h
index d3abf09..0b86df7 100644
--- a/include/windows/setup.h
+++ b/include/windows/setup.h
@@ -67,6 +67,6 @@
 
 /* Version suffix such as a beta marker or release candidate marker. (e.g.:
    -rcX for unrealircd-3.2.9-rcX) */
-#define UNREAL_VERSION_SUFFIX ""
+#define UNREAL_VERSION_SUFFIX ".1"
 
 #endif
diff --git a/src/crashreport.c b/src/crashreport.c
index 91ae199..aaf9901 100644
--- a/src/crashreport.c
+++ b/src/crashreport.c
@@ -40,7 +40,9 @@ char *find_best_coredump(void)
 	while ((dir = readdir(fd)))
 	{
 		char *fname = dir->d_name;
-		if (filename_has_suffix(fname, ".core"))
+		if (strstr(fname, "core") && !strstr(fname, ".so") &&
+		    !strstr(fname, ".conf") && !strstr(fname, ".txt") &&
+		    !strstr(fname, ".done"))
 		{
 			char buf[512];
 			
diff --git a/src/modules/Makefile.in b/src/modules/Makefile.in
index 303f8df..5e749e3 100644
--- a/src/modules/Makefile.in
+++ b/src/modules/Makefile.in
@@ -66,6 +66,7 @@ R_MODULES= \
 	reputation.so connthrottle.so history_backend_mem.so \
 	history_backend_null.so tkldb.so channeldb.so \
 	restrict-commands.so rmtkl.so require-module.so \
+	account-notify.so \
 	message-tags.so batch.so \
 	account-tag.so labeled-response.so link-security.so \
 	message-ids.so plaintext-policy.so server-time.so sts.so \
@@ -613,6 +614,10 @@ require-module.so: require-module.c $(INCLUDES)
 	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
 		-o require-module.so require-module.c
 
+account-notify.so: account-notify.c $(INCLUDES)
+	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
+		-o account-notify.so account-notify.c
+
 ident_lookup.so: ident_lookup.c $(INCLUDES)
 	$(CC) $(CFLAGS) $(MODULEFLAGS) -DDYNAMIC_LINKING \
 		-o ident_lookup.so ident_lookup.c
diff --git a/src/modules/account-notify.c b/src/modules/account-notify.c
new file mode 100644
index 0000000..b2e9c3b
--- /dev/null
+++ b/src/modules/account-notify.c
@@ -0,0 +1,76 @@
+/*
+ *   IRC - Internet Relay Chat, src/modules/account-notify.c
+ *   (C) 2012-2020 The UnrealIRCd Team
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers.
+ *
+ *   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 "unrealircd.h"
+
+ModuleHeader MOD_HEADER
+  = {
+	"account-notify",	/* Name of module */
+	"5.0", 			/* Version */
+	"account-notify CAP",	/* Short description of module */
+	"UnrealIRCd Team",
+	"unrealircd-5",
+	};
+
+/* Variables */
+long CAP_ACCOUNT_NOTIFY = 0L;
+
+/* Forward declarations */
+int account_notify_account_login(Client *client, MessageTag *mtags);
+
+MOD_INIT()
+{
+	ClientCapabilityInfo c;
+
+	MARK_AS_OFFICIAL_MODULE(modinfo);
+
+	memset(&c, 0, sizeof(c));
+	c.name = "account-notify";
+	ClientCapabilityAdd(modinfo->handle, &c, &CAP_ACCOUNT_NOTIFY);
+
+	HookAdd(modinfo->handle, HOOKTYPE_ACCOUNT_LOGIN, 0, account_notify_account_login);
+
+	return MOD_SUCCESS;
+}
+
+MOD_LOAD()
+{
+	return MOD_SUCCESS;
+}
+
+MOD_UNLOAD()
+{
+	return MOD_SUCCESS;
+}
+
+int account_notify_account_login(Client *client, MessageTag *recv_mtags)
+{
+	MessageTag *mtags = NULL;
+	new_message(client, recv_mtags, &mtags);
+	sendto_local_common_channels(client, client,
+				     CAP_ACCOUNT_NOTIFY, mtags,
+				     ":%s ACCOUNT %s",
+				     client->name,
+				     !isdigit(*client->user->svid) ? client->user->svid : "*");
+	free_message_tags(mtags);
+	return 0;
+}
diff --git a/src/modules/history.c b/src/modules/history.c
index 8b3d5ac..4cf39b3 100644
--- a/src/modules/history.c
+++ b/src/modules/history.c
@@ -45,7 +45,7 @@ CMD_FUNC(cmd_history);
 MOD_INIT()
 {
 	MARK_AS_OFFICIAL_MODULE(modinfo);
-	CommandAdd(NULL, "HISTORY", cmd_history, MAXPARA, CMD_USER);
+	CommandAdd(modinfo->handle, "HISTORY", cmd_history, MAXPARA, CMD_USER);
 	return MOD_SUCCESS;
 }
 
diff --git a/src/modules/svsnick.c b/src/modules/svsnick.c
index 7be1746..92618fb 100644
--- a/src/modules/svsnick.c
+++ b/src/modules/svsnick.c
@@ -96,6 +96,7 @@ CMD_FUNC(cmd_svsnick)
 	/* no 'recv_mtags' here, we do not inherit from SVSNICK but generate a new NICK event */
 	new_message(acptr, NULL, &mtags);
 	sendto_local_common_channels(acptr, NULL, 0, mtags, ":%s NICK :%s", acptr->name, parv[2]);
+	sendto_one(acptr, mtags, ":%s NICK :%s", acptr->name, parv[2]);
 	sendto_server(NULL, 0, 0, mtags, ":%s NICK %s :%ld", acptr->id, parv[2], atol(parv[3]));
 	free_message_tags(mtags);
 
diff --git a/src/user.c b/src/user.c
index 178a10b..2d8016c 100644
--- a/src/user.c
+++ b/src/user.c
@@ -697,12 +697,5 @@ void make_cloakedhost(Client *client, char *curr, char *buf, size_t buflen)
 /** Called after a user is logged in (or out) of a services account */
 void user_account_login(MessageTag *recv_mtags, Client *client)
 {
-	MessageTag *mtags = NULL;
-	new_message(client, recv_mtags, &mtags);
-	sendto_local_common_channels(client, client,
-				     ClientCapabilityBit("account-notify"), mtags,
-				     ":%s ACCOUNT %s",
-				     client->name,
-				     !isdigit(*client->user->svid) ? client->user->svid : "*");
-	free_message_tags(mtags);
+	RunHook2(HOOKTYPE_ACCOUNT_LOGIN, client, recv_mtags);
 }
diff --git a/src/version.c.SH b/src/version.c.SH
index d282403..19cc542 100644
--- a/src/version.c.SH
+++ b/src/version.c.SH
@@ -4,7 +4,7 @@ echo "Extracting src/version.c..."
 
 #id=`grep '$Id: Changes,v' ../Changes`
 #id=`echo $id |sed 's/.* Changes\,v \(.*\) .* Exp .*/\1/'`
-id="5.0.3"
+id="5.0.3.1"
 echo "$id"
 
 if test -r version.c
diff --git a/src/windows/UnrealIRCd.exe.manifest b/src/windows/UnrealIRCd.exe.manifest
index 9a00bc0..37a8716 100644
--- a/src/windows/UnrealIRCd.exe.manifest
+++ b/src/windows/UnrealIRCd.exe.manifest
@@ -3,7 +3,7 @@
 <assemblyIdentity
     processorArchitecture="amd64"
     name="UnrealIRCd.UnrealIRCd.5"
-    version="5.0.3.0"
+    version="5.0.3.1"
     type="win32"
 />
 <description>Internet Relay Chat Daemon</description>
diff --git a/src/windows/unrealinst.iss b/src/windows/unrealinst.iss
index e00c8dd..2fc4b82 100644
--- a/src/windows/unrealinst.iss
+++ b/src/windows/unrealinst.iss
@@ -6,7 +6,7 @@
 
 [Setup]
 AppName=UnrealIRCd 5
-AppVerName=UnrealIRCd 5.0.3
+AppVerName=UnrealIRCd 5.0.3.1
 AppPublisher=UnrealIRCd Team
 AppPublisherURL=https://www.unrealircd.org
 AppSupportURL=https://www.unrealircd.org