717 |
|
/*! |
718 |
|
* \param chptr pointer to Channel struct |
719 |
|
* \param source_p pointer to Client struct |
720 |
+ |
* \param ms pointer to Membership struct (can be NULL) |
721 |
|
* \return CAN_SEND_OPV if op or voiced on channel\n |
722 |
|
* CAN_SEND_NONOP if can send to channel but is not an op\n |
723 |
|
* CAN_SEND_NO if they cannot send to channel\n |
724 |
|
*/ |
725 |
|
int |
726 |
< |
can_send(struct Channel *chptr, struct Client *source_p) |
726 |
> |
can_send(struct Channel *chptr, struct Client *source_p, struct Membership *ms) |
727 |
|
{ |
727 |
– |
struct Membership *ms = NULL; |
728 |
– |
|
728 |
|
if (IsServer(source_p)) |
729 |
|
return CAN_SEND_OPV; |
730 |
|
|
733 |
|
(!hash_find_resv(chptr->chname) == ConfigChannel.restrict_channels)) |
734 |
|
return CAN_SEND_NO; |
735 |
|
|
736 |
< |
if ((ms = find_channel_link(source_p, chptr)) == NULL) |
738 |
< |
{ |
739 |
< |
if (chptr->mode.mode & MODE_NOPRIVMSGS) |
740 |
< |
return CAN_SEND_NO; |
741 |
< |
} |
742 |
< |
else |
736 |
> |
if (ms != NULL || (ms = find_channel_link(source_p, chptr))) |
737 |
|
{ |
738 |
|
if (ms->flags & (CHFL_CHANOP|CHFL_HALFOP|CHFL_VOICE)) |
739 |
|
return CAN_SEND_OPV; |
757 |
|
} |
758 |
|
} |
759 |
|
|
760 |
< |
if (chptr->mode.mode & MODE_MODERATED) |
767 |
< |
return CAN_SEND_NO; |
768 |
< |
|
769 |
< |
return CAN_SEND_NONOP; |
770 |
< |
} |
771 |
< |
|
772 |
< |
/*! \brief Checks to see if given client can send a part message |
773 |
< |
* \param member pointer to channel membership |
774 |
< |
* \param chptr pointer to channel struct |
775 |
< |
* \param source_p pointer to struct Client to check |
776 |
< |
*/ |
777 |
< |
int |
778 |
< |
can_send_part(struct Membership *member, struct Channel *chptr, |
779 |
< |
struct Client *source_p) |
780 |
< |
{ |
781 |
< |
if (has_member_flags(member, CHFL_CHANOP|CHFL_HALFOP)) |
782 |
< |
return CAN_SEND_OPV; |
783 |
< |
|
784 |
< |
if (chptr->mode.mode & MODE_MODERATED) |
785 |
< |
return CAN_SEND_NO; |
786 |
< |
|
787 |
< |
if (ConfigChannel.quiet_on_ban && MyClient(source_p) && |
788 |
< |
is_banned(chptr, source_p)) |
760 |
> |
if (chptr->mode.mode & (MODE_MODERATED|MODE_NOPRIVMSGS)) |
761 |
|
return CAN_SEND_NO; |
762 |
|
|
763 |
|
return CAN_SEND_NONOP; |