summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-08-09 23:32:29 -0400
committerTest_User <hax@andrewyu.org>2023-08-09 23:32:29 -0400
commitbe4a88382717cb297d7aefadedb32d5f9c41ffb1 (patch)
treef6c2447e15e6556d7ded946bae7e2b9455ca9ea2
parent0a4de3b7f0159fc44f87996e1d25678e3b456878 (diff)
downloadcoupserv-be4a88382717cb297d7aefadedb32d5f9c41ffb1.tar.gz
coupserv-be4a88382717cb297d7aefadedb32d5f9c41ffb1.zip
s/PRIVMSG/privmsg/ for the function, fix privmsg a bit
-rw-r--r--commands.c2
-rw-r--r--general_network.c6
-rw-r--r--network.h2
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);