diff options
author | Test_User <hax@andrewyu.org> | 2024-06-17 22:19:12 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2024-06-17 22:19:12 -0400 |
commit | 27589848053910baa5394f8fdf233a7f9c07c3f8 (patch) | |
tree | 26dccff9bc67c55e8cf2cb2a5615f43db668a501 /protocols/inspircd3.c | |
parent | d3e2530cdaa9fb6ce0af737a7ce181a60f88cc45 (diff) | |
download | haxircd-27589848053910baa5394f8fdf233a7f9c07c3f8.tar.gz haxircd-27589848053910baa5394f8fdf233a7f9c07c3f8.zip |
Deoper support
Diffstat (limited to 'protocols/inspircd3.c')
-rw-r--r-- | protocols/inspircd3.c | 26 |
1 files changed, 17 insertions, 9 deletions
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; } |