-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gateway name field for auth blocks #273
base: main
Are you sure you want to change the base?
Conversation
Oops, I seem to have sniped extban progval suggested |
Since the creation of this PR, a new module was introduced using the extban char `g`, creating an unforseen conflict. This commit changes that character to `w` to match the char used in inspircd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of places could add a const
(cap_gateway_desc
, struct Client
's gateway
, and struct ConfItem
's gateway
), but there doesn't seem to be a consistent style either way.
#include <capability.h> | ||
#include <s_serv.h> | ||
#include <s_newconf.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these are necessary (MAPI_CAP_CLIENT
is defined in modules.h).
/* $w by itself will match all gateway users */ | ||
if (data == NULL) | ||
return EmptyString(client_p->gateway) ? EXTBAN_NOMATCH : EXTBAN_MATCH; | ||
return match(data, client_p->gateway) ? EXTBAN_MATCH : EXTBAN_NOMATCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match
seems to expect the second argument to be non NULL
. I think this should be something like
if EmptyString(client_p->gateway)
return EXTBAN_NOMATCH;
/* $w by itself will match all gateway users */
if (data == NULL)
return EXTBAN_MATCH;
return match(data, client_p->gateway) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
@@ -565,6 +568,21 @@ do_who(struct Client *source_p, struct Client *target_p, struct membership *mspt | |||
q = "0"; | |||
append_format(str, sizeof str, &pos, " %s", q); | |||
} | |||
if (fmt->fields & FIELD_GATEWAY) | |||
{ | |||
/* use same the logic as account */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the reasoning for account to do this 1, I don't think it makes sense to copy that logic for gateway.
Closes #213.