3636
3737#define IsOperQuarantine (x ) (HasPrivilege((x), "oper:quarantine"))
3838#define IsQuarantined (x ) ((x)->umodes & user_modes['q'])
39- #define DEFAULT_JOIN_REASON "Cannot join channel (+q) - you need to be logged into your NickServ account"
40- #define DEFAULT_MSG_REASON "Cannot send to nick/channel (+q) - you need to be logged into your NickServ account"
39+ #define DEFAULT_JOIN_REASON "Cannot join channel (usermode +q) - you need to be logged into your NickServ account"
40+ #define DEFAULT_MSG_REASON "Cannot send to nick/channel (usermode +q) - you need to be logged into your NickServ account"
4141#define DEFAULT_OTHER_MSG_REASON "they are quarantined and will be unable to respond to you"
4242#define DEFAULT_APPLY_MSG "You have been quarantined and must log into your NickServ account before you can join channels. Please see /STATS p for assistance."
4343#define DEFAULT_REMOVE_MSG "You are no longer quarantined and can freely join channels."
@@ -74,12 +74,12 @@ static void quarantine_set_allow_channels(void *);
7474
7575struct Message quarantine_msgtab = {
7676 "QUARANTINE" , 0 , 0 , 0 , 0 ,
77- { mg_unreg , mg_not_oper , mg_not_oper , mg_ignore , { me_quarantine , 2 }, { mo_quarantine , 2 } }
77+ { mg_unreg , mg_not_oper , mg_not_oper , mg_ignore , { me_quarantine , 3 }, { mo_quarantine , 3 } }
7878};
7979
8080struct Message unquarantine_msgtab = {
8181 "UNQUARANTINE" , 0 , 0 , 0 , 0 ,
82- { mg_unreg , mg_not_oper , mg_not_oper , mg_ignore , { me_unquarantine , 1 }, { mo_unquarantine , 1 } }
82+ { mg_unreg , mg_not_oper , mg_not_oper , mg_ignore , { me_unquarantine , 2 }, { mo_unquarantine , 2 } }
8383};
8484
8585struct ConfEntry conf_quarantine_table [] = {
@@ -149,12 +149,6 @@ mo_quarantine(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *s
149149 return ;
150150 }
151151
152- if (parc < 3 || EmptyString (parv [1 ]) || EmptyString (parv [2 ]))
153- {
154- sendto_one (source_p , form_str (ERR_NEEDMOREPARAMS ), me .name , source_p -> name , "QUARANTINE" );
155- return ;
156- }
157-
158152 struct Client * target_p = find_named_person (parv [1 ]);
159153 if (target_p == NULL )
160154 {
@@ -172,12 +166,6 @@ mo_quarantine(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *s
172166static void
173167me_quarantine (struct MsgBuf * msgbuf_p , struct Client * client_p , struct Client * source_p , int parc , const char * parv [])
174168{
175- if (parc < 3 || EmptyString (parv [1 ]) || EmptyString (parv [2 ]))
176- {
177- sendto_one (source_p , form_str (ERR_NEEDMOREPARAMS ), me .name , source_p -> name , "QUARANTINE" );
178- return ;
179- }
180-
181169 struct Client * target_p = find_named_person (parv [1 ]);
182170 if (target_p == NULL )
183171 {
@@ -200,12 +188,6 @@ mo_unquarantine(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client
200188 return ;
201189 }
202190
203- if (parc < 2 || EmptyString (parv [1 ]))
204- {
205- sendto_one (source_p , form_str (ERR_NEEDMOREPARAMS ), me .name , source_p -> name , "UNQUARANTINE" );
206- return ;
207- }
208-
209191 struct Client * target_p = find_named_person (parv [1 ]);
210192 if (target_p == NULL )
211193 {
@@ -223,12 +205,6 @@ mo_unquarantine(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client
223205static void
224206me_unquarantine (struct MsgBuf * msgbuf_p , struct Client * client_p , struct Client * source_p , int parc , const char * parv [])
225207{
226- if (parc < 2 || EmptyString (parv [1 ]))
227- {
228- sendto_one (source_p , form_str (ERR_NEEDMOREPARAMS ), me .name , source_p -> name , "UNQUARANTINE" );
229- return ;
230- }
231-
232208 struct Client * target_p = find_named_person (parv [1 ]);
233209 if (target_p == NULL )
234210 {
@@ -514,8 +490,8 @@ quarantine_privmsg_channel(void *data_)
514490
515491 data -> approved = ERR_CANNOTSENDTOCHAN ;
516492
517- /* Don't give error messages for TAGMSG since many clients autogenerate these (e.g. +typing) */
518- if (data -> msgtype != MESSAGE_TYPE_TAGMSG )
493+ /* Don't give error messages for non-PRIVMSG since many clients autogenerate these (e.g. +typing) */
494+ if (data -> msgtype == MESSAGE_TYPE_PRIVMSG )
519495 sendto_one_numeric (data -> source_p , ERR_CANNOTSENDTOCHAN , "%s :%s" ,
520496 data -> chptr -> chname ,
521497 EmptyString (msg_reason ) ? DEFAULT_MSG_REASON : msg_reason );
@@ -536,7 +512,7 @@ quarantine_privmsg_user(void *data_)
536512 {
537513 if (IsQuarantined (data -> target_p ) && !IsOper (data -> source_p ) && !IsService (data -> source_p ))
538514 {
539- if (data -> msgtype != MESSAGE_TYPE_TAGMSG )
515+ if (data -> msgtype == MESSAGE_TYPE_PRIVMSG )
540516 sendto_one_numeric (data -> source_p , ERR_CANNOTSENDTOUSER , form_str (ERR_CANNOTSENDTOUSER ),
541517 data -> target_p -> name ,
542518 EmptyString (other_msg_reason ) ? DEFAULT_OTHER_MSG_REASON : other_msg_reason );
@@ -551,8 +527,8 @@ quarantine_privmsg_user(void *data_)
551527
552528 data -> approved = ERR_CANNOTSENDTOCHAN ;
553529
554- /* Don't give error messages for TAGMSG since many clients autogenerate these (e.g. +typing) */
555- if (data -> msgtype != MESSAGE_TYPE_TAGMSG )
530+ /* Don't give error messages for non-PRIVMSG since many clients autogenerate these (e.g. +typing) */
531+ if (data -> msgtype == MESSAGE_TYPE_PRIVMSG )
556532 sendto_one_numeric (data -> source_p , ERR_CANNOTSENDTOCHAN , "%s :%s" ,
557533 data -> target_p -> name ,
558534 EmptyString (msg_reason ) ? DEFAULT_MSG_REASON : msg_reason );
0 commit comments