From 00cb05712021d4abb6c864eedd0a085c0402c218 Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Thu, 11 Aug 2016 22:31:18 +0200 Subject: [PATCH] Preparations for clustering ability --- server.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server.go b/server.go index 6b1c44a..6b0207f 100644 --- a/server.go +++ b/server.go @@ -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 {