2005-01-12 Clinton Ebadi <clinton@unknownlamer.org>
+ * source/BotConfig.C (set_option_value): Put watcher calling
+ inside of if (cf_iter != end()) to fix a segfault (if the cf_iter
+ = end then there are no watchers since this is a new value and
+ references cf_iter->second segfaults)
+
+ * source/Utils.C (trim_str): Fixed bug (last non-space character
+ was being cut off)
+
* source/BotConfig.C (read_config): Made to use set_option_value
instead of manipulating options_db directly
* Abstract DCC support so that DCC FILE may be easily implemented
2.2:
-* Utils::isValidNickName should have a configurable max nick length
+* Utils::valid_nickname_p should have a configurable max nick length
(now that most networks allow for longer than nine character
nicks). This is dependant upon the new configuration system
* Finish adding commands to Scheme for sending messages
* Add util functions for doing stuff like quoting CTCP messages
* Finish adding hooks/send hooks
* Write Texinfo manual
-* Configuration Database
+* More Generic Configuration Database
* Improve the help system
* DCC FILE support (sending and recieving)
* XDCC file server script (requires DCC FILE support)
Networking:
* Add a networked interface to guile repl
- - This can be done as a script, but requires non-coop threads
- support to be done easily
+ - This can (should) be done as a script, but requires non-coop threads
+ support to be done easily (and thus requires Guile 1.8)
- Admins only
- Telnet
- Store authorized users and passwords in bot.telnet file
- Bot master can add new telnet users
- MUST HAVE PASSWORD
- - Maybe use SSL?
Definitely 3.0:
* Remove gh_* when Guile 1.8 is released
* Make it possible to use Scheme functions in the Parser itself
* Replace large select-loop in Bot::waitForInput with multithreaded
- CC++ sockets (this will require locking around everything Guile
- related). UPDATE[2002-11-02]: Guile CVS now has coop threads built
- on top of pthreads, which I could probably use when 1.8 nears
- release.
- UPDATE[2002-12-22]: Guile CVS now has support for full pthreads, no
- more coop stuff. After 1.8 is released threads will probably be
- used.
- To clarify: There will be one thread for DCCs and another thread
- for the current irc server connection, each with its own select
- loop. There may also be a thread for the network repls if I
- implement those.
+ for the current irc server connection, each with its own select
+ loop. There may also be a thread for the network repls if I
+ implement those.
* New config values in config db should be added before old values
(this is faster but breaks the way server lists work in 2.x)
\ No newline at end of file
StringTokenizer params (Utils::trim_str (st.next_token('=')));
set_option_value (command, params.rest (), true);
+ std::cerr << "done.\n";
+
+ for (t_options_db::const_iterator cit = options_db.begin ();
+ cit != options_db.end ();
+ ++cit)
+ std::cerr << "options_db[" << command << "] = " << options_db[command].first.front ()
+ << std::endl;
}
return true;
run_fun_ (std::string k, BotConfig::t_value_list& vl, bool a)
: key (k), vals (vl), appended (a)
- {}
-
+ { }
void operator() (BotConfig::t_watcher w)
{
w (key, vals, appended);
BotConfig::set_option_value (std::string key, t_value_list values,
bool append)
{
- t_options_db::iterator cf_iter = options_db.find (key);
key = Utils::to_upper (key); // keys are case insensitive
+ t_options_db::iterator cf_iter = options_db.find (key);
+
if (cf_iter != options_db.end ())
{
}
else
cf_iter->second.first = values;
+
+ // call watchers
+ std::for_each (cf_iter->second.second.begin (),
+ cf_iter->second.second.end (),
+ run_fun_ (key, values, append));
}
else
options_db[key] = t_option_values (values, t_watcher_list ());
-
- // Call Watchers
- std::for_each (cf_iter->second.second.begin (),
- cf_iter->second.second.end (),
- run_fun_ (key, values, append));
}
void
std::string
Utils::trim_str (std::string s)
{
- int i = 0, j = s.length () - 1;
+ int i = 0, j = s.length ();
while (i < j && std::isspace (s[i]))
i++;