3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

reuse replies where possible

This commit is contained in:
Jeremy Latt 2014-03-27 19:04:34 -07:00
parent 3b12dec207
commit 63a46498ce
2 changed files with 8 additions and 4 deletions

View File

@ -244,11 +244,12 @@ func (channel *Channel) PrivMsg(client *Client, message Text) {
client.ErrCannotSendToChan(channel)
return
}
reply := RplPrivMsg(client, channel, message)
for member := range channel.members {
if member == client {
continue
}
member.Reply(RplPrivMsg(client, channel, message))
member.Reply(reply)
}
}
@ -458,11 +459,12 @@ func (channel *Channel) Notice(client *Client, message Text) {
client.ErrCannotSendToChan(channel)
return
}
reply := RplNotice(client, channel, message)
for member := range channel.members {
if member == client {
continue
}
member.Reply(RplNotice(client, channel, message))
member.Reply(reply)
}
}

View File

@ -89,8 +89,9 @@ func (m *TheaterPrivMsgCommand) HandleServer(s *Server) {
return
}
reply := RplPrivMsg(TheaterClient(m.asNick), channel, m.message)
for member := range channel.members {
member.Reply(RplPrivMsg(TheaterClient(m.asNick), channel, m.message))
member.Reply(reply)
}
}
@ -124,7 +125,8 @@ func (m *TheaterActionCommand) HandleServer(s *Server) {
return
}
reply := RplCTCPAction(TheaterClient(m.asNick), channel, m.action)
for member := range channel.members {
member.Reply(RplCTCPAction(TheaterClient(m.asNick), channel, m.action))
member.Reply(reply)
}
}