mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-29 18:28:10 -07:00
Enable chanmode +r, fix bug with registering channels
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user