From be4a88382717cb297d7aefadedb32d5f9c41ffb1 Mon Sep 17 00:00:00 2001 From: Test_User Date: Wed, 9 Aug 2023 23:32:29 -0400 Subject: s/PRIVMSG/privmsg/ for the function, fix privmsg a bit --- commands.c | 2 +- general_network.c | 6 +++--- network.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.c b/commands.c index d8eeab3..e7ba6cb 100644 --- a/commands.c +++ b/commands.c @@ -59,7 +59,7 @@ int help_command(struct string sender, struct string original_message, struct st offset += 2; memcpy(&(message.data[offset]), def->summary.data, def->summary.len); - PRIVMSG(STRING("1HC000000"), to, message); + privmsg(STRING("1HC000000"), to, message); } return 0; diff --git a/general_network.c b/general_network.c index 475591a..01384ca 100644 --- a/general_network.c +++ b/general_network.c @@ -82,7 +82,7 @@ char channel_mode_types[UCHAR_MAX] = { ['X'] = MODE_TYPE_MULTIPLE, }; -int PRIVMSG(struct string source, struct string target, struct string message) { +int privmsg(struct string source, struct string target, struct string message) { if (!(target.len == 9 && memcmp(target.data, "1HC000001", 9) == 0)) { // if not sending to our one local user if (source.len != 0) { SEND(STRING(":")); @@ -120,9 +120,9 @@ int PRIVMSG(struct string source, struct string target, struct string message) { SENDCLIENT(STRING("@")); SENDCLIENT(hostmask); } else if (source.len == 3 && memcmp(source.data, "1HC", 3) == 0) { - SENDCLIENT(STRING(":")); SENDCLIENT(server_name); - SENDCLIENT(STRING(" ")); + } else { + SENDCLIENT(source); } SENDCLIENT(STRING(" PRIVMSG ")); } else { diff --git a/network.h b/network.h index e08a289..124b21d 100644 --- a/network.h +++ b/network.h @@ -108,6 +108,6 @@ extern char channel_mode_types[UCHAR_MAX]; #define SENDCLIENT(x) write(client_fd, x.data, x.len) -extern int PRIVMSG(struct string source, struct string target, struct string message); +extern int privmsg(struct string source, struct string target, struct string message); extern int add_local_client(struct string uid, struct string nick_arg, struct string vhost_arg, struct string ident_arg, struct string realname_arg, time_t timestamp); extern int remove_user(struct string uid, struct string reason); -- cgit v1.2.3