]> Cypherpunks.ru repositories - goircd.git/commitdiff
ISON command support
authorSergey Matveev <stargrave@stargrave.org>
Sat, 14 Nov 2015 15:54:34 +0000 (18:54 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 14 Nov 2015 15:54:34 +0000 (18:54 +0300)
README
daemon.go

diff --git a/README b/README
index 0a118097357d6ed3a60c7365c21d58ee7c056df7..f3a0ec039a017558de08430c0cd324f7e4d8eb30 100644 (file)
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
 DESCRIPTION
 
 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.
 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
 * PING/PONGs
-* NOTICE/PRIVMSG
+* NOTICE/PRIVMSG, ISON
 * AWAY, MOTD, LUSERS, WHO, WHOIS, VERSION, QUIT
 * LIST, JOIN, TOPIC, +k/-k channel MODE
 
index b795a0c3410e87d5a9dbb61d0753ce5e9d59fa57..1af9712616a383ad1a3b869bf3143e85756dd037 100644 (file)
--- a/daemon.go
+++ b/daemon.go
@@ -486,6 +486,22 @@ func Processor(events chan ClientEvent, finished chan struct{}) {
                                cols := strings.Split(cols[1], " ")
                                nicknames := strings.Split(cols[len(cols)-1], ",")
                                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":
                                var debug string
                                if *verbose {