From 52c8ef381579532468f7da2fcfa8a7fb44144095 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sat, 26 Oct 2019 11:42:05 +0200 Subject: [PATCH] get_sno_str -> get_snomask_string, get_mode_str -> get_usermode_string, get_snostr -> get_snomask_string_raw, get_modestr -> get_usermode_string_raw --- include/h.h | 6 +++--- include/proto.h | 2 +- src/api-usermode.c | 4 ++-- src/modules/mode.c | 6 +++--- src/modules/nick.c | 2 +- src/modules/oper.c | 6 +++--- src/modules/stats.c | 4 ++-- src/modules/svssno.c | 2 +- src/modules/whois.c | 4 ++-- src/modules/whox.c | 2 +- src/user.c | 8 ++++---- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/h.h b/include/h.h index d761ed247..6eb8dcd45 100644 --- a/include/h.h +++ b/include/h.h @@ -99,7 +99,7 @@ extern EVENT(e_clean_out_throttling_buckets); extern void module_loadall(void); extern long set_usermode(char *umode); -extern char *get_modestr(long umodes); +extern char *get_usermode_string_raw(long umodes); extern void config_error(FORMAT_STRING(const char *format), ...) __attribute__((format(printf,1,2))); extern void config_warn(FORMAT_STRING(const char *format), ...) __attribute__((format(printf,1,2))); extern void config_error_missing(const char *filename, int line, const char *entry); @@ -168,7 +168,7 @@ extern void add_server_to_table(Client *); extern void remove_server_from_table(Client *); extern void iNAH_host(Client *client, char *host); extern void set_snomask(Client *client, char *snomask); -extern char *get_sno_str(Client *client); +extern char *get_snomask_string(Client *client); extern int check_tkls(Client *cptr); /* for services */ extern void del_invite(Client *, Channel *); @@ -571,7 +571,7 @@ extern void extcmode_free_paramlist(void **ar); extern void chmode_str(struct ChMode *, char *, char *, size_t, size_t); extern char *get_client_status(Client *); -extern char *get_snostr(long); +extern char *get_snomask_string_raw(long); extern void SocketLoop(void *); #ifdef _WIN32 extern void InitDebug(void); diff --git a/include/proto.h b/include/proto.h index 5ab30f227..037d6e697 100644 --- a/include/proto.h +++ b/include/proto.h @@ -53,7 +53,7 @@ extern void read_motd(const char *filename, MOTDFile *motd); /* s_user.c */ extern int target_limit_exceeded(Client *client, void *target, const char *name); extern void make_umodestr(void); -extern char *get_mode_str(Client *acptr); +extern char *get_usermode_string(Client *acptr); /* s_misc.c */ extern char *convert_time(time_t ltime); diff --git a/src/api-usermode.c b/src/api-usermode.c index 1ab6d6ea9..1fb3da892 100644 --- a/src/api-usermode.c +++ b/src/api-usermode.c @@ -330,7 +330,7 @@ void SnomaskDel(Snomask *sno) oldsno = client->user->snomask; client->user->snomask &= ~sno->mode; if (oldsno != client->user->snomask) - sendnumeric(client, RPL_SNOMASK, get_snostr(client->user->snomask)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string_raw(client->user->snomask)); } sno->flag = '\0'; @@ -439,7 +439,7 @@ void unload_all_unused_snomasks(void) oldsno = client->user->snomask; client->user->snomask &= ~(removed_sno); if (oldsno != client->user->snomask) - sendnumeric(client, RPL_SNOMASK, get_snostr(client->user->snomask)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string_raw(client->user->snomask)); } } diff --git a/src/modules/mode.c b/src/modules/mode.c index d365d3f29..f2a752309 100644 --- a/src/modules/mode.c +++ b/src/modules/mode.c @@ -1605,9 +1605,9 @@ CMD_FUNC(_cmd_umode) if (parc < 3) { - sendnumeric(client, RPL_UMODEIS, get_mode_str(client)); + sendnumeric(client, RPL_UMODEIS, get_usermode_string(client)); if (client->user->snomask) - sendnumeric(client, RPL_SNOMASK, get_sno_str(client)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string(client)); return; } @@ -1903,7 +1903,7 @@ CMD_FUNC(_cmd_umode) send_umode_out(client, 1, oldumodes); if (MyConnect(client) && setsnomask != client->user->snomask) - sendnumeric(client, RPL_SNOMASK, get_sno_str(client)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string(client)); } CMD_FUNC(cmd_mlock) diff --git a/src/modules/nick.c b/src/modules/nick.c index e92296d2c..20d217623 100644 --- a/src/modules/nick.c +++ b/src/modules/nick.c @@ -1110,7 +1110,7 @@ int _register_user(Client *client, char *nick, char *username, char *umode, char sendto_one(client, NULL, ":%s MODE %s :%s", client->name, client->name, buf); if (user->snomask) - sendnumeric(client, RPL_SNOMASK, get_snostr(user->snomask)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string_raw(user->snomask)); if (!IsSecure(client) && !IsLocalhost(client) && (iConf.plaintext_policy_user == POLICY_WARN)) sendnotice(client, "%s", iConf.plaintext_policy_user_message); diff --git a/src/modules/oper.c b/src/modules/oper.c index 5fc0b41a3..649b6bce4 100644 --- a/src/modules/oper.c +++ b/src/modules/oper.c @@ -187,10 +187,10 @@ CMD_FUNC(cmd_oper) sendnumericfmt(client, ERR_NOOPERHOST, "You are missing user modes required to OPER"); sendto_snomask_global (SNO_OPER, "Failed OPER attempt by %s (%s@%s) [lacking modes '%s' in oper::require-modes]", - client->name, client->user->username, client->local->sockhost, get_modestr(operblock->require_modes & ~client->umodes)); + client->name, client->user->username, client->local->sockhost, get_usermode_string_raw(operblock->require_modes & ~client->umodes)); ircd_log(LOG_OPER, "OPER MISSINGMODES (%s) by (%s!%s@%s), needs modes=%s", name, client->name, client->user->username, client->local->sockhost, - get_modestr(operblock->require_modes & ~client->umodes)); + get_usermode_string_raw(operblock->require_modes & ~client->umodes)); client->local->since += 7; return; } @@ -280,7 +280,7 @@ CMD_FUNC(cmd_oper) } send_umode_out(client, 1, old_umodes); - sendnumeric(client, RPL_SNOMASK, get_sno_str(client)); + sendnumeric(client, RPL_SNOMASK, get_snomask_string(client)); list_add(&client->special_node, &oper_list); diff --git a/src/modules/stats.c b/src/modules/stats.c index 9d109af18..4538c6f11 100644 --- a/src/modules/stats.c +++ b/src/modules/stats.c @@ -791,8 +791,8 @@ int stats_set(Client *client, char *para) sendtxtnumeric(client, "kline-address: %s", KLINE_ADDRESS); if (GLINE_ADDRESS) sendtxtnumeric(client, "gline-address: %s", GLINE_ADDRESS); - sendtxtnumeric(client, "modes-on-connect: %s", get_modestr(CONN_MODES)); - sendtxtnumeric(client, "modes-on-oper: %s", get_modestr(OPER_MODES)); + sendtxtnumeric(client, "modes-on-connect: %s", get_usermode_string_raw(CONN_MODES)); + sendtxtnumeric(client, "modes-on-oper: %s", get_usermode_string_raw(OPER_MODES)); *modebuf = *parabuf = 0; chmode_str(&iConf.modes_on_join, modebuf, parabuf, sizeof(modebuf), sizeof(parabuf)); sendtxtnumeric(client, "modes-on-join: %s %s", modebuf, parabuf); diff --git a/src/modules/svssno.c b/src/modules/svssno.c index c4f151997..ced2ea43f 100644 --- a/src/modules/svssno.c +++ b/src/modules/svssno.c @@ -119,7 +119,7 @@ void do_svssno(Client *client, int parc, char *parv[], int show_change) } if (show_change) - sendnumeric(target, RPL_SNOMASK, get_sno_str(target)); + sendnumeric(target, RPL_SNOMASK, get_snomask_string(target)); } CMD_FUNC(cmd_svssno) diff --git a/src/modules/whois.c b/src/modules/whois.c index 0ceadfa64..b73932772 100644 --- a/src/modules/whois.c +++ b/src/modules/whois.c @@ -135,11 +135,11 @@ CMD_FUNC(cmd_whois) if (IsOper(client) || target == client) { char sno[128]; - strlcpy(sno, get_sno_str(target), sizeof(sno)); + strlcpy(sno, get_snomask_string(target), sizeof(sno)); /* send the target user's modes */ sendnumeric(client, RPL_WHOISMODES, name, - get_mode_str(target), sno[1] == 0 ? "" : sno); + get_usermode_string(target), sno[1] == 0 ? "" : sno); } if ((target == client) || IsOper(client)) { diff --git a/src/modules/whox.c b/src/modules/whox.c index 732166613..506e3cb93 100644 --- a/src/modules/whox.c +++ b/src/modules/whox.c @@ -777,7 +777,7 @@ static void do_who(Client *client, Client *acptr, Channel *channel, struct who_f if (HasField(fmt, FIELD_MODES)) { if (IsOper(client)) - append_format(str, sizeof str, &pos, " %s", strtok(get_mode_str(acptr), "+")); + append_format(str, sizeof str, &pos, " %s", strtok(get_usermode_string(acptr), "+")); else append_format(str, sizeof str, &pos, " %s", "*"); } diff --git a/src/user.c b/src/user.c index 66452a7c6..b16a92903 100644 --- a/src/user.c +++ b/src/user.c @@ -242,7 +242,7 @@ char *canonize(char *buffer) * @param client The client * @returns string of snomasks (temporary storage) */ -char *get_sno_str(Client *client) +char *get_snomask_string(Client *client) { int i; char *m; @@ -261,7 +261,7 @@ char *get_sno_str(Client *client) * @param client The client * @returns string of user modes (temporary storage) */ -char *get_mode_str(Client *client) +char *get_usermode_string(Client *client) { int i; char *m; @@ -280,7 +280,7 @@ char *get_mode_str(Client *client) * @param umodes The user modes that are set * @returns string of user modes (temporary storage) */ -char *get_modestr(long umodes) +char *get_usermode_string_raw(long umodes) { int i; char *m; @@ -299,7 +299,7 @@ char *get_modestr(long umodes) * @param sno The snomasks that are set * @returns string of snomasks (temporary storage) */ -char *get_snostr(long sno) +char *get_snomask_string_raw(long sno) { int i; char *m;