From f5493691ed398d7bcc9022b5e074e03946414453 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sun, 8 May 2011 09:06:19 -0500 Subject: [PATCH] branding: if CUSTOM_BRANDING is defined, display charybdis version in /info (based on ircd-seven rebrand patch) --- configure | 6 ++++++ configure.ac | 4 ++++ include/setup.h.in | 3 +++ modules/m_version.c | 3 +++ src/messages.tab | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/configure b/configure index c6b69e8d..3739e8e2 100755 --- a/configure +++ b/configure @@ -7490,6 +7490,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF +if test "x$BRANDING_NAME" != "x$PACKAGE_NAME"; then + +$as_echo "#define CUSTOM_BRANDING 1" >>confdefs.h + +fi + if test ! -z "$SELECT_TYPE_EXPLICIT"; then SELECT_TYPE="$SELECT_TYPE_EXPLICIT"; echo "Forcing $SELECT_TYPE to be enabled" diff --git a/configure.ac b/configure.ac index a4eb6033..f68652f2 100644 --- a/configure.ac +++ b/configure.ac @@ -682,6 +682,10 @@ AC_HELP_STRING([--with-custom-version=NAME], AC_DEFINE_UNQUOTED(BRANDING_NAME, ["$BRANDING_NAME"], [Custom branding name.]) AC_DEFINE_UNQUOTED(BRANDING_VERSION, ["$BRANDING_VERSION"], [Custom branding name.]) +if test "x$BRANDING_NAME" != "x$PACKAGE_NAME"; then + AC_DEFINE(CUSTOM_BRANDING, 1, [Define if custom branding is enabled.]) +fi + if test ! -z "$SELECT_TYPE_EXPLICIT"; then SELECT_TYPE="$SELECT_TYPE_EXPLICIT"; echo "Forcing $SELECT_TYPE to be enabled" diff --git a/include/setup.h.in b/include/setup.h.in index 5bc16d12..0d30eab4 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -32,6 +32,9 @@ */ #undef CRAY_STACKSEG_END +/* Define if custom branding is enabled. */ +#undef CUSTOM_BRANDING + /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA diff --git a/modules/m_version.c b/modules/m_version.c index 60d793c5..fcd99196 100644 --- a/modules/m_version.c +++ b/modules/m_version.c @@ -95,6 +95,9 @@ mo_version(struct Client *client_p, struct Client *source_p, int parc, const cha { sendto_one_numeric(source_p, RPL_VERSION, form_str(RPL_VERSION), ircd_version, serno, +#ifdef CUSTOM_BRANDING + PACKAGE_NAME " " PACKAGE_VERSION, +#endif me.name, confopts(source_p), TS_CURRENT, ServerInfo.sid); show_isupport(source_p); diff --git a/src/messages.tab b/src/messages.tab index 9dfa77be..63e85207 100644 --- a/src/messages.tab +++ b/src/messages.tab @@ -372,7 +372,11 @@ static const char * replies[] = { /* 348 RPL_EXCEPTLIST */ ":%s 348 %s %s %s %s %lu", /* 349 RPL_ENDOFEXCEPTLIST */ ":%s 349 %s %s :End of Channel Exception List", /* 350 */ NULL, +#ifndef CUSTOM_BRANDING /* 351 RPL_VERSION, */ "%s(%s). %s :%s TS%dow %s", +#else +/* 351 RPL_VERSION, */ "%s(%s, %s). %s :%s TS%dow %s", +#endif /* 352 RPL_WHOREPLY, */ ":%s 352 %s %s %s %s %s %s %s :%d %s", /* 353 RPL_NAMREPLY, */ ":%s 353 %s %s %s :", /* 354 RPL_WHOSPCRPL */ NULL,