Previously you would have to do something like this:
for (type foo = (type) list_get_first(list); foo; foo = (type) list_get_next(list)
{
/* code */
}
Now, you can instead write this as:
LIST_FOREACH(type, foo, list,
{
/* code */
})
Basically, boilerplate stuff including the casting is gone.
Assuming the argument definition "?xy", it was previously not possible
to specify only x. Also, the syntax will now be shown as "[x [y]]"
instead of "[x] [y]".
Load plugin mod_topic, and it will provide 3 new user commands:
!topic - set new topic
!cleartopic - reset the topic (use default hub description)
!showtopic - show the current topic
Fix bug #185 - Args of !commands lost/damaged.
All string arguments were incorrectly freed after being added to the argument list for a command.
Instead this fix makes sure it is properly copied into a new string, and by doing so this requires
a new API for dealing with hub command arguments in a type safe manner, and also allows for each
argument to be cleaned up properly when the command is no longer needed.
This also fixes issues with parse errors for certain types, and optional arguments (previously it was impossible
to tell the difference for an integer with value 0 or if no integer was given).
All arguments can now be accessed through the new functions
hub_command_arg_reset() and hub_command_arg_next().
These functions are also exposed to plug-ins.
The argument type notations for 'n' has changed to mean nick (string),
and 'u' is used for a user (struct hub_user - must be online).
The mod_chat_history plugin provides chat history for all public chat messages.
Can be configured in the following ways:
- history_max: max number of messages stored in history
- history_default: the default number of messages to be returned when invoking !history
- history_connect: if > 0, then this number of messages is automatically sent when connecting to the hub
Removed the built-in !history command in favour of the mod_chat_history plug-in.
Make sure we unescape all chat messages before forwarding any of them to plugins.
Update example plugins.conf in documentation directory.
Dynamic commands are user commands that can be added dynamically to
the hub by a plugin.
The example plugin (mod_example.c) adds a !example command that when
invoked send a message to the user who invoked it.
- Don't link with -ldl, as it is not needed in most cases
- Don't compile plugins if USE_PLUGINS=NO
- Fix warning about missing newline at end of getopt.h
- Removed the O_NOATIME open() flag from the logging plugin.
- Removed the O_LARGEFILE open() flag. _FILE_OFFSET_BITS is 64.
- Use fsync() if fdatasync() is not available for log file writing.
- Replaced some sprintf() with snprintf() due to compiler warnings (though, they were length limited otherwise).
- Replaced two occurences of strcpy() with memcpy().