Remove port from /whois output.
This commit is contained in:
parent
41f9649494
commit
a154bd6120
|
@ -21,6 +21,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
"net"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -98,7 +99,13 @@ func (daemon *Daemon) SendWhois(client *Client, nicknames []string) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
found = true
|
found = true
|
||||||
client.ReplyNicknamed("311", c.nickname, c.username, c.conn.RemoteAddr().String(), "*", c.realname)
|
h := c.conn.RemoteAddr().String()
|
||||||
|
h, _, err := net.SplitHostPort(h)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Can't parse RemoteAddr %q: %v", h, err)
|
||||||
|
h = "Unknown"
|
||||||
|
}
|
||||||
|
client.ReplyNicknamed("311", c.nickname, c.username, h, "*", c.realname)
|
||||||
client.ReplyNicknamed("312", c.nickname, daemon.hostname, daemon.hostname)
|
client.ReplyNicknamed("312", c.nickname, daemon.hostname, daemon.hostname)
|
||||||
subscriptions := []string{}
|
subscriptions := []string{}
|
||||||
for _, room := range daemon.rooms {
|
for _, room := range daemon.rooms {
|
||||||
|
|
Loading…
Reference in New Issue