summaryrefslogtreecommitdiff
path: root/client_network.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-03-19 07:42:33 -0400
committerTest_User <hax@andrewyu.org>2024-03-19 07:42:33 -0400
commit44831804778fc0da07cb918dccc9474174d1304a (patch)
tree5aa6de2ba6fb057667f982099738e092670433f1 /client_network.c
parent659f0d647ca27d03815e799f74e1023fa5f3bc25 (diff)
downloadcoupserv-44831804778fc0da07cb918dccc9474174d1304a.tar.gz
coupserv-44831804778fc0da07cb918dccc9474174d1304a.zip
make local_only work properly, ensure +k doesn't cause squits
Diffstat (limited to 'client_network.c')
-rw-r--r--client_network.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/client_network.c b/client_network.c
index f786ac6..90a406a 100644
--- a/client_network.c
+++ b/client_network.c
@@ -134,6 +134,8 @@ int add_local_client(struct string uid, struct string nick_arg, struct string vh
set_table_index(&user_list, uid, user);
+ SEND(STRING("GLOADMODULE m_servprotect\n")); // required for the +k we're about to use
+
char string_time[21];
snprintf(string_time, 21, "%ld", timestamp);
SEND(STRING("UID "));
@@ -462,23 +464,17 @@ int client_privmsg_handler(uint64_t argc, struct string *argv) {
argv[1].len -= old_offset;
struct command_def *cmd = get_table_index(user_commands, command_argv[0]);
if (cmd) {
- if (!cmd->local_only) {
- struct string message[] = {
- STRING("Local user "),
- client_nick,
- STRING(" executes `"),
- argv[1],
- STRING("'\n"),
- };
+ struct string message[] = {
+ STRING("Local user "),
+ client_nick,
+ STRING(" executes `"),
+ argv[1],
+ STRING("'\n"),
+ };
- privmsg(STRING("1HC000000"), log_channel, sizeof(message)/sizeof(*message), message);
+ privmsg(STRING("1HC000000"), log_channel, sizeof(message)/sizeof(*message), message);
- return cmd->func(STRING("1HC000001"), argv[1], argv[0], command_argc, command_argv, 1);
- } else {
- // TODO: complain about remote access
- WRITES(1, STRING("Not executing local-only command from a remote source!\n"));
- return 0;
- }
+ return cmd->func(STRING("1HC000001"), argv[1], argv[0], command_argc, command_argv, 1);
} else {
if (argv[0].data[0] == '#') {
SEND(STRING(":1HC000000 NOTICE "));