From a4ebfc3d40aca5808958174ebd287b0d02f35319 Mon Sep 17 00:00:00 2001 From: Thomas Sader Date: Sat, 29 Jun 2024 17:46:28 +0200 Subject: [PATCH] Cleanup --- src/mod/irc.mod/chan.c | 3 +-- src/mod/module.h | 2 +- src/mod/server.mod/servmsg.c | 2 -- src/userrec.c | 2 +- src/users.h | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/mod/irc.mod/chan.c b/src/mod/irc.mod/chan.c index 16883a0ba..9124d428c 100644 --- a/src/mod/irc.mod/chan.c +++ b/src/mod/irc.mod/chan.c @@ -2683,7 +2683,6 @@ static int gotnotice(char *from, char *msg) char *ctcp, *code; struct userrec *u; struct chanset_t *chan; - memberlist *m; int ignoring; if (!strchr(CHANMETA "@", *msg)) @@ -2697,7 +2696,7 @@ static int gotnotice(char *from, char *msg) fixcolon(msg); strlcpy(uhost, from, sizeof buf); nick = splitnick(&uhost); - u = lookup_user_record(get_all_chan_records(m), NULL, from); // TODO: get account from msgtags + u = lookup_user_record(find_member_from_nick(nick), NULL, from); // TODO: get account from msgtags /* Check for CTCP: */ p = strchr(msg, 1); while (p && *p) { diff --git a/src/mod/module.h b/src/mod/module.h index 63075575a..488664322 100644 --- a/src/mod/module.h +++ b/src/mod/module.h @@ -524,7 +524,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr #define bind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[320]) #define unbind_bind_entry ((int(*)(tcl_bind_list_t *, const char *, const char *, const char *))global[321]) #define argv0 ((char *)global[322]) -#define lookup_user_record ((struct userrec * (*)(memberlist *, const char *, const char *))global[323]) +#define lookup_user_record ((struct userrec * (*)(memberlist *, char *, char *))global[323]) /* 324 - 327 */ #define find_member_from_nick ((memberlist * (*) (char *))global[324]) diff --git a/src/mod/server.mod/servmsg.c b/src/mod/server.mod/servmsg.c index 07b3daf01..91a50e2e9 100644 --- a/src/mod/server.mod/servmsg.c +++ b/src/mod/server.mod/servmsg.c @@ -559,7 +559,6 @@ static int gotmsg(char *from, char *msg) char *to, buf[UHOSTLEN], *nick, ctcpbuf[512], *uhost = buf, *ctcp, *p, *p1, *code; struct userrec *u; - memberlist *m = NULL; int ctcp_count = 0; int ignoring; @@ -695,7 +694,6 @@ static int gotnotice(char *from, char *msg) { char *to, *nick, ctcpbuf[512], *p, *p1, buf[512], *uhost = buf, *ctcp; struct userrec *u; - memberlist *m; int ignoring; /* Notice to a channel, not handled here */ diff --git a/src/userrec.c b/src/userrec.c index 8e4132246..66bb8f16c 100644 --- a/src/userrec.c +++ b/src/userrec.c @@ -283,7 +283,7 @@ struct userrec *get_user_from_member(memberlist *m) * 'm->account' for the account, use the independent source variable 'account' * if available. This allows redundant checking in case of unexpected NULLs */ -struct userrec *lookup_user_record(memberlist *m, const char *host, const char *account) +struct userrec *lookup_user_record(memberlist *m, char *host, char *account) { struct userrec *u = NULL; diff --git a/src/users.h b/src/users.h index 79b2e930f..6bc27c1ce 100644 --- a/src/users.h +++ b/src/users.h @@ -185,7 +185,7 @@ struct userrec *get_user_by_host(char *); struct userrec *get_user_by_account(char *); struct userrec *get_user_by_nick(char *); struct userrec *get_user_from_member(memberlist *); -struct userrec *lookup_user_record(memberlist *, const char *, const char *); +struct userrec *lookup_user_record(memberlist *, char *, char *); struct userrec *check_chanlist(const char *); memberlist *find_member_from_nick(char *);