From 077bffd74f4e1d8d33ccb75754e62aaa2c677ff9 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Sun, 2 Aug 2009 21:58:12 +0200 Subject: [PATCH] Fix capped whoip/history messages due to limit of 1024 bytes imposed wrongly on outgoing server generated messages. --- src/core/commands.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/commands.c b/src/core/commands.c index 7fd1b8e..9d58b08 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -330,13 +330,13 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub } char tmp[128]; - snprintf(tmp, 128, "Found %d match%s:", (int) ret, ((ret != 1) ? "es" : "")); + snprintf(tmp, 128, "*** %s: Found %d match%s:", cmd->prefix, (int) ret, ((ret != 1) ? "es" : "")); char* buffer = hub_malloc(((MAX_NICK_LEN + INET6_ADDRSTRLEN + 5) * ret) + strlen(tmp) + 3); buffer[0] = 0; strcat(buffer, tmp); strcat(buffer, "\n"); - + u = (struct hub_user*) list_get_first(users); while (u) { @@ -348,9 +348,9 @@ static int command_whoip(struct hub_info* hub, struct hub_user* user, struct hub } strcat(buffer, "\n"); - ret = command_status(hub, user, cmd, buffer); + send_message(hub, user, buffer); hub_free(buffer); - return ret; + return 0; } static int command_broadcast(struct hub_info* hub, struct hub_user* user, struct hub_command* cmd) @@ -376,7 +376,7 @@ static int command_history(struct hub_info* hub, struct hub_user* user, struct h } char tmp[128]; - snprintf(tmp, 128, "Found %d message%s:", (int) ret, ((ret != 1) ? "s" : "")); + snprintf(tmp, 128, "*** %s: Found %d message%s:", cmd->prefix, (int) ret, ((ret != 1) ? "s" : "")); bufsize = strlen(tmp); message = (char*) list_get_first(messages); while (message) @@ -403,9 +403,9 @@ static int command_history(struct hub_info* hub, struct hub_user* user, struct h } strcat(buffer, "\n"); - ret = command_status(hub, user, cmd, buffer); + send_message(hub, user, buffer); hub_free(buffer); - return ret; + return 0; } static int command_log(struct hub_info* hub, struct hub_user* user, struct hub_command* cmd)