forked from External/ergo
Enable chanmode +r, fix bug with registering channels
This commit is contained in:
parent
317a804644
commit
0046025d60
5 changed files with 27 additions and 15 deletions
|
|
@ -952,6 +952,10 @@ func privmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
|||
client.Send(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, targetString, "No such channel")
|
||||
continue
|
||||
}
|
||||
if !channel.CanSpeak(client) {
|
||||
client.Send(nil, client.server.name, ERR_CANNOTSENDTOCHAN, channel.name, "Cannot send to channel")
|
||||
continue
|
||||
}
|
||||
msgid := server.generateMessageID()
|
||||
channel.SplitPrivMsg(msgid, lowestPrefix, clientOnlyTags, client, splitMsg)
|
||||
} else {
|
||||
|
|
@ -1017,6 +1021,10 @@ func tagmsgHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|||
client.Send(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, targetString, "No such channel")
|
||||
continue
|
||||
}
|
||||
if !channel.CanSpeak(client) {
|
||||
client.Send(nil, client.server.name, ERR_CANNOTSENDTOCHAN, channel.name, "Cannot send to channel")
|
||||
continue
|
||||
}
|
||||
msgid := server.generateMessageID()
|
||||
|
||||
channel.TagMsg(msgid, lowestPrefix, clientOnlyTags, client)
|
||||
|
|
@ -1610,6 +1618,10 @@ func noticeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|||
// errors silently ignored with NOTICE as per RFC
|
||||
continue
|
||||
}
|
||||
if !channel.CanSpeak(client) {
|
||||
// errors silently ignored with NOTICE as per RFC
|
||||
continue
|
||||
}
|
||||
msgid := server.generateMessageID()
|
||||
channel.SplitNotice(msgid, lowestPrefix, clientOnlyTags, client, splitMsg)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue