diff --git a/src/inf.c b/src/inf.c index 0e7822f..82a9de4 100644 --- a/src/inf.c +++ b/src/inf.c @@ -39,8 +39,6 @@ static void remove_server_restricted_flags(struct adc_message* cmd) adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_REFERER); } -static int user_is_protected(struct user* user); - static int set_feature_cast_supports(struct user* u, struct adc_message* cmd) { char *it, *tmp; @@ -584,47 +582,6 @@ static int set_credentials(struct hub_info* hub, struct user* user, struct adc_m } -/** - * Determines if a user is to be let into the hub even if the hub is "full". - */ -static int user_is_protected(struct user* user) -{ - switch (user->credentials) - { - case cred_bot: - case cred_operator: - case cred_super: - case cred_admin: - case cred_link: - return 1; - default: - break; - } - return 0; -} - -/** - * Returns 1 if a user is registered. - * Only registered users will be let in if the hub is configured for registered - * users only. - */ -static int user_is_registered(struct user* user) -{ - switch (user->credentials) - { - case cred_bot: - case cred_user: - case cred_operator: - case cred_super: - case cred_admin: - case cred_link: - return 1; - default: - break; - } - return 0; -} - static int check_is_hub_full(struct hub_info* hub, struct user* user) { diff --git a/src/user.c b/src/user.c index ff89bde..f982857 100644 --- a/src/user.c +++ b/src/user.c @@ -299,6 +299,43 @@ int user_is_disconnecting(struct user* user) return 0; } +int user_is_protected(struct user* user) +{ + switch (user->credentials) + { + case cred_bot: + case cred_operator: + case cred_super: + case cred_admin: + case cred_link: + return 1; + default: + break; + } + return 0; +} + +/** + * Returns 1 if a user is registered. + * Only registered users will be let in if the hub is configured for registered + * users only. + */ +int user_is_registered(struct user* user) +{ + switch (user->credentials) + { + case cred_bot: + case cred_user: + case cred_operator: + case cred_super: + case cred_admin: + case cred_link: + return 1; + default: + break; + } + return 0; +} diff --git a/src/user.h b/src/user.h index 3b4933b..1c296fa 100644 --- a/src/user.h +++ b/src/user.h @@ -200,6 +200,17 @@ extern int user_is_connecting(struct user* user); */ extern int user_is_disconnecting(struct user* user); +/** + * Returns 1 if a user is protected, which includes users + * having any form of elevated privileges. + */ +extern int user_is_protected(struct user* user); + +/** + * Returns 1 if a user is registered, with or without privileges. + */ +extern int user_is_registered(struct user* user); + /** * User supports the protocol extension as given in fourcc. * This is usually set while the user is connecting, but can