+
+ if (defaultChan->noenter)
+ Log_fatal("Error in channel configuration: default channel is marked as noenter");
+ if (defaultChan->password)
+ Log_fatal("Error in channel configuration: default channel has a password");
+
+ /* Channel links */
+ for (i = 0; ; i++) {
+ channel_t *ch_src, *ch_dst, *ch_itr = NULL;
+ channellist_t *chl;
+ if (Conf_getNextChannelLink(&chlink, i) < 0) {
+ if (i == 0)
+ Log_info("No channel links found in configuration file.");
+ break;
+ }
+ ch_itr = NULL;
+ do {
+ Chan_iterate(&ch_itr);
+ } while (ch_itr != NULL && strcmp(ch_itr->name, chlink.source) != 0);
+ if (ch_itr == NULL)
+ Log_fatal("Error in channel link configuration: source channel '%s' not found.",
+ chlink.source);
+ else
+ ch_src = ch_itr;
+
+ ch_itr = NULL;
+ do {
+ Chan_iterate(&ch_itr);
+ } while (ch_itr != NULL && strcmp(ch_itr->name, chlink.destination) != 0);
+ if (ch_itr == NULL)
+ Log_fatal("Error in channel link configuration: destination channel '%s' not found",
+ chlink.destination);
+ else
+ ch_dst = ch_itr;
+
+ chl = Memory_safeMalloc(1, sizeof(channellist_t));
+ chl->chan = ch_dst;
+ init_list_entry(&chl->node);
+ list_add_tail(&chl->node, &ch_src->channel_links);
+ ch_src->linkcount++;
+ Log_info("Adding channel link '%s' -> '%s'", ch_src->name, ch_dst->name);
+ }