mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-03 08:13:14 +02:00
Re-add STATUSMSG in 005 and change the make_prefix() since it now
creates two buffers. Also remove the placeholder for STATUSMSG and PREFIX in src/api-isupport.c
This commit is contained in:
+8
-12
@@ -150,10 +150,10 @@ void extcmodes_check_for_changed_channel_modes(void)
|
||||
strlcpy(previous_chanmodes, chanmodes, sizeof(previous_chanmodes));
|
||||
}
|
||||
|
||||
char *make_prefix(void)
|
||||
void make_prefix(char **isupport_prefix, char **isupport_statusmsg)
|
||||
{
|
||||
static char prefix[256];
|
||||
char prefix_prefix[256];
|
||||
static char prefix_prefix[256];
|
||||
char prefix_modes[256];
|
||||
int rank[256];
|
||||
Cmode *cm;
|
||||
@@ -200,22 +200,18 @@ char *make_prefix(void)
|
||||
snprintf(prefix, sizeof(prefix), "(%s)%s", prefix_modes, prefix_prefix);
|
||||
}
|
||||
|
||||
return prefix;
|
||||
*isupport_prefix = prefix;
|
||||
*isupport_statusmsg = prefix_prefix;
|
||||
}
|
||||
|
||||
void extcmodes_check_for_changed_prefixes(void)
|
||||
{
|
||||
ISupport *isup;
|
||||
char *prefix = make_prefix();
|
||||
char *prefix, *statusmsg;
|
||||
|
||||
isup = ISupportFind("PREFIX");
|
||||
if (!isup)
|
||||
{
|
||||
strlcpy(previous_prefix, prefix, sizeof(previous_prefix));
|
||||
return; /* not booted yet. then we are done here. */
|
||||
}
|
||||
|
||||
ISupportSetValue(isup, prefix);
|
||||
make_prefix(&prefix, &statusmsg);
|
||||
ISupportSet(NULL, "PREFIX", prefix);
|
||||
ISupportSet(NULL, "STATUSMSG", statusmsg);
|
||||
|
||||
if (*previous_prefix && strcmp(prefix, previous_prefix))
|
||||
{
|
||||
|
||||
@@ -89,7 +89,6 @@ void isupport_init(void)
|
||||
ISupportSet(NULL, "ELIST", "MNUCT");
|
||||
ISupportSet(NULL, "CASEMAPPING", "ascii");
|
||||
ISupportSet(NULL, "NETWORK", NETWORK_NAME_005);
|
||||
ISupportSet(NULL, "PREFIX", ""); /* placeholder */
|
||||
ISupportSetFmt(NULL, "CHANMODES",
|
||||
CHPAR1 "%s,%s,%s,%s",
|
||||
EXPAR1, EXPAR2, EXPAR3, EXPAR4);
|
||||
|
||||
Reference in New Issue
Block a user