CLEANUP: Convert HUB from compile-time define to runtime config
authorRemco Rijnders <remmy@serenity-irc.net>
Sat, 7 Mar 2026 17:17:36 +0000 (12:17 -0500)
committerRemco Rijnders <remmy@serenity-irc.net>
Sat, 7 Mar 2026 17:17:36 +0000 (12:17 -0500)
commit050ed833add7bdb5465cb3d4b6cd548a2c93502a
treee5bc9b94ea4830ec25ebeab001d563d0c0f8438c
parentddf3a33851e56c7e415721f6386efd8e63367e30
CLEANUP: Convert HUB from compile-time define to runtime config

Hub mode is now configured via ircd.conf using the G: (general
config) line:

    G:hub

Default is leaf mode (non-hub) if not set. The setting is
re-evaluated on /rehash, so hub mode can be toggled without
recompiling or restarting the server.

Removes #ifdef HUB / #ifndef HUB from ircd.c, s_serv.c, s_debug.c,
config.h, and setup.h. Adds runtime is_hub global checked in:
- try_connections(): leaf prevents auto-connecting when already linked
- m_server(): leaf rejects incoming server links if already have one
- m_server(): hub sends GLOBOPS on new server link establishment
- m_version(): 'H' serveropts flag shown dynamically based on is_hub

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
doc/example.conf
include/config.h
include/h.h
include/setup.h [new file with mode: 0644]
src/ircd.c
src/s_conf.c
src/s_debug.c
src/s_serv.c