X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=daemon.go;h=3afda4fb0a3d8b69897e8e160cf09e4c77af6ab4;hb=4f1a1012b252f0090b150672bb55268621368498;hp=80a3229b4f7ec9735617d5b9835c5a76f7c4c80f;hpb=e657ffd2ab2cd5fae8c1d19e39b2268fa758153e;p=goircd.git diff --git a/daemon.go b/daemon.go index 80a3229..3afda4f 100644 --- a/daemon.go +++ b/daemon.go @@ -67,7 +67,7 @@ func SendMotd(client *Client) { return } client.ReplyNicknamed("375", "- "+*hostname+" Message of the day -") - for _, s := range strings.Split(strings.Trim(string(motdText), "\n"), "\n") { + for _, s := range strings.Split(strings.TrimSuffix(string(motdText), "\n"), "\n") { client.ReplyNicknamed("372", "- "+s) } client.ReplyNicknamed("376", "End of /MOTD command") @@ -258,7 +258,7 @@ func HandlerJoin(client *Client, cmd string) { } for roomExisting, roomSink = range roomSinks { if room == *roomExisting.name { - if (roomExisting.key != nil) && (*roomExisting.key != key) { + if (*roomExisting.key != "") && (*roomExisting.key != key) { goto Denied } roomSink <- ClientEvent{client, EventNew, ""}