mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Set the default STATUSMSG to @ instead of @+ if it's missing
This fixes two issues: - IRCNet doesn't have STATUSMSG, but it supports +channels, and including + in the default value meant processing those incorrectly - The "bahamut hack", for old servers that support but don't advertise STATUSMSG, didn't work since ischannel_func doesn't use the default. The choice of @ intentionally leaves out support for other STATUSMSG (for example, AzzurraNet's bahamut 1.4 fork seemed to support + and % in any order, contradicting the comment in the code). I think this is a decent tradeoff, given how those servers are uncommon and relying on +# or %# is even less common than @#. Fixes #531
This commit is contained in:
parent
2b7f32633c
commit
3429c1a0a0
@ -41,7 +41,7 @@ int fe_channel_is_opchannel(IRC_SERVER_REC *server, const char *target)
|
|||||||
|
|
||||||
statusmsg = g_hash_table_lookup(server->isupport, "statusmsg");
|
statusmsg = g_hash_table_lookup(server->isupport, "statusmsg");
|
||||||
if (statusmsg == NULL)
|
if (statusmsg == NULL)
|
||||||
statusmsg = "@+";
|
statusmsg = "@";
|
||||||
|
|
||||||
return strchr(statusmsg, *target) != NULL;
|
return strchr(statusmsg, *target) != NULL;
|
||||||
}
|
}
|
||||||
@ -61,12 +61,9 @@ const char *fe_channel_skip_prefix(IRC_SERVER_REC *server, const char *target)
|
|||||||
statusmsg = g_hash_table_lookup(server->isupport, "statusmsg");
|
statusmsg = g_hash_table_lookup(server->isupport, "statusmsg");
|
||||||
|
|
||||||
/* Hack: for bahamut 1.4 which sends neither STATUSMSG nor
|
/* Hack: for bahamut 1.4 which sends neither STATUSMSG nor
|
||||||
* WALLCHOPS in 005, accept @#chan and @+#chan (but not +#chan) */
|
* WALLCHOPS in 005 */
|
||||||
if (statusmsg == NULL && *target != '@')
|
|
||||||
return target;
|
|
||||||
|
|
||||||
if (statusmsg == NULL)
|
if (statusmsg == NULL)
|
||||||
statusmsg = "@+";
|
statusmsg = "@";
|
||||||
|
|
||||||
/* Strip the leading statusmsg prefixes */
|
/* Strip the leading statusmsg prefixes */
|
||||||
while (strchr(statusmsg, *target) != NULL) {
|
while (strchr(statusmsg, *target) != NULL) {
|
||||||
|
@ -89,8 +89,10 @@ static int ischannel_func(SERVER_REC *server, const char *data)
|
|||||||
chantypes = "#&!+"; /* normal, local, secure, modeless */
|
chantypes = "#&!+"; /* normal, local, secure, modeless */
|
||||||
|
|
||||||
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
|
statusmsg = g_hash_table_lookup(irc_server->isupport, "statusmsg");
|
||||||
if (statusmsg != NULL)
|
if (statusmsg == NULL)
|
||||||
data += strspn(data, statusmsg);
|
statusmsg = "@";
|
||||||
|
|
||||||
|
data += strspn(data, statusmsg);
|
||||||
|
|
||||||
/* strchr(3) considers the trailing NUL as part of the string, make sure
|
/* strchr(3) considers the trailing NUL as part of the string, make sure
|
||||||
* we didn't advance too much. */
|
* we didn't advance too much. */
|
||||||
|
Loading…
Reference in New Issue
Block a user