fix for bug [ #7724 ] VOP don't have permission to chat while channel is moderated

This commit is contained in:
Pelish 2008-10-08 21:51:16 +00:00
parent 262b6d4da8
commit cf9849a112

View file

@ -647,6 +647,7 @@ extern void channel_message_send(t_channel const * channel, t_message_type type,
// or everyone when channel has no clienttag set // or everyone when channel has no clienttag set
t_message * message2; //send to people with clienttag not matching channel clienttag t_message * message2; //send to people with clienttag not matching channel clienttag
t_message * message_to_send; t_message * message_to_send;
t_account * acc;
if (!channel) if (!channel)
@ -660,6 +661,8 @@ extern void channel_message_send(t_channel const * channel, t_message_type type,
return; return;
} }
acc = conn_get_account(me);
if(channel_get_flags(channel) & channel_flags_thevoid) // no talking in the void if(channel_get_flags(channel) & channel_flags_thevoid) // no talking in the void
if (type!=message_type_join && type!=message_type_part) if (type!=message_type_join && type!=message_type_part)
return; return;
@ -668,8 +671,8 @@ extern void channel_message_send(t_channel const * channel, t_message_type type,
{ {
if (type==message_type_talk || type==message_type_emote) if (type==message_type_talk || type==message_type_emote)
{ {
if (!((account_is_operator_or_admin(conn_get_account(me),channel_get_name(channel))) || if (!((account_is_operator_or_admin(acc,channel_get_name(channel))) ||
(channel_conn_has_tmpVOICE(channel,me)))) (channel_conn_has_tmpVOICE(channel,me)) || (account_get_auth_voice(acc,channel_get_name(channel)) == 1) ))
{ {
message_send_text(me,message_type_error,me,"This channel is moderated"); message_send_text(me,message_type_error,me,"This channel is moderated");
return; return;