]> Cypherpunks.ru repositories - goircd.git/blobdiff - daemon.go
Do not alter MOTD
[goircd.git] / daemon.go
index 80a3229b4f7ec9735617d5b9835c5a76f7c4c80f..3afda4fb0a3d8b69897e8e160cf09e4c77af6ab4 100644 (file)
--- 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, ""}