aboutsummaryrefslogtreecommitdiff
path: root/protocols.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-24 11:08:29 -0400
committerTest_User <hax@andrewyu.org>2024-06-24 11:08:50 -0400
commitd095efe06273ec29bdc07c2cc522d6fe5a793550 (patch)
tree0eab2d9999ae71d5cff1ae682b54d17ad8aa98b5 /protocols.c
parent7b3767d3988c3bb9c96f049ca8e5a829917c8426 (diff)
downloadhaxircd-d095efe06273ec29bdc07c2cc522d6fe5a793550.tar.gz
haxircd-d095efe06273ec29bdc07c2cc522d6fe5a793550.zip
The start of some services, inspircd3 support extra broken for now
Diffstat (limited to 'protocols.c')
-rw-r--r--protocols.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/protocols.c b/protocols.c
index 1eb1786..d27386a 100644
--- a/protocols.c
+++ b/protocols.c
@@ -56,6 +56,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.propagate_kill_user = inspircd2_protocol_propagate_kill_user,
.propagate_oper_user = inspircd2_protocol_propagate_oper_user,
+ .propagate_set_account = inspircd2_protocol_propagate_set_account,
+
.propagate_set_channel = inspircd2_protocol_propagate_set_channel,
.propagate_join_channel = inspircd2_protocol_propagate_join_channel,
.propagate_part_channel = inspircd2_protocol_propagate_part_channel,
@@ -73,6 +75,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.handle_kill_user = inspircd2_protocol_handle_kill_user,
.handle_oper_user = inspircd2_protocol_handle_oper_user,
+ .handle_set_account = inspircd2_protocol_handle_set_account,
+
.handle_set_channel = inspircd2_protocol_handle_set_channel,
.handle_join_channel = inspircd2_protocol_handle_join_channel,
.handle_part_channel = inspircd2_protocol_handle_part_channel,
@@ -84,6 +88,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.fail_rename_user = inspircd2_protocol_fail_rename_user,
.fail_oper_user = inspircd2_protocol_fail_oper_user,
+ .fail_set_account = inspircd2_protocol_fail_set_account,
+
.fail_set_channel = inspircd2_protocol_fail_set_channel,
.fail_join_channel = inspircd2_protocol_fail_join_channel,
@@ -110,6 +116,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.propagate_kill_user = inspircd3_protocol_propagate_kill_user,
.propagate_oper_user = inspircd3_protocol_propagate_oper_user,
+ .propagate_set_account = inspircd3_protocol_propagate_set_account,
+
.propagate_set_channel = inspircd3_protocol_propagate_set_channel,
.propagate_join_channel = inspircd3_protocol_propagate_join_channel,
.propagate_part_channel = inspircd3_protocol_propagate_part_channel,
@@ -127,6 +135,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.handle_kill_user = inspircd3_protocol_handle_kill_user,
.handle_oper_user = inspircd3_protocol_handle_oper_user,
+ .handle_set_account = inspircd3_protocol_handle_set_account,
+
.handle_set_channel = inspircd3_protocol_handle_set_channel,
.handle_join_channel = inspircd3_protocol_handle_join_channel,
.handle_part_channel = inspircd3_protocol_handle_part_channel,
@@ -138,6 +148,8 @@ struct protocol protocols[NUM_PROTOCOLS] = {
.fail_rename_user = inspircd3_protocol_fail_rename_user,
.fail_oper_user = inspircd3_protocol_fail_oper_user,
+ .fail_set_account = inspircd3_protocol_fail_set_account,
+
.fail_set_channel = inspircd3_protocol_fail_set_channel,
.fail_join_channel = inspircd3_protocol_fail_join_channel,
@@ -240,6 +252,14 @@ void protocols_propagate_oper_user(struct string from, struct user_info *info, s
}
}
+void protocols_propagate_set_account(struct string from, struct user_info *info, struct string account, struct string source) {
+ for (size_t i = 0; i < NUM_PROTOCOLS; i++) {
+ if (!active_protocols[i])
+ continue;
+ protocols[i].propagate_set_account(from, info, account, 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) {
for (size_t i = 0; i < NUM_PROTOCOLS; i++) {
if (!active_protocols[i])
@@ -400,6 +420,28 @@ int protocols_handle_oper_user(struct string from, struct user_info *info, struc
return 1;
}
+int protocols_handle_set_account(struct string from, struct user_info *info, struct string account, struct string source) {
+ size_t i;
+ for (i = 0; i < NUM_PROTOCOLS; i++) {
+ if (!active_protocols[i])
+ continue;
+ if (protocols[i].handle_set_account(from, info, account, source) != 0)
+ goto protocols_handle_set_account_fail;
+ }
+
+ return 0;
+
+ protocols_handle_set_account_fail:
+ while (i > 0) {
+ i--;
+ if (!active_protocols[i])
+ continue;
+ protocols[i].fail_set_account(from, info, account, source);
+ }
+
+ return 1;
+}
+
int protocols_handle_set_channel(struct string from, struct channel_info *channel, char is_new_channel, size_t user_count, struct user_info **users) {
size_t i;
for (i = 0; i < NUM_PROTOCOLS; i++) {
@@ -492,6 +534,14 @@ void protocols_fail_oper_user(struct string from, struct user_info *info, struct
}
}
+void protocols_fail_set_account(struct string from, struct user_info *info, struct string account, struct string source) {
+ for (size_t i = 0; i < NUM_PROTOCOLS; i++) {
+ if (!active_protocols[i])
+ continue;
+ protocols[i].fail_set_account(from, info, account, 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) {
for (size_t i = 0; i < NUM_PROTOCOLS; i++) {
if (!active_protocols[i])