Finish chmode +K, which prevents repeated lines.
This commit is contained in:
parent
cc39ce707d
commit
9a4dc29c68
|
@ -488,6 +488,7 @@ msg_channel(int p_or_n, const char *command,
|
||||||
int caps = 0;
|
int caps = 0;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
struct membership *msptr = find_channel_membership(chptr, source_p);
|
struct membership *msptr = find_channel_membership(chptr, source_p);
|
||||||
|
struct Metadata *md;
|
||||||
|
|
||||||
if(MyClient(source_p))
|
if(MyClient(source_p))
|
||||||
{
|
{
|
||||||
|
@ -496,6 +497,23 @@ msg_channel(int p_or_n, const char *command,
|
||||||
source_p->localClient->last = rb_current_time();
|
source_p->localClient->last = rb_current_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(chptr->mode.mode & MODE_NOREPEAT)
|
||||||
|
{
|
||||||
|
md = channel_metadata_find(chptr, "NOREPEAT");
|
||||||
|
if(md && (!ConfigChannel.exempt_cmode_K || !is_any_op(msptr)))
|
||||||
|
{
|
||||||
|
if(!(strcmp(md->value, strip_colour(text))))
|
||||||
|
{
|
||||||
|
if(p_or_n != NOTICE)
|
||||||
|
sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,
|
||||||
|
form_str(ERR_CANNOTSENDTOCHAN), chptr->chname);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
channel_metadata_delete(chptr, "NOREPEAT", 0);
|
||||||
|
channel_metadata_add(chptr, "NOREPEAT", strip_colour(text), 0);
|
||||||
|
}
|
||||||
|
|
||||||
if(chptr->mode.mode & MODE_NOCOLOR && (!ConfigChannel.exempt_cmode_c || !is_any_op(msptr)))
|
if(chptr->mode.mode & MODE_NOCOLOR && (!ConfigChannel.exempt_cmode_c || !is_any_op(msptr)))
|
||||||
{
|
{
|
||||||
rb_strlcpy(text2, text, BUFSIZE);
|
rb_strlcpy(text2, text, BUFSIZE);
|
||||||
|
|
|
@ -105,7 +105,7 @@ allocate_channel(const char *chname)
|
||||||
void
|
void
|
||||||
free_channel(struct Channel *chptr)
|
free_channel(struct Channel *chptr)
|
||||||
{
|
{
|
||||||
/* insert deletion of metadata here! */
|
channel_metadata_delete(chptr, "NOREPEAT", 0);
|
||||||
rb_free(chptr->chname);
|
rb_free(chptr->chname);
|
||||||
rb_bh_free(channel_heap, chptr);
|
rb_bh_free(channel_heap, chptr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue