Preparations for clustering ability

This commit is contained in:
Andreas Neue 2016-08-11 22:31:18 +02:00
parent 5e43ee5d38
commit 00cb057120
1 changed files with 8 additions and 0 deletions

View File

@ -305,6 +305,7 @@ func (sv *Server) recvMsg(msg *irc.Message) {
hook.HookFn(sv, msg)
}
// Local delivery of an irc message to channel or client
func (sv *Server) sendMsg(msg *irc.Message) {
if strings.HasPrefix(msg.Args[0], "#") {
chid := strings.ToLower(msg.Args[0])
@ -331,6 +332,13 @@ func (sv *Server) sendMsg(msg *irc.Message) {
}
}
// Forward an irc message to cluster and deliver locally
func (sv *Server) forwardMsg(msg *irc.Message) {
sv.sendMsg(msg)
}
// Send irc reply to local client; drop, if server if client doesnt
// exists locally
func (sv *Server) sendReply(nick, cmd, args, trail string) {
clid := strings.ToLower(nick)
if _, exists := sv.clients[clid]; !exists {