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
|
verbose bool
|
||||||
autojoin bool
|
autojoin bool
|
||||||
|
|
||||||
lastMessage string // FIXME racey
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServer(name string, upstream libnmdc.HubAddress, conn net.Conn) *Server {
|
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)
|
s.reply(rplMsg, hubEvent.Nick+"!"+hubEvent.Nick+"@"+hubEvent.Nick, s.upstreamLauncher.Self.Nick, hubEvent.Message)
|
||||||
|
|
||||||
case libnmdc.EVENT_PUBLIC:
|
case libnmdc.EVENT_PUBLIC:
|
||||||
if hubEvent.Nick == s.upstreamLauncher.Self.Nick && hubEvent.Message == s.lastMessage {
|
if hubEvent.Nick == s.upstreamLauncher.Self.Nick {
|
||||||
s.lastMessage = "" // irc doesn't echo our own pubchat
|
// irc doesn't echo our own pubchat
|
||||||
} else {
|
} else {
|
||||||
// s.reply(rplMsg, hubEvent.Nick, BLESSED_CHANNEL, hubEvent.Message)
|
// s.reply(rplMsg, hubEvent.Nick, BLESSED_CHANNEL, hubEvent.Message)
|
||||||
s.reply(rplMsg, hubEvent.Nick+"!"+hubEvent.Nick+"@"+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
|
// channel name, but not really for user nicks
|
||||||
|
|
||||||
if strings.ToLower(args[0]) == BLESSED_CHANNEL {
|
if strings.ToLower(args[0]) == BLESSED_CHANNEL {
|
||||||
s.lastMessage = message
|
s.upstream.SayPublic(message)
|
||||||
s.upstream.SayPublic(s.lastMessage)
|
|
||||||
|
|
||||||
} else if _, clientExists := s.upstream.Users[args[0]]; clientExists {
|
} else if _, clientExists := s.upstream.Users[args[0]]; clientExists {
|
||||||
s.upstream.SayPrivate(args[0], message)
|
s.upstream.SayPrivate(args[0], message)
|
||||||
|
Loading…
Reference in New Issue
Block a user