summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/core/m_message.c17
-rw-r--r--modules/core/m_part.c4
-rw-r--r--modules/core/m_sjoin.c3
3 files changed, 17 insertions, 7 deletions
diff --git a/modules/core/m_message.c b/modules/core/m_message.c
index 7fadaba..5aaf74b 100644
--- a/modules/core/m_message.c
+++ b/modules/core/m_message.c
@@ -409,7 +409,7 @@ static void
msg_channel(int p_or_n, const char *command, struct Client *client_p,
struct Client *source_p, struct Channel *chptr, char *text)
{
- int result;
+ int result = 0;
if (MyClient(source_p))
{
@@ -419,7 +419,7 @@ msg_channel(int p_or_n, const char *command, struct Client *client_p,
}
/* chanops and voiced can flood their own channel with impunity */
- if ((result = can_send(chptr, source_p, NULL)) < 0)
+ if ((result = can_send(chptr, source_p, NULL, text)) < 0)
{
if (result == CAN_SEND_OPV ||
!flood_attack_channel(p_or_n, source_p, chptr))
@@ -429,9 +429,16 @@ msg_channel(int p_or_n, const char *command, struct Client *client_p,
else
{
if (p_or_n != NOTICE)
- sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN),
- ID_or_name(&me, client_p),
- ID_or_name(source_p, client_p), chptr->chname);
+ {
+ if (result == ERR_NOCTRLSONCHAN)
+ sendto_one(source_p, form_str(ERR_NOCTRLSONCHAN),
+ ID_or_name(&me, client_p),
+ ID_or_name(source_p, client_p), chptr->chname, text);
+ else
+ sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN),
+ ID_or_name(&me, client_p),
+ ID_or_name(source_p, client_p), chptr->chname);
+ }
}
}
diff --git a/modules/core/m_part.c b/modules/core/m_part.c
index 3d1e83a..e999c6a 100644
--- a/modules/core/m_part.c
+++ b/modules/core/m_part.c
@@ -76,7 +76,7 @@ part_one_client(struct Client *client_p, struct Client *source_p,
* only allow /part reasons in -m chans
*/
if (reason[0] && (!MyConnect(source_p) ||
- ((can_send(chptr, source_p, ms) &&
+ ((can_send(chptr, source_p, ms, reason) &&
(source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time)
< CurrentTime))))
{
@@ -127,7 +127,7 @@ m_part(struct Client *client_p, struct Client *source_p,
return;
}
- if (parc > 2)
+ if (parc > 2 && !EmptyString(parv[2]))
strlcpy(reason, parv[2], sizeof(reason));
/* Finish the flood grace period... */
diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c
index 65a5caa..8e10097 100644
--- a/modules/core/m_sjoin.c
+++ b/modules/core/m_sjoin.c
@@ -122,6 +122,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p,
{
switch (*s)
{
+ case 'c':
+ mode.mode |= MODE_NOCTRL;
+ break;
case 't':
mode.mode |= MODE_TOPICLIMIT;
break;