diff options
-rw-r--r-- | general_network.c | 20 | ||||
-rw-r--r-- | general_network.h | 4 | ||||
-rw-r--r-- | protocols.c | 14 | ||||
-rw-r--r-- | protocols.h | 12 | ||||
-rw-r--r-- | protocols/inspircd2.c | 163 | ||||
-rw-r--r-- | protocols/inspircd2.h | 9 | ||||
-rw-r--r-- | protocols/inspircd3.c | 26 | ||||
-rw-r--r-- | protocols/inspircd3.h | 6 | ||||
-rw-r--r-- | pseudoclients/haxserv.c | 4 |
9 files changed, 215 insertions, 43 deletions
diff --git a/general_network.c b/general_network.c index 34eb4f2..4436643 100644 --- a/general_network.c +++ b/general_network.c @@ -424,18 +424,21 @@ int kill_user(struct string from, struct string source, struct user_info *user, return 0; } -int oper_user(struct string from, struct user_info *user, struct string type) { +int oper_user(struct string from, struct user_info *user, struct string type, struct string source) { + if (STRING_EQ(user->oper_type, type)) + return 0; + struct string tmp; if (str_clone(&tmp, type) != 0) return 1; #ifdef USE_SERVER - if (protocols_handle_oper_user(from, user, type) != 0) { + if (protocols_handle_oper_user(from, user, type, source) != 0) { free(tmp.data); return 1; } - protocols_propagate_oper_user(from, user, type); + protocols_propagate_oper_user(from, user, type, source); #endif free(user->oper_type.data); @@ -729,3 +732,14 @@ int do_trivial_reloads(void) { #endif return 0; } + +int case_string_eq(struct string x, struct string y) { + if (x.len != y.len) + return 0; + + for (size_t i = 0; i < x.len; i++) + if (CASEMAP(x.data[i]) != CASEMAP(y.data[i])) + return 0; + + return 1; +} diff --git a/general_network.h b/general_network.h index 8bd88f7..7c4a73d 100644 --- a/general_network.h +++ b/general_network.h @@ -130,7 +130,7 @@ int add_user(struct string from, struct string attached_to, struct string uid, s int rename_user(struct string from, struct user_info *user, struct string nick, size_t timestamp); void remove_user(struct string from, struct user_info *user, struct string reason, char propagate); int kill_user(struct string from, struct string source, struct user_info *user, struct string reason); -int oper_user(struct string from, struct user_info *user, struct string type); +int oper_user(struct string from, struct user_info *user, struct string type, struct string source); int set_channel(struct string from, struct string name, size_t timestamp, size_t user_count, struct user_info **users); int join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -142,6 +142,8 @@ int notice(struct string from, struct string sender, struct string target, struc int do_trivial_reloads(void); +extern int case_string_eq(struct string x, struct string y); + extern char casemap[UCHAR_MAX+1]; #define CASEMAP(x) (casemap[(unsigned char)x]) diff --git a/protocols.c b/protocols.c index bca7cc1..1eb1786 100644 --- a/protocols.c +++ b/protocols.c @@ -232,11 +232,11 @@ void protocols_propagate_kill_user(struct string from, struct string source, str } } -void protocols_propagate_oper_user(struct string from, struct user_info *info, struct string type) { +void protocols_propagate_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { for (size_t i = 0; i < NUM_PROTOCOLS; i++) { if (!active_protocols[i]) continue; - protocols[i].propagate_oper_user(from, info, type); + protocols[i].propagate_oper_user(from, info, type, source); } } @@ -378,12 +378,12 @@ void protocols_handle_kill_user(struct string from, struct string source, struct } } -int protocols_handle_oper_user(struct string from, struct user_info *info, struct string type) { +int protocols_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { size_t i; for (i = 0; i < NUM_PROTOCOLS; i++) { if (!active_protocols[i]) continue; - if (protocols[i].handle_oper_user(from, info, type) != 0) + if (protocols[i].handle_oper_user(from, info, type, source) != 0) goto protocols_handle_oper_user_fail; } @@ -394,7 +394,7 @@ int protocols_handle_oper_user(struct string from, struct user_info *info, struc i--; if (!active_protocols[i]) continue; - protocols[i].fail_oper_user(from, info, type); + protocols[i].fail_oper_user(from, info, type, source); } return 1; @@ -484,11 +484,11 @@ void protocols_fail_rename_user(struct string from, struct user_info *info, stru } } -void protocols_fail_oper_user(struct string from, struct user_info *info, struct string type) { +void protocols_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { for (size_t i = 0; i < NUM_PROTOCOLS; i++) { if (!active_protocols[i]) continue; - protocols[i].fail_oper_user(from, info, type); + protocols[i].fail_oper_user(from, info, type, source); } } diff --git a/protocols.h b/protocols.h index 8ecf232..7f84e63 100644 --- a/protocols.h +++ b/protocols.h @@ -50,7 +50,7 @@ struct protocol { void (*propagate_rename_user)(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void (*propagate_remove_user)(struct string from, struct user_info *info, struct string reason); void (*propagate_kill_user)(struct string from, struct string source, struct user_info *info, struct string reason); - void (*propagate_oper_user)(struct string from, struct user_info *info, struct string type); + void (*propagate_oper_user)(struct string from, struct user_info *info, struct string type, struct string reason); void (*propagate_set_channel)(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void (*propagate_join_channel)(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users); @@ -68,7 +68,7 @@ struct protocol { int (*handle_rename_user)(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void (*handle_remove_user)(struct string from, struct user_info *info, struct string reason, char propagate); void (*handle_kill_user)(struct string from, struct string source, struct user_info *info, struct string reason); - int (*handle_oper_user)(struct string from, struct user_info *info, struct string type); + int (*handle_oper_user)(struct string from, struct user_info *info, struct string type, struct string reason); int (*handle_set_channel)(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); int (*handle_join_channel)(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -81,7 +81,7 @@ struct protocol { void (*fail_new_user)(struct string from, struct user_info *info); void (*fail_rename_user)(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); - void (*fail_oper_user)(struct string from, struct user_info *info, struct string type); + void (*fail_oper_user)(struct string from, struct user_info *info, struct string type, struct string source); void (*fail_set_channel)(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void (*fail_join_channel)(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -101,7 +101,7 @@ void protocols_propagate_new_user(struct string from, struct user_info *info); void protocols_propagate_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void protocols_propagate_remove_user(struct string from, struct user_info *info, struct string reason); void protocols_propagate_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -void protocols_propagate_oper_user(struct string from, struct user_info *info, struct string type); +void protocols_propagate_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void protocols_propagate_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void protocols_propagate_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -118,7 +118,7 @@ int protocols_handle_new_user(struct string from, struct user_info *info); int protocols_handle_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void protocols_handle_remove_user(struct string from, struct user_info *info, struct string reason, char propagate); void protocols_handle_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -int protocols_handle_oper_user(struct string from, struct user_info *info, struct string type); +int protocols_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source); int protocols_handle_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); int protocols_handle_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -129,7 +129,7 @@ void protocols_fail_new_server(struct string from, struct string attached_to, st void protocols_fail_new_user(struct string from, struct user_info *info); void protocols_fail_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); -void protocols_fail_oper_user(struct string from, struct user_info *info, struct string type); +void protocols_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void protocols_fail_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void protocols_fail_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); diff --git a/protocols/inspircd2.c b/protocols/inspircd2.c index 186848d..8111742 100644 --- a/protocols/inspircd2.c +++ b/protocols/inspircd2.c @@ -147,6 +147,9 @@ int init_inspircd2_protocol(void) { set_table_index(&inspircd2_protocol_commands, STRING("PRIVMSG"), &inspircd2_protocol_handle_privmsg); set_table_index(&inspircd2_protocol_commands, STRING("NOTICE"), &inspircd2_protocol_handle_notice); + set_table_index(&inspircd2_protocol_commands, STRING("MODE"), &inspircd2_protocol_handle_mode); + set_table_index(&inspircd2_protocol_commands, STRING("FMODE"), &inspircd2_protocol_handle_fmode); + set_table_index(&inspircd2_protocol_commands, STRING("DUMP"), &inspircd2_protocol_handle_dump); return 0; @@ -636,12 +639,20 @@ void inspircd2_protocol_propagate_kill_user(struct string from, struct string so } // :source OPERTYPE <type> -void inspircd2_protocol_propagate_oper_user(struct string from, struct user_info *user, struct string type) { - inspircd2_protocol_propagate(from, STRING(":")); - inspircd2_protocol_propagate(from, user->uid); - inspircd2_protocol_propagate(from, STRING(" OPERTYPE :")); - inspircd2_protocol_propagate(from, type); - inspircd2_protocol_propagate(from, STRING("\n")); +void inspircd2_protocol_propagate_oper_user(struct string from, struct user_info *user, struct string type, struct string source) { + if (type.len == 0) { + inspircd2_protocol_propagate(from, STRING(":")); + inspircd2_protocol_propagate(from, source); + inspircd2_protocol_propagate(from, STRING(" MODE ")); + inspircd2_protocol_propagate(from, user->uid); + inspircd2_protocol_propagate(from, STRING(" -o\n")); + } else { + inspircd2_protocol_propagate(from, STRING(":")); + inspircd2_protocol_propagate(from, user->uid); + inspircd2_protocol_propagate(from, STRING(" OPERTYPE :")); + inspircd2_protocol_propagate(from, type); + inspircd2_protocol_propagate(from, STRING("\n")); + } } // [:source] FJOIN <channel> <timestamp> <modes> [<mode args>] <userlist: modes,uid [...]> @@ -804,7 +815,7 @@ void inspircd2_protocol_handle_kill_user(struct string from, struct string sourc return; } -int inspircd2_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type) { +int inspircd2_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { return 0; } @@ -836,7 +847,7 @@ void inspircd2_protocol_fail_rename_user(struct string from, struct user_info *i return; } -void inspircd2_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type) { +void inspircd2_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { return; } @@ -1405,7 +1416,7 @@ int inspircd2_protocol_handle_opertype(struct string source, size_t argc, struct if (!user) return 0; - if (oper_user(config->sid, user, argv[0]) != 0) { + if (oper_user(config->sid, user, argv[0], config->sid) != 0) { WRITES(2, STRING("[InspIRCd v2] ERROR: Unable to set oper type!\r\n")); return -1; } @@ -1614,6 +1625,140 @@ int inspircd2_protocol_handle_notice(struct string source, size_t argc, struct s return 0; } +// :source MODE <target> <modes> [<mode args>] +int inspircd2_protocol_handle_mode(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming) { + if (argc < 2) { + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received! (Missing parameters)\r\n")); + return -1; + } + + struct user_info *user = get_table_index(user_list, argv[0]); + if (!user) { + if (has_table_index(server_list, argv[0])) + return 0; // TODO: Probably not actually valid + + char found = 0; + for (size_t i = 0; i < user_list.len; i++) { + user = user_list.array[i].ptr; + if (case_string_eq(user->nick, argv[0])) { + found = 1; + break; + } + } + + if (!found) + return 0; + } + + if (user) { + size_t arg_i = 2; + char dir = '?'; + for (size_t i = 0; i < argv[1].len; i++) { + switch(argv[1].data[i]) { + case '+': + case '-': + dir = argv[1].data[i]; + break; + default: + if (dir == '?') { + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received (Mode direction not set)\r\n")); + return -1; + } + switch(inspircd2_protocol_user_mode_types[(unsigned char)argv[1].data[i]]) { + case MODE_TYPE_NOARGS: + if (dir == '-' && argv[1].data[i] == 'o') { + if (oper_user(config->sid, user, STRING(""), source) != 0) + return -1; + } + break; + case MODE_TYPE_REPLACE: + case MODE_TYPE_MODE: + if (dir == '-') + break; + case MODE_TYPE_MULTIPLE: + arg_i++; + break; + case MODE_TYPE_USERS: + arg_i++; + break; + default: + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received! (Unknown mode given)\r\n")); + return -1; + } + } + } + } + + return 0; +} + +// :source FMODE <target> <timestamp> <modes> [<mode args>] +int inspircd2_protocol_handle_fmode(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming) { + if (argc < 3) { + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received! (Missing parameters)\r\n")); + return -1; + } + + struct user_info *user = get_table_index(user_list, argv[0]); + if (!user) { + if (has_table_index(server_list, argv[0])) + return 0; // TODO: Probably not actually valid + + char found = 0; + for (size_t i = 0; i < user_list.len; i++) { + user = user_list.array[i].ptr; + if (case_string_eq(user->nick, argv[0])) { + found = 1; + break; + } + } + + if (!found) + return 0; + } + + if (user) { + size_t arg_i = 3; + char dir = '?'; + for (size_t i = 0; i < argv[2].len; i++) { + switch(argv[2].data[i]) { + case '+': + case '-': + dir = argv[2].data[i]; + break; + default: + if (dir == '?') { + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received (Mode direction not set)\r\n")); + return -1; + } + switch(inspircd2_protocol_user_mode_types[(unsigned char)argv[2].data[i]]) { + case MODE_TYPE_NOARGS: + if (dir == '-' && argv[2].data[i] == 'o') { + if (oper_user(config->sid, user, STRING(""), source) != 0) + return -1; + } + break; + case MODE_TYPE_REPLACE: + case MODE_TYPE_MODE: + if (dir == '-') + break; + case MODE_TYPE_MULTIPLE: + arg_i++; + break; + case MODE_TYPE_USERS: + arg_i++; + break; + default: + WRITES(2, STRING("[InspIRCd v2] Invalid MODE received! (Unknown mode given)\r\n")); + return -1; + } + } + } + } + + return 0; +} + int inspircd2_protocol_handle_dump(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming) { for (size_t arg = 0; arg < argc; arg++) { if (STRING_EQ(argv[arg], STRING("LATENCIES"))) { diff --git a/protocols/inspircd2.h b/protocols/inspircd2.h index ef13fa8..dc8ff32 100644 --- a/protocols/inspircd2.h +++ b/protocols/inspircd2.h @@ -52,7 +52,7 @@ void inspircd2_protocol_propagate_new_user(struct string from, struct user_info void inspircd2_protocol_propagate_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void inspircd2_protocol_propagate_remove_user(struct string from, struct user_info *info, struct string reason); void inspircd2_protocol_propagate_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -void inspircd2_protocol_propagate_oper_user(struct string from, struct user_info *info, struct string type); +void inspircd2_protocol_propagate_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void inspircd2_protocol_propagate_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void inspircd2_protocol_propagate_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users); @@ -69,7 +69,7 @@ int inspircd2_protocol_handle_new_user(struct string from, struct user_info *inf int inspircd2_protocol_handle_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void inspircd2_protocol_handle_remove_user(struct string from, struct user_info *info, struct string reason, char propagate); void inspircd2_protocol_handle_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -int inspircd2_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type); +int inspircd2_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source); int inspircd2_protocol_handle_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); int inspircd2_protocol_handle_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -80,7 +80,7 @@ void inspircd2_protocol_fail_new_server(struct string from, struct string attach void inspircd2_protocol_fail_new_user(struct string from, struct user_info *info); void inspircd2_protocol_fail_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); -void inspircd2_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type); +void inspircd2_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void inspircd2_protocol_fail_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void inspircd2_protocol_fail_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -114,6 +114,9 @@ int inspircd2_protocol_handle_kick(struct string source, size_t argc, struct str int inspircd2_protocol_handle_privmsg(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming); int inspircd2_protocol_handle_notice(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming); +int inspircd2_protocol_handle_mode(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming); +int inspircd2_protocol_handle_fmode(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming); + int inspircd2_protocol_handle_dump(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config *config, char is_incoming); extern char inspircd2_protocol_user_mode_types[UCHAR_MAX+1]; diff --git a/protocols/inspircd3.c b/protocols/inspircd3.c index 3b0219d..3c74a79 100644 --- a/protocols/inspircd3.c +++ b/protocols/inspircd3.c @@ -646,12 +646,20 @@ void inspircd3_protocol_propagate_kill_user(struct string from, struct string so } // :source OPERTYPE <type> -void inspircd3_protocol_propagate_oper_user(struct string from, struct user_info *user, struct string type) { - inspircd3_protocol_propagate(from, STRING(":")); - inspircd3_protocol_propagate(from, user->uid); - inspircd3_protocol_propagate(from, STRING(" OPERTYPE :")); - inspircd3_protocol_propagate(from, type); - inspircd3_protocol_propagate(from, STRING("\n")); +void inspircd3_protocol_propagate_oper_user(struct string from, struct user_info *user, struct string type, struct string source) { + if (type.len == 0) { + inspircd3_protocol_propagate(from, STRING(":")); + inspircd3_protocol_propagate(from, source); + inspircd3_protocol_propagate(from, STRING(" MODE ")); + inspircd3_protocol_propagate(from, user->uid); + inspircd3_protocol_propagate(from, STRING(" -o\n")); + } else { + inspircd3_protocol_propagate(from, STRING(":")); + inspircd3_protocol_propagate(from, user->uid); + inspircd3_protocol_propagate(from, STRING(" OPERTYPE :")); + inspircd3_protocol_propagate(from, type); + inspircd3_protocol_propagate(from, STRING("\n")); + } } // [:source] FJOIN <channel> <timestamp> <modes> [<mode args>] <userlist: modes,uid [...]> @@ -823,7 +831,7 @@ void inspircd3_protocol_handle_kill_user(struct string from, struct string sourc return; } -int inspircd3_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type) { +int inspircd3_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { return 0; } @@ -859,7 +867,7 @@ void inspircd3_protocol_fail_rename_user(struct string from, struct user_info *i return; } -void inspircd3_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type) { +void inspircd3_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source) { return; } @@ -1424,7 +1432,7 @@ int inspircd3_protocol_handle_opertype(struct string source, size_t argc, struct if (!user) return 0; - if (oper_user(config->sid, user, argv[0]) != 0) { + if (oper_user(config->sid, user, argv[0], config->sid) != 0) { WRITES(2, STRING("[InspIRCd v3] ERROR: Unable to set oper type!\r\n")); return -1; } diff --git a/protocols/inspircd3.h b/protocols/inspircd3.h index e5a45ba..f0dcf8c 100644 --- a/protocols/inspircd3.h +++ b/protocols/inspircd3.h @@ -56,7 +56,7 @@ void inspircd3_protocol_propagate_new_user(struct string from, struct user_info void inspircd3_protocol_propagate_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void inspircd3_protocol_propagate_remove_user(struct string from, struct user_info *info, struct string reason); void inspircd3_protocol_propagate_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -void inspircd3_protocol_propagate_oper_user(struct string from, struct user_info *info, struct string type); +void inspircd3_protocol_propagate_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void inspircd3_protocol_propagate_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void inspircd3_protocol_propagate_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users); @@ -73,7 +73,7 @@ int inspircd3_protocol_handle_new_user(struct string from, struct user_info *inf int inspircd3_protocol_handle_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); void inspircd3_protocol_handle_remove_user(struct string from, struct user_info *info, struct string reason, char propagate); void inspircd3_protocol_handle_kill_user(struct string from, struct string source, struct user_info *info, struct string reason); -int inspircd3_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type); +int inspircd3_protocol_handle_oper_user(struct string from, struct user_info *info, struct string type, struct string source); int inspircd3_protocol_handle_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); int inspircd3_protocol_handle_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); @@ -84,7 +84,7 @@ void inspircd3_protocol_fail_new_server(struct string from, struct string attach void inspircd3_protocol_fail_new_user(struct string from, struct user_info *info); void inspircd3_protocol_fail_rename_user(struct string from, struct user_info *info, struct string nick, size_t timestamp, struct string timestamp_str); -void inspircd3_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type); +void inspircd3_protocol_fail_oper_user(struct string from, struct user_info *info, struct string type, struct string source); void inspircd3_protocol_fail_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users); void inspircd3_protocol_fail_join_channel(struct string from, struct channel_info *channel, size_t user_count, struct user_info **users, char propagate); diff --git a/pseudoclients/haxserv.c b/pseudoclients/haxserv.c index 6c97067..32d40df 100644 --- a/pseudoclients/haxserv.c +++ b/pseudoclients/haxserv.c @@ -612,7 +612,7 @@ int haxserv_pseudoclient_allow_command(struct string from, struct string sender, return 0; } - oper_user(SID, user, HAXSERV_REQUIRED_OPER_TYPE); + oper_user(SID, user, HAXSERV_REQUIRED_OPER_TYPE, HAXSERV_UID); return 0; } @@ -643,7 +643,7 @@ int haxserv_pseudoclient_deny_command(struct string from, struct string sender, return 0; } - oper_user(SID, user, STRING("")); + oper_user(SID, user, STRING(""), HAXSERV_UID); return 0; } |