ISON command support
This commit is contained in:
parent
f93640a335
commit
7770e09e68
4
README
4
README
@ -4,7 +4,7 @@
|
|||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
||||||
goircd is very simple IRC server, written on Go.
|
goircd is very simple IRC server, written on Go.
|
||||||
It is heavily inspired by miniircd daemon written on Python.
|
It was heavily inspired by miniircd daemon written on Python.
|
||||||
GoVPN is free software: see the file COPYING for copying conditions.
|
GoVPN is free software: see the file COPYING for copying conditions.
|
||||||
It does not aim to replace full featured mass scalable IRC networks:
|
It does not aim to replace full featured mass scalable IRC networks:
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ SUPPORTED IRC COMMANDS
|
|||||||
|
|
||||||
* PASS/NICK/USER during registration workflow
|
* PASS/NICK/USER during registration workflow
|
||||||
* PING/PONGs
|
* PING/PONGs
|
||||||
* NOTICE/PRIVMSG
|
* NOTICE/PRIVMSG, ISON
|
||||||
* AWAY, MOTD, LUSERS, WHO, WHOIS, VERSION, QUIT
|
* AWAY, MOTD, LUSERS, WHO, WHOIS, VERSION, QUIT
|
||||||
* LIST, JOIN, TOPIC, +k/-k channel MODE
|
* LIST, JOIN, TOPIC, +k/-k channel MODE
|
||||||
|
|
||||||
|
16
daemon.go
16
daemon.go
@ -486,6 +486,22 @@ func Processor(events chan ClientEvent, finished chan struct{}) {
|
|||||||
cols := strings.Split(cols[1], " ")
|
cols := strings.Split(cols[1], " ")
|
||||||
nicknames := strings.Split(cols[len(cols)-1], ",")
|
nicknames := strings.Split(cols[len(cols)-1], ",")
|
||||||
SendWhois(client, nicknames)
|
SendWhois(client, nicknames)
|
||||||
|
case "ISON":
|
||||||
|
if len(cols) == 1 || len(cols[1]) < 1 {
|
||||||
|
client.ReplyNotEnoughParameters("ISON")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
nicksKnown := make(map[string]struct{})
|
||||||
|
for c := range clients {
|
||||||
|
nicksKnown[*c.nickname] = struct{}{}
|
||||||
|
}
|
||||||
|
var nicksExists []string
|
||||||
|
for _, nickname := range strings.Split(cols[1], " ") {
|
||||||
|
if _, exists := nicksKnown[nickname]; exists {
|
||||||
|
nicksExists = append(nicksExists, nickname)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
client.ReplyNicknamed("303", strings.Join(nicksExists, " "))
|
||||||
case "VERSION":
|
case "VERSION":
|
||||||
var debug string
|
var debug string
|
||||||
if *verbose {
|
if *verbose {
|
||||||
|
Loading…
Reference in New Issue
Block a user