Fix silent channel not working.
[umurmur.git] / src / channel.c
index 22d909f0e14efccdcfec7d13ac7f7df087be58c2..d5d873cae3c7f25ed203eb30fab5411dd94b2c39 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2009-2011, Martin Johansson <martin@fatbob.nu>
-   Copyright (C) 2005-2011, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2013, Martin Johansson <martin@fatbob.nu>
+   Copyright (C) 2005-2013, Thorvald Natvig <thorvald@natvig.com>
 
    All rights reserved.
 
@@ -153,6 +153,7 @@ void Chan_init()
                if (i == 0) {
                        rootChan = createChannel(0, chdesc.name, chdesc.description);
                        rootChan->noenter = chdesc.noenter;
+                       rootChan->silent = chdesc.silent;
                        list_add_tail(&rootChan->flatlist_node, &channels);
                        if (strcmp(defaultChannelName, chdesc.name) == 0)
                                defaultChan = rootChan;
@@ -161,10 +162,14 @@ void Chan_init()
                        channel_t *ch, *ch_itr = NULL;
                        ch = Chan_createChannel(chdesc.name, chdesc.description);
                        ch->noenter = chdesc.noenter;
-                       if (chdesc.password)
+                       ch->position = chdesc.position;
+                       ch->silent = chdesc.silent;
+                       if (chdesc.password) {
+                               Log_info("Setting password on channel '%s'", ch->name); 
                                ch->password = strdup(chdesc.password);
+                       }
                        if (strcmp(defaultChannelName, chdesc.name) == 0) {
-                               Log_info("Setting default channel %s", ch->name); 
+                               Log_info("Setting default channel '%s'", ch->name); 
                                defaultChan = ch;
                        }
                        
@@ -173,7 +178,7 @@ void Chan_init()
                        } while (ch_itr != NULL && strcmp(ch_itr->name, chdesc.parent) != 0);
                        
                        if (ch_itr == NULL)
-                               Log_fatal("Error in channel configuration: parent not found");
+                               Log_fatal("Error in channel configuration: parent '%s' not found", chdesc.parent);
                        else {
                                Chan_addChannel(ch_itr, ch);
                                Log_info("Adding channel '%s' parent '%s'", ch->name, chdesc.parent);