diff --git a/server.go b/server.go index 980b09f..886a358 100644 --- a/server.go +++ b/server.go @@ -50,8 +50,6 @@ type Server struct { verbose bool autojoin bool - - lastMessage string // FIXME racey } func NewServer(name string, upstream libnmdc.HubAddress, conn net.Conn) *Server { @@ -178,8 +176,8 @@ func (s *Server) upstreamWorker() { s.reply(rplMsg, hubEvent.Nick+"!"+hubEvent.Nick+"@"+hubEvent.Nick, s.upstreamLauncher.Self.Nick, hubEvent.Message) case libnmdc.EVENT_PUBLIC: - if hubEvent.Nick == s.upstreamLauncher.Self.Nick && hubEvent.Message == s.lastMessage { - s.lastMessage = "" // irc doesn't echo our own pubchat + if hubEvent.Nick == s.upstreamLauncher.Self.Nick { + // irc doesn't echo our own pubchat } else { // s.reply(rplMsg, hubEvent.Nick, BLESSED_CHANNEL, hubEvent.Message) s.reply(rplMsg, hubEvent.Nick+"!"+hubEvent.Nick+"@"+hubEvent.Nick, BLESSED_CHANNEL, hubEvent.Message) @@ -364,8 +362,7 @@ func (s *Server) handleRegisteredCommand(command string, args []string) { // channel name, but not really for user nicks if strings.ToLower(args[0]) == BLESSED_CHANNEL { - s.lastMessage = message - s.upstream.SayPublic(s.lastMessage) + s.upstream.SayPublic(message) } else if _, clientExists := s.upstream.Users[args[0]]; clientExists { s.upstream.SayPrivate(args[0], message)