#define NUMERIC_STR_713 "%s :Channel is open."
#define NUMERIC_STR_714 ":%s 714 %s %s :You are already on that channel."
#define NUMERIC_STR_715 ":%s 715 %s :KNOCKs are disabled."
-#define NUMERIC_STR_716 "%s :is in +g mode (server-side ignore.)"
+#define NUMERIC_STR_716 "%s :is in %s mode (server-side ignore.)"
#define NUMERIC_STR_717 "%s :has been informed that you messaged them."
-#define NUMERIC_STR_718 ":%s 718 %s %s %s@%s :is messaging you, and you have umode +g."
+#define NUMERIC_STR_718 ":%s 718 %s %s %s@%s :is messaging you, and you have umode %s."
#define NUMERIC_STR_720 ":%s 720 %s :Start of OPER MOTD"
#define NUMERIC_STR_721 ":%s 721 %s :%s"
#define NUMERIC_STR_722 ":%s 722 %s :End of OPER MOTD"
delete_isupport("CALLERID");
}
-#define IsSetCallerID(c) ((c->umodes & user_modes['g']) == user_modes['g'])
+#define IsSetStrictCallerID(c) ((c->umodes & user_modes['g']) == user_modes['g'])
#define IsSetRelaxedCallerID(c) ((c->umodes & user_modes['G']) == user_modes['G'])
+#define IsSetAnyCallerID(c) (IsSetStrictCallerID(c) || IsSetRelaxedCallerID(c))
static const char um_callerid_desc[] =
"Provides usermodes +g and +G which restrict messages from unauthorized users.";
if (!MyClient(target_p))
return true;
- if (!IsSetCallerID(target_p))
+ if (!IsSetAnyCallerID(target_p))
return true;
- if (IsSetRelaxedCallerID(target_p) && has_common_channel(source_p, target_p))
+ if (IsSetRelaxedCallerID(target_p) && has_common_channel(source_p, target_p) && !IsSetStrictCallerID(target_p))
return true;
if (IsServer(source_p))
return;
sendto_one_numeric(source_p, ERR_TARGUMODEG, form_str(ERR_TARGUMODEG),
- target_p->name);
+ target_p->name, IsSetStrictCallerID(target_p) ? "+g" : "+G");
if ((target_p->localClient->last_caller_id_time + ConfigFileEntry.caller_id_wait) < rb_current_time())
{
sendto_one(target_p, form_str(RPL_UMODEGMSG),
me.name, target_p->name, source_p->name,
- source_p->username, source_p->host);
+ source_p->username, source_p->host, IsSetStrictCallerID(target_p) ? "+g" : "+G");
target_p->localClient->last_caller_id_time = rb_current_time();
}
* as a way of griefing. --nenolod
*/
if(msgtype != MESSAGE_TYPE_NOTICE &&
- IsSetCallerID(source_p) &&
+ IsSetAnyCallerID(source_p) &&
!accept_message(target_p, source_p) &&
!IsOper(target_p))
{