diff --git a/include/modules.h b/include/modules.h index 918640d5d..c0e9dce2f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -211,7 +211,7 @@ struct Cmode { Cmode *prev, *next; /** mode character (like 'Z') */ - char flag; + char letter; /** unique flag (like 0x10) */ Cmode_t mode; @@ -315,7 +315,7 @@ struct Cmode { * For documentation, see Cmode struct. */ typedef struct { - char flag; + char letter; int paracount; int (*is_ok)(Client *,Channel *, char mode, char *para, int, int); void * (*put_param)(void *, char *); diff --git a/src/api-channelmode.c b/src/api-channelmode.c index 3c49e25af..45c6ebf6d 100644 --- a/src/api-channelmode.c +++ b/src/api-channelmode.c @@ -64,22 +64,22 @@ void make_extcmodestr() /* type 2: 1 par to set/unset (has .unset_with_param) */ p = extchmstr[1]; for (cm=channelmodes; cm; cm = cm->next) - if (cm->paracount && cm->flag && cm->unset_with_param) - *p++ = cm->flag; + if (cm->paracount && cm->letter && cm->unset_with_param) + *p++ = cm->letter; *p = '\0'; /* type 3: 1 param to set, 0 params to unset (does not have .unset_with_param) */ p = extchmstr[2]; for (cm=channelmodes; cm; cm = cm->next) - if (cm->paracount && cm->flag && !cm->unset_with_param) - *p++ = cm->flag; + if (cm->paracount && cm->letter && !cm->unset_with_param) + *p++ = cm->letter; *p = '\0'; /* type 4: paramless modes */ p = extchmstr[3]; for (cm=channelmodes; cm; cm = cm->next) - if (!cm->paracount && cm->flag) - *p++ = cm->flag; + if (!cm->paracount && cm->letter) + *p++ = cm->letter; *p = '\0'; } @@ -97,8 +97,8 @@ static void make_cmodestr(void) tab++; } for (cm=channelmodes; cm; cm = cm->next) - if (cm->flag) - *p++ = cm->flag; + if (cm->letter) + *p++ = cm->letter; *p = '\0'; } @@ -158,22 +158,22 @@ void extcmode_init(void) } /** Update letter->slot mapping and slot->handler mapping */ -void extcmode_para_addslot(Cmode *c, int slot) +void extcmode_para_addslot(Cmode *cm, int slot) { if ((slot < 0) || (slot > MAXPARAMMODES)) abort(); - c->param_slot = slot; - ParamTable[slot] = c; - param_to_slot_mapping[c->flag] = slot; + cm->param_slot = slot; + ParamTable[slot] = cm; + param_to_slot_mapping[cm->letter] = slot; } /** Update letter->slot mapping and slot->handler mapping */ -void extcmode_para_delslot(Cmode *c, int slot) +void extcmode_para_delslot(Cmode *cm, int slot) { if ((slot < 0) || (slot > MAXPARAMMODES)) abort(); ParamTable[slot] = NULL; - param_to_slot_mapping[c->flag] = 0; + param_to_slot_mapping[cm->letter] = 0; } int channelmode_add_sorted_helper(char x, char y) @@ -199,9 +199,9 @@ void channelmode_add_sorted(Cmode *n) for (m = channelmodes; m; m = m->next) { - if (m->flag == '\0') + if (m->letter == '\0') abort(); - if (channelmode_add_sorted_helper(n->flag, m->flag)) + if (channelmode_add_sorted_helper(n->letter, m->letter)) { /* Insert us before */ if (m->prev) @@ -242,7 +242,7 @@ Cmode *CmodeAdd(Module *module, CmodeInfo req, Cmode_t *mode) for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag == req.flag) + if (cm->letter == req.letter) { if (cm->unloaded) { @@ -285,7 +285,7 @@ Cmode *CmodeAdd(Module *module, CmodeInfo req, Cmode_t *mode) } cm = safe_alloc(sizeof(Cmode)); cm->mode = l; - cm->flag = req.flag; + cm->letter = req.letter; channelmode_add_sorted(cm); } @@ -315,7 +315,7 @@ Cmode *CmodeAdd(Module *module, CmodeInfo req, Cmode_t *mode) *mode = cm->mode; /* Update extended channel mode table highest */ - cm->flag = req.flag; + cm->letter = req.letter; cm->paracount = req.paracount; cm->is_ok = req.is_ok; cm->put_param = req.put_param; @@ -394,10 +394,10 @@ static void unload_extcmode_commit(Cmode *cmode) new_message(&me, NULL, &mtags); sendto_channel(channel, &me, NULL, 0, 0, SEND_LOCAL, mtags, ":%s MODE %s -%c", - me.name, channel->name, cmode->flag); + me.name, channel->name, cmode->letter); sendto_server(NULL, 0, 0, mtags, ":%s MODE %s -%c 0", - me.id, channel->name, cmode->flag); + me.id, channel->name, cmode->letter); free_message_tags(mtags); channel->mode.mode &= ~cmode->mode; @@ -415,31 +415,31 @@ static void unload_extcmode_commit(Cmode *cmode) new_message(&me, NULL, &mtags); if (cmode->unset_with_param) { - char *param = cmode->get_param(GETPARASTRUCT(channel, cmode->flag)); + char *param = cmode->get_param(GETPARASTRUCT(channel, cmode->letter)); sendto_channel(channel, &me, NULL, 0, 0, SEND_LOCAL, mtags, ":%s MODE %s -%c %s", - me.name, channel->name, cmode->flag, param); + me.name, channel->name, cmode->letter, param); sendto_server(NULL, 0, 0, mtags, ":%s MODE %s -%c %s 0", - me.id, channel->name, cmode->flag, param); + me.id, channel->name, cmode->letter, param); } else { sendto_channel(channel, &me, NULL, 0, 0, SEND_LOCAL, mtags, ":%s MODE %s -%c", - me.name, channel->name, cmode->flag); + me.name, channel->name, cmode->letter); sendto_server(NULL, 0, 0, mtags, ":%s MODE %s -%c 0", - me.id, channel->name, cmode->flag); + me.id, channel->name, cmode->letter); } free_message_tags(mtags); - cmode->free_param(GETPARASTRUCT(channel, cmode->flag)); + cmode->free_param(GETPARASTRUCT(channel, cmode->letter)); channel->mode.mode &= ~cmode->mode; } } extcmode_para_delslot(cmode, cmode->param_slot); } - cmode->flag = '\0'; + cmode->letter = '\0'; } /** Unload all unused channel modes after a REHASH */ @@ -450,7 +450,7 @@ void unload_all_unused_extcmodes(void) for (cm=channelmodes; cm; cm = cm_next) { cm_next = cm->next; - if (cm->flag && cm->unloaded) + if (cm->letter && cm->unloaded) { unload_extcmode_commit(cm); } @@ -597,7 +597,7 @@ int module_has_extcmode_param_mode(Module *mod) Cmode *cm; for (cm=channelmodes; cm; cm = cm->next) - if ((cm->flag) && (cm->owner == mod) && (cm->paracount)) + if ((cm->letter) && (cm->owner == mod) && (cm->paracount)) return 1; return 0; diff --git a/src/channel.c b/src/channel.c index a3ef13856..5cab6d053 100644 --- a/src/channel.c +++ b/src/channel.c @@ -577,7 +577,7 @@ int has_channel_mode(Channel *channel, char mode) Cmode *cm; for (cm=channelmodes; cm; cm = cm->next) - if ((cm->flag == mode) && (channel->mode.mode & cm->mode)) + if ((cm->letter == mode) && (channel->mode.mode & cm->mode)) return 1; return 0; /* Not found */ @@ -589,7 +589,7 @@ Cmode_t get_extmode_bitbychar(char m) Cmode *cm; for (cm=channelmodes; cm; cm = cm->next) - if (cm->flag == m) + if (cm->letter == m) return cm->mode; return 0; @@ -626,24 +626,24 @@ void channel_modes(Client *client, char *mbuf, char *pbuf, size_t mbuf_size, siz { if (!mbuf_size) break; - if (cm->flag && + if (cm->letter && !cm->paracount && !(hide_local_modes && cm->local) && (channel->mode.mode & cm->mode)) { - *mbuf++ = cm->flag; + *mbuf++ = cm->letter; mbuf_size--; } } for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag && + if (cm->letter && cm->paracount && !(hide_local_modes && cm->local) && (channel->mode.mode & cm->mode)) { - char flag = cm->flag; + char flag = cm->letter; if (mbuf_size) { *mbuf++ = flag; mbuf_size--; @@ -1130,7 +1130,7 @@ int parse_chanmode(ParseMode *pm, char *modebuf_in, char *parabuf_in) int found = 0; for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag == *pm->modebuf) + if (cm->letter == *pm->modebuf) { found = 1; break; diff --git a/src/conf.c b/src/conf.c index 221f73c9b..ff9cc2b4a 100644 --- a/src/conf.c +++ b/src/conf.c @@ -610,9 +610,9 @@ void conf_channelmodes(char *modes, struct ChMode *store) found = 0; for (cm=channelmodes; cm; cm = cm->next) { - if (!(cm->flag)) + if (!(cm->letter)) continue; - if (*m == cm->flag) + if (*m == cm->letter) { found = 1; if (cm->paracount) @@ -629,7 +629,7 @@ void conf_channelmodes(char *modes, struct ChMode *store) config_warn("set::modes-on-join '%s'. Parameter for mode %c is invalid (%s).", modes, *m, param_in); break; /* invalid parameter fmt, do not set mode. */ } - safe_strdup(store->extparams[cm->flag], param); + safe_strdup(store->extparams[cm->letter], param); /* Get next parameter */ param = strtoken(&save, NULL, " "); } @@ -655,14 +655,14 @@ void chmode_str(struct ChMode *modes, char *mbuf, char *pbuf, size_t mbuf_size, for (cm=channelmodes; cm; cm = cm->next) { - if (!(cm->flag)) + if (!(cm->letter)) continue; if (modes->extmodes & cm->mode) { if (mbuf_size) { - *mbuf++ = cm->flag; + *mbuf++ = cm->letter; if (!--mbuf_size) { *--mbuf=0; @@ -671,7 +671,7 @@ void chmode_str(struct ChMode *modes, char *mbuf, char *pbuf, size_t mbuf_size, } if (cm->paracount) { - strlcat(pbuf, modes->extparams[cm->flag], pbuf_size); + strlcat(pbuf, modes->extparams[cm->letter], pbuf_size); strlcat(pbuf, " ", pbuf_size); } } diff --git a/src/modules/chanmodes/censor.c b/src/modules/chanmodes/censor.c index c8609b980..46f81133b 100644 --- a/src/modules/chanmodes/censor.c +++ b/src/modules/chanmodes/censor.c @@ -49,7 +49,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; req.is_ok = extcmode_default_requirechop; - req.flag = 'G'; + req.letter = 'G'; CmodeAdd(modinfo->handle, req, &EXTMODE_CENSOR); HookAdd(modinfo->handle, HOOKTYPE_CAN_SEND_TO_CHANNEL, 0, censor_can_send_to_channel); diff --git a/src/modules/chanmodes/delayjoin.c b/src/modules/chanmodes/delayjoin.c index a72db2cfc..f034fca8f 100644 --- a/src/modules/chanmodes/delayjoin.c +++ b/src/modules/chanmodes/delayjoin.c @@ -46,13 +46,13 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; req.is_ok = extcmode_default_requirechop; - req.flag = 'D'; + req.letter = 'D'; CmodeDelayed = CmodeAdd(modinfo->handle, req, &EXTMODE_DELAYED); memset(&req, 0, sizeof(req)); req.paracount = 0; req.is_ok = deny_all; - req.flag = 'd'; + req.letter = 'd'; req.local = 1; CmodePostDelayed = CmodeAdd(modinfo->handle, req, &EXTMODE_POST_DELAYED); diff --git a/src/modules/chanmodes/floodprot.c b/src/modules/chanmodes/floodprot.c index d9e617861..a336ad1cf 100644 --- a/src/modules/chanmodes/floodprot.c +++ b/src/modules/chanmodes/floodprot.c @@ -165,7 +165,7 @@ MOD_INIT() memset(&creq, 0, sizeof(creq)); creq.paracount = 1; creq.is_ok = cmodef_is_ok; - creq.flag = 'f'; + creq.letter = 'f'; creq.unset_with_param = 1; /* ah yeah, +f is special! */ creq.put_param = cmodef_put_param; creq.get_param = cmodef_get_param; diff --git a/src/modules/chanmodes/history.c b/src/modules/chanmodes/history.c index dcb3a99e7..7f08f91da 100644 --- a/src/modules/chanmodes/history.c +++ b/src/modules/chanmodes/history.c @@ -77,7 +77,7 @@ MOD_INIT() memset(&creq, 0, sizeof(creq)); creq.paracount = 1; creq.is_ok = history_chanmode_is_ok; - creq.flag = 'H'; + creq.letter = 'H'; creq.put_param = history_chanmode_put_param; creq.get_param = history_chanmode_get_param; creq.conv_param = history_chanmode_conv_param; diff --git a/src/modules/chanmodes/inviteonly.c b/src/modules/chanmodes/inviteonly.c index a2e927858..49dcec78c 100644 --- a/src/modules/chanmodes/inviteonly.c +++ b/src/modules/chanmodes/inviteonly.c @@ -43,7 +43,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'i'; + req.letter = 'i'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_INVITE_ONLY); diff --git a/src/modules/chanmodes/isregistered.c b/src/modules/chanmodes/isregistered.c index 82636d5a9..25d26ae4b 100644 --- a/src/modules/chanmodes/isregistered.c +++ b/src/modules/chanmodes/isregistered.c @@ -43,7 +43,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'r'; + req.letter = 'r'; req.is_ok = isregistered_chanmode_is_ok; CmodeAdd(modinfo->handle, req, &EXTCMODE_REGISTERED); diff --git a/src/modules/chanmodes/issecure.c b/src/modules/chanmodes/issecure.c index 796909b5b..d299e8629 100644 --- a/src/modules/chanmodes/issecure.c +++ b/src/modules/chanmodes/issecure.c @@ -64,7 +64,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; req.is_ok = modeZ_is_ok; - req.flag = 'Z'; + req.letter = 'Z'; req.local = 1; /* local channel mode */ CmodeAdd(modinfo->handle, req, &EXTCMODE_ISSECURE); diff --git a/src/modules/chanmodes/key.c b/src/modules/chanmodes/key.c index 0fe74c6aa..3527298ce 100644 --- a/src/modules/chanmodes/key.c +++ b/src/modules/chanmodes/key.c @@ -61,7 +61,7 @@ MOD_INIT() memset(&creq, 0, sizeof(creq)); creq.paracount = 1; creq.is_ok = cmode_key_is_ok; - creq.flag = 'k'; + creq.letter = 'k'; creq.unset_with_param = 1; /* yeah... +k is like this */ creq.put_param = cmode_key_put_param; creq.get_param = cmode_key_get_param; diff --git a/src/modules/chanmodes/limit.c b/src/modules/chanmodes/limit.c index d0c9684f9..eed9ae25c 100644 --- a/src/modules/chanmodes/limit.c +++ b/src/modules/chanmodes/limit.c @@ -63,7 +63,7 @@ MOD_INIT() memset(&creq, 0, sizeof(creq)); creq.paracount = 1; creq.is_ok = cmode_limit_is_ok; - creq.flag = 'l'; + creq.letter = 'l'; creq.put_param = cmode_limit_put_param; creq.get_param = cmode_limit_get_param; creq.conv_param = cmode_limit_conv_param; diff --git a/src/modules/chanmodes/link.c b/src/modules/chanmodes/link.c index 92313763b..81bf8798d 100644 --- a/src/modules/chanmodes/link.c +++ b/src/modules/chanmodes/link.c @@ -69,7 +69,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 1; req.is_ok = cmodeL_is_ok; - req.flag = 'L'; + req.letter = 'L'; req.unset_with_param = 1; /* Oh yeah, we are special! */ req.put_param = cmodeL_put_param; req.get_param = cmodeL_get_param; diff --git a/src/modules/chanmodes/moderated.c b/src/modules/chanmodes/moderated.c index 7f300b66c..9a9a74a00 100644 --- a/src/modules/chanmodes/moderated.c +++ b/src/modules/chanmodes/moderated.c @@ -44,7 +44,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'm'; + req.letter = 'm'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_MODERATED); diff --git a/src/modules/chanmodes/nocolor.c b/src/modules/chanmodes/nocolor.c index 100b44fb4..158f9bd02 100644 --- a/src/modules/chanmodes/nocolor.c +++ b/src/modules/chanmodes/nocolor.c @@ -50,7 +50,7 @@ CmodeInfo req; /* Channel mode */ memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'c'; + req.letter = 'c'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NOCOLOR); diff --git a/src/modules/chanmodes/noctcp.c b/src/modules/chanmodes/noctcp.c index 7a6b39469..8e33fbcbe 100644 --- a/src/modules/chanmodes/noctcp.c +++ b/src/modules/chanmodes/noctcp.c @@ -47,7 +47,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'C'; + req.letter = 'C'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NOCTCP); diff --git a/src/modules/chanmodes/noexternalmsgs.c b/src/modules/chanmodes/noexternalmsgs.c index 6baa1780b..23e66bf64 100644 --- a/src/modules/chanmodes/noexternalmsgs.c +++ b/src/modules/chanmodes/noexternalmsgs.c @@ -43,7 +43,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'n'; + req.letter = 'n'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NO_EXTERNAL_MESSAGES); diff --git a/src/modules/chanmodes/noinvite.c b/src/modules/chanmodes/noinvite.c index 013d92686..250dfd7f2 100644 --- a/src/modules/chanmodes/noinvite.c +++ b/src/modules/chanmodes/noinvite.c @@ -48,7 +48,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'V'; + req.letter = 'V'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NOINVITE); diff --git a/src/modules/chanmodes/nokick.c b/src/modules/chanmodes/nokick.c index 39328d140..5a0a87e7a 100644 --- a/src/modules/chanmodes/nokick.c +++ b/src/modules/chanmodes/nokick.c @@ -46,7 +46,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'Q'; + req.letter = 'Q'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NOKICK); diff --git a/src/modules/chanmodes/noknock.c b/src/modules/chanmodes/noknock.c index 44f5656a7..46d2f4470 100644 --- a/src/modules/chanmodes/noknock.c +++ b/src/modules/chanmodes/noknock.c @@ -47,7 +47,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'K'; + req.letter = 'K'; req.is_ok = noknock_mode_allow; CmodeAdd(modinfo->handle, req, &EXTCMODE_NOKNOCK); diff --git a/src/modules/chanmodes/nonickchange.c b/src/modules/chanmodes/nonickchange.c index 6520e5053..726e4ec57 100644 --- a/src/modules/chanmodes/nonickchange.c +++ b/src/modules/chanmodes/nonickchange.c @@ -46,7 +46,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'N'; + req.letter = 'N'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NONICKCHANGE); diff --git a/src/modules/chanmodes/nonotice.c b/src/modules/chanmodes/nonotice.c index 135f801e8..2586c6b8e 100644 --- a/src/modules/chanmodes/nonotice.c +++ b/src/modules/chanmodes/nonotice.c @@ -45,7 +45,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'T'; + req.letter = 'T'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_NONOTICE); diff --git a/src/modules/chanmodes/operonly.c b/src/modules/chanmodes/operonly.c index d5188d94f..c3be768f8 100644 --- a/src/modules/chanmodes/operonly.c +++ b/src/modules/chanmodes/operonly.c @@ -48,7 +48,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'O'; + req.letter = 'O'; req.is_ok = operonly_require_oper; CmodeAdd(modinfo->handle, req, &EXTCMODE_OPERONLY); diff --git a/src/modules/chanmodes/permanent.c b/src/modules/chanmodes/permanent.c index 301edf4d6..04f7da9b6 100644 --- a/src/modules/chanmodes/permanent.c +++ b/src/modules/chanmodes/permanent.c @@ -72,7 +72,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'P'; + req.letter = 'P'; req.is_ok = permanent_is_ok; CmodeAdd(modinfo->handle, req, &EXTMODE_PERMANENT); diff --git a/src/modules/chanmodes/private.c b/src/modules/chanmodes/private.c index f6eee7f33..d29205065 100644 --- a/src/modules/chanmodes/private.c +++ b/src/modules/chanmodes/private.c @@ -43,7 +43,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'p'; + req.letter = 'p'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_PRIVATE); diff --git a/src/modules/chanmodes/regonly.c b/src/modules/chanmodes/regonly.c index 205baacb5..942c84423 100644 --- a/src/modules/chanmodes/regonly.c +++ b/src/modules/chanmodes/regonly.c @@ -47,7 +47,7 @@ CmodeInfo req; memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'R'; + req.letter = 'R'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_REGONLY); diff --git a/src/modules/chanmodes/regonlyspeak.c b/src/modules/chanmodes/regonlyspeak.c index 09e63c705..f181093d1 100644 --- a/src/modules/chanmodes/regonlyspeak.c +++ b/src/modules/chanmodes/regonlyspeak.c @@ -48,7 +48,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'M'; + req.letter = 'M'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_REGONLYSPEAK); diff --git a/src/modules/chanmodes/secret.c b/src/modules/chanmodes/secret.c index e6509d830..0487a299c 100644 --- a/src/modules/chanmodes/secret.c +++ b/src/modules/chanmodes/secret.c @@ -43,7 +43,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 's'; + req.letter = 's'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_SECRET); diff --git a/src/modules/chanmodes/secureonly.c b/src/modules/chanmodes/secureonly.c index 0e70ab049..91f2fcb54 100644 --- a/src/modules/chanmodes/secureonly.c +++ b/src/modules/chanmodes/secureonly.c @@ -49,7 +49,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'z'; + req.letter = 'z'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_SECUREONLY); diff --git a/src/modules/chanmodes/stripcolor.c b/src/modules/chanmodes/stripcolor.c index 9205cf882..ab74259f4 100644 --- a/src/modules/chanmodes/stripcolor.c +++ b/src/modules/chanmodes/stripcolor.c @@ -50,7 +50,7 @@ CmodeInfo req; /* Channel mode */ memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 'S'; + req.letter = 'S'; req.is_ok = extcmode_default_requirechop; CmodeAdd(modinfo->handle, req, &EXTCMODE_STRIPCOLOR); diff --git a/src/modules/chanmodes/topiclimit.c b/src/modules/chanmodes/topiclimit.c index f98bb4b01..5540e9758 100644 --- a/src/modules/chanmodes/topiclimit.c +++ b/src/modules/chanmodes/topiclimit.c @@ -41,7 +41,7 @@ MOD_INIT() memset(&req, 0, sizeof(req)); req.paracount = 0; - req.flag = 't'; + req.letter = 't'; req.is_ok = extcmode_default_requirehalfop; CmodeAdd(modinfo->handle, req, &EXTCMODE_TOPIC_LIMIT); diff --git a/src/modules/join.c b/src/modules/join.c index 0f8c95214..4516908fd 100644 --- a/src/modules/join.c +++ b/src/modules/join.c @@ -265,10 +265,10 @@ void _join_channel(Channel *channel, Client *client, MessageTag *recv_mtags, int /* Param fun */ for (cm=channelmodes; cm; cm = cm->next) { - if (!cm->flag || !cm->paracount) + if (!cm->letter || !cm->paracount) continue; if (channel->mode.mode & cm->mode) - cm_putparameter(channel, cm->flag, iConf.modes_on_join.extparams[cm->flag]); + cm_putparameter(channel, cm->letter, iConf.modes_on_join.extparams[cm->letter]); } *modebuf = *parabuf = 0; diff --git a/src/modules/mode.c b/src/modules/mode.c index aa907a0cf..2cbd0f691 100644 --- a/src/modules/mode.c +++ b/src/modules/mode.c @@ -446,7 +446,7 @@ void make_mode_str(Channel *channel, Cmode_t oldem, int pcount, /* + paramless extmodes... */ for (cm=channelmodes; cm; cm = cm->next) { - if (!cm->flag || cm->paracount) + if (!cm->letter || cm->paracount) continue; /* have it now and didn't have it before? */ if ((channel->mode.mode & cm->mode) && @@ -457,7 +457,7 @@ void make_mode_str(Channel *channel, Cmode_t oldem, int pcount, *x++ = '+'; what = MODE_ADD; } - *x++ = cm->flag; + *x++ = cm->letter; } } @@ -468,7 +468,7 @@ void make_mode_str(Channel *channel, Cmode_t oldem, int pcount, */ for (cm=channelmodes; cm; cm = cm->next) { - if (!cm->flag || cm->unset_with_param) + if (!cm->letter || cm->unset_with_param) continue; /* don't have it now and did have it before */ if (!(channel->mode.mode & cm->mode) && @@ -479,7 +479,7 @@ void make_mode_str(Channel *channel, Cmode_t oldem, int pcount, *x++ = '-'; what = MODE_DEL; } - *x++ = cm->flag; + *x++ = cm->letter; } } @@ -857,7 +857,7 @@ int do_extmode_char(Channel *channel, Cmode *handler, char *param, u_int what, Client *client, u_int *pcount, char pvar[MAXMODEPARAMS][MODEBUFLEN + 3]) { int paracnt = (what == MODE_ADD) ? handler->paracount : 0; - char mode = handler->flag; + char mode = handler->letter; int x; char *morphed; @@ -895,7 +895,7 @@ int do_extmode_char(Channel *channel, Cmode *handler, char *param, u_int what, /* Check for multiple changes in 1 command (like +y-y+y 1 2, or +yy 1 2). */ for (x = 0; x < *pcount; x++) { - if (pvar[x][1] == handler->flag) + if (pvar[x][1] == handler->letter) { /* this is different than the old chanmode system, coz: * "mode #chan +kkL #a #b #c" will get "+kL #a #b" which is wrong :p. @@ -918,7 +918,7 @@ int do_extmode_char(Channel *channel, Cmode *handler, char *param, u_int what, * Any provided parameter is ok, the current one (that is set) will be used. */ ircsnprintf(pvar[*pcount], MODEBUFLEN + 3, "-%c%s", - handler->flag, cm_getparameter(channel, handler->flag)); + handler->letter, cm_getparameter(channel, handler->letter)); (*pcount)++; } else { /* Normal extended channel mode: deleting is just -X, no parameter. @@ -938,14 +938,14 @@ int do_extmode_char(Channel *channel, Cmode *handler, char *param, u_int what, if (channel->mode.mode & handler->mode) { char *now, *requested; - char flag = handler->flag; + char flag = handler->letter; now = cm_getparameter(channel, flag); requested = handler->conv_param(param, client, channel); if (now && requested && !strcmp(now, requested)) return paracnt; /* ignore... */ } ircsnprintf(pvar[*pcount], MODEBUFLEN + 3, "+%c%s", - handler->flag, handler->conv_param(param, client, channel)); + handler->letter, handler->conv_param(param, client, channel)); (*pcount)++; param = morphed; /* set param to converted parameter. */ } @@ -955,14 +955,14 @@ int do_extmode_char(Channel *channel, Cmode *handler, char *param, u_int what, { /* + */ channel->mode.mode |= handler->mode; if (handler->paracount) - cm_putparameter(channel, handler->flag, param); + cm_putparameter(channel, handler->letter, param); RunHook2(HOOKTYPE_MODECHAR_ADD, channel, (int)mode); } else { /* - */ channel->mode.mode &= ~(handler->mode); RunHook2(HOOKTYPE_MODECHAR_DEL, channel, (int)mode); if (handler->paracount) - cm_freeparameter(channel, handler->flag); + cm_freeparameter(channel, handler->letter); } return paracnt; } @@ -1114,7 +1114,7 @@ void _set_mode(Channel *channel, Client *client, int parc, char *parv[], u_int * /* Maybe in extmodes */ for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag == *curchr) + if (cm->letter == *curchr) { found = 2; break; diff --git a/src/modules/sjoin.c b/src/modules/sjoin.c index f9099aa1d..2404f2f78 100644 --- a/src/modules/sjoin.c +++ b/src/modules/sjoin.c @@ -713,18 +713,18 @@ getnick: */ for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag && + if (cm->letter && !cm->local && (oldmode.mode & cm->mode) && !(channel->mode.mode & cm->mode)) { if (cm->paracount) { - char *parax = cm_getparameter_ex(oldmode.mode_params, cm->flag); - //char *parax = cm->get_param(extcmode_get_struct(oldmode.modeparam, cm->flag)); - Addit(cm->flag, parax); + char *parax = cm_getparameter_ex(oldmode.mode_params, cm->letter); + //char *parax = cm->get_param(extcmode_get_struct(oldmode.modeparam, cm->letter)); + Addit(cm->letter, parax); } else { - Addsingle(cm->flag); + Addsingle(cm->letter); } } } @@ -760,19 +760,19 @@ getnick: */ for (cm=channelmodes; cm; cm = cm->next) { - if ((cm->flag) && + if ((cm->letter) && !(oldmode.mode & cm->mode) && (channel->mode.mode & cm->mode)) { if (cm->paracount) { - char *parax = cm_getparameter(channel, cm->flag); + char *parax = cm_getparameter(channel, cm->letter); if (parax) { - Addit(cm->flag, parax); + Addit(cm->letter, parax); } } else { - Addsingle(cm->flag); + Addsingle(cm->letter); } } } @@ -785,13 +785,13 @@ getnick: */ for (cm=channelmodes; cm; cm = cm->next) { - if (cm->flag && cm->paracount && + if (cm->letter && cm->paracount && (oldmode.mode & cm->mode) && (channel->mode.mode & cm->mode)) { int r; char *parax; - char flag = cm->flag; + char flag = cm->letter; void *ourm = GETPARASTRUCTEX(oldmode.mode_params, flag); void *theirm = GETPARASTRUCT(channel, flag); @@ -805,7 +805,7 @@ getnick: case EXSJ_THEYWON: parax = cm_getparameter(channel, flag); - Addit(cm->flag, parax); + Addit(cm->letter, parax); break; case EXSJ_SAME: