Browse Source

Reworked auto join for new format

release/0.19
Jessica James 8 years ago
parent
commit
9e5ce1fce6
  1. 22
      Jupiter/IRC_Client.cpp

22
Jupiter/IRC_Client.cpp

@ -782,14 +782,22 @@ int Jupiter::IRC::Client::process_line(const Jupiter::ReadableString &line)
Jupiter::IRC::Client::send(value); Jupiter::IRC::Client::send(value);
i++; i++;
} }
key = "Channel.";
i = 1; auto auto_join_channels_callback = [this](Jupiter::Config::SectionHashTable::Bucket::Entry &in_entry)
while (config_loop_condition())
{ {
key.truncate(offset); if (in_entry.value.get<bool>("AutoJoin"_jrs, false))
Jupiter::IRC::Client::joinChannel(value); this->joinChannel(in_entry.value.getName());
i++; };
}
Jupiter::Config *config = m_primary_section->getSection("Channels"_jrs);
if (config != nullptr)
config->getSections().callback(auto_join_channels_callback);
config = m_secondary_section->getSection("Channels"_jrs);
if (config != nullptr)
config->getSections().callback(auto_join_channels_callback);
m_connection_status = 5; m_connection_status = 5;
m_reconnect_attempts = 0; m_reconnect_attempts = 0;

Loading…
Cancel
Save