swap nick+lastMessage tracking / replace with just nick tracking (fixes double-post of /me messages)
--HG-- branch : nmdc-ircfrontend
This commit is contained in:
parent
36ad701b3b
commit
5c184766a1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user