aboutsummaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-14 20:24:27 -0400
committerTest_User <hax@andrewyu.org>2024-06-14 20:24:27 -0400
commit55c968cbe14ab1867cdd25edca90fcb8553d853a (patch)
tree491eefc2f756bc31e8688bff0dd24aa6de3cd32b /protocols
parente109069edf84f41c17f9c43f9f20b6d4d2725235 (diff)
downloadhaxircd-55c968cbe14ab1867cdd25edca90fcb8553d853a.tar.gz
haxircd-55c968cbe14ab1867cdd25edca90fcb8553d853a.zip
KICK support, more HaxServ stuff
Diffstat (limited to 'protocols')
-rw-r--r--protocols/inspircd2.c17
-rw-r--r--protocols/inspircd2.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/protocols/inspircd2.c b/protocols/inspircd2.c
index e9b304a..5f546c7 100644
--- a/protocols/inspircd2.c
+++ b/protocols/inspircd2.c
@@ -669,6 +669,21 @@ void inspircd2_protocol_propagate_part_channel(struct string from, struct channe
inspircd2_protocol_propagate(from, self, STRING("\n"));
}
+// [:source] KICK <channel> <user> [<reason>]
+void inspircd2_protocol_propagate_kick_channel(struct string from, struct string source, struct channel_info *channel, struct user_info *user, struct string reason) {
+ struct server_info *self = get_table_index(server_list, SID);
+
+ inspircd2_protocol_propagate(from, self, STRING(":"));
+ inspircd2_protocol_propagate(from, self, source);
+ inspircd2_protocol_propagate(from, self, STRING(" KICK "));
+ inspircd2_protocol_propagate(from, self, channel->name);
+ inspircd2_protocol_propagate(from, self, STRING(" "));
+ inspircd2_protocol_propagate(from, self, user->uid);
+ inspircd2_protocol_propagate(from, self, STRING(" :"));
+ inspircd2_protocol_propagate(from, self, reason);
+ inspircd2_protocol_propagate(from, self, STRING("\n"));
+}
+
// [:source] PRIVMSG <target> <message>
void inspircd2_protocol_propagate_privmsg(struct string from, struct string source, struct string target, struct string msg) {
struct user_info *user = get_table_index(user_list, target);
@@ -1415,7 +1430,7 @@ int inspircd2_protocol_handle_part(struct string source, size_t argc, struct str
return 0;
}
-// [:source] KICK <channel> <user> [<reason>?]
+// [:source] KICK <channel> <user> [<reason>]
int inspircd2_protocol_handle_kick(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 KICK recieved! (Missing parameters)\r\n"));
diff --git a/protocols/inspircd2.h b/protocols/inspircd2.h
index bf3da7d..a7ac588 100644
--- a/protocols/inspircd2.h
+++ b/protocols/inspircd2.h
@@ -52,6 +52,7 @@ void inspircd2_protocol_propagate_kill_user(struct string from, struct string so
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);
void inspircd2_protocol_propagate_part_channel(struct string from, struct channel_info *channel, struct user_info *user, struct string reason);
+void inspircd2_protocol_propagate_kick_channel(struct string from, struct string source, struct channel_info *channel, struct user_info *user, struct string reason);
void inspircd2_protocol_propagate_privmsg(struct string from, struct string source, struct string target, struct string msg);
void inspircd2_protocol_propagate_notice(struct string from, struct string source, struct string target, struct string msg);