hirc

IRC client
Log | Files | Refs

commit 732738f4ae42057d98c34ed1e65718994f7e8d41
parent cedc0f173bb1325d5278d989c2fe7c8e31c544ef
Author: hhvn <dev@hhvn.uk>
Date:   Sun, 24 Oct 2021 12:18:08 +0100

hist.c handle.c hirc.h: remove useless debug stuff now that the ui exists

Diffstat:
Mhandle.c | 39++-------------------------------------
Mhirc.h | 2--
Mhist.c | 24------------------------
3 files changed, 2 insertions(+), 63 deletions(-)

diff --git a/handle.c b/handle.c @@ -30,34 +30,6 @@ handle_PING(char *msg, char **params, struct Server *server, time_t timestamp) { } void -chan_printlist(struct Server *server) { - struct Channel *channel; - struct Nick *nick; - - printf("---\n"); - for (channel = server->channels; channel; channel = channel->next) { - if (chan_isold(channel)) - printf("%s (old)", channel->name); - else - printf("%s: ", channel->name); - for (nick = channel->nicks; nick; nick = nick->next) { - if (nick_isself(nick)) - printf("%c%s(me) ", nick->priv, nick->nick); - else - printf("%c%s ", nick->priv, nick->nick); - } - printf("\n"); - } - for (channel = server->privs; channel; channel = channel->next) { - if (chan_isold(channel)) - printf("%s (old\n)", channel->name); - else - printf("%s\n", channel->name); - } - printf("---\n"); -} - -void handle_JOIN(char *msg, char **params, struct Server *server, time_t timestamp) { struct Channel *chan; struct Nick *nick; @@ -79,7 +51,8 @@ handle_JOIN(char *msg, char **params, struct Server *server, time_t timestamp) { hist_add(server, chan->history, nick, msg, params, Activity_status, timestamp, HIST_SHOW); nick_free(nick); - chan_printlist(server); + selected_server = server; + selected_channel = chan; } void @@ -106,8 +79,6 @@ handle_PART(char *msg, char **params, struct Server *server, time_t timestamp) { hist_add(server, server->history, nick, msg, params, Activity_status, timestamp, HIST_LOG); hist_add(server, chan->history, nick, msg, params, Activity_status, timestamp, HIST_SHOW); nick_free(nick); - - chan_printlist(server); } void @@ -133,8 +104,6 @@ handle_QUIT(char *msg, char **params, struct Server *server, time_t timestamp) { } nick_free(nick); - - chan_printlist(server); } void @@ -179,8 +148,6 @@ handle_PRIVMSG(char *msg, char **params, struct Server *server, time_t timestamp } nick_free(nick); - chan_printlist(server); - hist_print_server(server); } void @@ -248,8 +215,6 @@ handle_NAMREPLY(char *msg, char **params, struct Server *server, time_t timestam } param_free(nicksref); - - chan_printlist(server); } void diff --git a/hirc.h b/hirc.h @@ -54,8 +54,6 @@ struct History *hist_add(struct Server *server, struct HistInfo *histinfo, struct History *hist_format(struct Server *server, struct HistInfo *history, enum Activity activity, enum HistOpt options, char *format, ...); int hist_len(struct History **history); -void hist_print(struct HistInfo *histinfo, char *prefix); /* debug */ -void hist_print_server(struct Server *server); /* debug */ int hist_log(char *msg, struct Nick *from, time_t timestamp, struct Server *server); /* serv.c */ diff --git a/hist.c b/hist.c @@ -170,27 +170,3 @@ hist_len(struct History **history) { i++; return i; } - -void -hist_print(struct HistInfo *histinfo, char *prefix) { /* debug */ - struct History *p; - - for (p = histinfo->history; p; p = p->next) - printf("%s: %s\n", prefix, p->raw); -} - -void -hist_print_server(struct Server *server) { /* debug */ - struct Channel *channel; - char prefix[1024]; - - hist_print(server->history, server->name); - for (channel = server->channels; channel; channel = channel->next) { - snprintf(prefix, sizeof(prefix), "%s on %s", channel->name, server->name); - hist_print(channel->history, prefix); - } - for (channel = server->privs; channel; channel = channel->next) { - snprintf(prefix, sizeof(prefix), "query with %s on %s", channel->name, server->name); - hist_print(channel->history, prefix); - } -}