Do not prepend unnecessary ':' to person-to-person PRIVMSGs

This commit is contained in:
Sergey Matveev 2014-06-27 22:29:31 +04:00
parent 564374f324
commit 60bd9cec0b
2 changed files with 2 additions and 2 deletions

View File

@ -377,7 +377,7 @@ func (daemon *Daemon) Processor(events <-chan ClientEvent) {
target := strings.ToLower(cols[0]) target := strings.ToLower(cols[0])
for c := range daemon.clients { for c := range daemon.clients {
if c.nickname == target { if c.nickname == target {
msg = fmt.Sprintf(":%s %s %s :%s", client, command, c.nickname, cols[1]) msg = fmt.Sprintf(":%s %s %s %s", client, command, c.nickname, cols[1])
c.Msg(msg) c.Msg(msg)
break break
} }

View File

@ -83,7 +83,7 @@ func TestTwoUsers(t *testing.T) {
<-conn1.outbound <-conn1.outbound
<-conn2.outbound <-conn2.outbound
} }
conn1.inbound <- "PRIVMSG nick2 Hello" conn1.inbound <- "PRIVMSG nick2 :Hello"
conn1.inbound <- "PRIVMSG #foo :world" conn1.inbound <- "PRIVMSG #foo :world"
conn1.inbound <- "NOTICE #foo :world" conn1.inbound <- "NOTICE #foo :world"
if r := <-conn2.outbound; r != ":nick1!foo1@someclient PRIVMSG nick2 :Hello\r\n" { if r := <-conn2.outbound; r != ":nick1!foo1@someclient PRIVMSG nick2 :Hello\r\n" {