X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=daemon.go;h=a5b2d77dcd822d257132fe045cee53473bf89757;hb=1f4a463c0a9fb411827916c0df60df4538702307;hp=59d6372b4a64b3e611e28cfd48ac53737ad69e8e;hpb=043730c35562365191764faf321424eb7bec0513;p=goircd.git diff --git a/daemon.go b/daemon.go index 59d6372..a5b2d77 100644 --- a/daemon.go +++ b/daemon.go @@ -84,7 +84,7 @@ func (daemon *Daemon) SendMotd(client *Client) { } client.ReplyNicknamed("375", "- "+daemon.hostname+" Message of the day -") - for _, s := range bytes.Split(motd, []byte("\n")) { + for _, s := range bytes.Split(bytes.TrimRight(motd, "\n"), []byte("\n")) { client.ReplyNicknamed("372", "- "+string(s)) } client.ReplyNicknamed("376", "End of /MOTD command") @@ -239,7 +239,6 @@ func (daemon *Daemon) HandlerJoin(client *Client, cmd string) { } if denied { client.ReplyNicknamed("475", room, "Cannot join channel (+k) - bad key") - continue } if denied || joined { continue @@ -247,6 +246,7 @@ func (daemon *Daemon) HandlerJoin(client *Client, cmd string) { room_new, room_sink := daemon.RoomRegister(room) if key != "" { room_new.key = key + room_new.StateSave() } room_sink <- ClientEvent{client, EVENT_NEW, ""} } @@ -348,6 +348,7 @@ func (daemon *Daemon) Processor(events chan ClientEvent) { r, found := daemon.rooms[room] if !found { client.ReplyNoChannel(room) + continue } daemon.room_sinks[r] <- ClientEvent{client, EVENT_DEL, ""} } @@ -395,6 +396,7 @@ func (daemon *Daemon) Processor(events chan ClientEvent) { r, found := daemon.rooms[cols[0]] if !found { client.ReplyNoChannel(cols[0]) + continue } var change string if len(cols) > 1 { @@ -412,6 +414,7 @@ func (daemon *Daemon) Processor(events chan ClientEvent) { r, found := daemon.rooms[room] if !found { client.ReplyNoChannel(room) + continue } daemon.room_sinks[r] <- ClientEvent{client, EVENT_WHO, ""} case "WHOIS":