Commit Graph

30 Commits

Author SHA1 Message Date
Tilka
eb49174ab3 marked plugin callbacks that are not called yet 2012-05-10 01:37:20 +02:00
Tilka
9e52ea7eff add on_change_nick() to struct plugin_funcs
It's not called anywhere yet.
Also reorder some typedefs, rename the ip check functions and add
struct {hub,plugin}_user parameter to on_check_ip_late(). Not sure where
to insert a call to that...
2012-05-09 23:33:03 +02:00
Tilka
05fd6bb723 minimal changes 2012-05-09 23:27:06 +02:00
Jan Vidar Krey
55030935a7 Merge https://github.com/Tilka/uhub 2012-04-19 23:17:39 +02:00
Tilka
e925db2b98 small cleanup 2012-04-19 02:56:27 +02:00
Jan Vidar Krey
1dba731cc3 Fix bug #158 - Added plugin for setting topic (hub description).
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
2012-04-19 00:33:38 +02:00
Jan Vidar Krey
df7bbc094f Command arguments handling + cleanups
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).
2012-04-18 23:03:05 +02:00
Jan Vidar Krey
eee2636582 Added a chat only hub plugin that disables searching and connection setup.
This also deprecates the built-in chat_only configuration option.
If you need this functionality, then load the mod_chat_only plugin (if it is loaded then only operators
are able to search, connect, etc).
2012-01-09 20:58:19 +01:00
Jan Vidar Krey
f2cb84180a Refactored command parsing.
Allows for automatically tested command parsing by splitting parsing
and invokation of the commands.
2011-12-19 00:34:45 +01:00
Jan Vidar Krey
7825c413d4 fixup! Added support for dynamic commands. 2011-12-09 13:04:05 +01:00
Jan Vidar Krey
318163c066 Added support for dynamic commands.
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.
2011-12-09 10:29:50 +01:00
Jan Vidar Krey
39572c3684 Made plugin loading work properly on Windows. 2011-09-08 01:00:32 +02:00
Jan Vidar Krey
800f6a70f9 Added description to plugin_hub_info (an empty struct causes warning on VS2010). 2011-09-05 23:40:57 +02:00
Jan Vidar Krey
ebe54bcf27 Added plugin events for server wide events (mostly for logging). 2011-08-16 15:11:15 +02:00
Jan Vidar Krey
21c22288a2 Simplified plugin initialization by using a macro. 2010-11-12 18:03:39 +01:00
Jan Vidar Krey
35b055f9b7 Allow for connections accepted/refused to be logged by plugins. 2010-08-11 22:46:06 +02:00
Jan Vidar Krey
4c960cb977 Added logging of chat messages in the plugin API. 2010-08-11 22:46:06 +02:00
Jan Vidar Krey
c2b7ecd49c Made sure the logging plugin logs on a format that looks almost the same as we used to have in the past. 2010-08-04 17:03:37 +02:00
Jan Vidar Krey
0c6a58d35a Make sure chat messages are routed through plugins. 2010-08-03 23:19:39 +02:00
Jan Vidar Krey
93be2c584e Reworked plugin APIs slightly, added full support for authentication from plugins. 2010-07-29 08:43:22 +02:00
Jan Vidar Krey
350791cdf8 Added plugin invokers for authentication code. 2010-07-23 01:23:13 +02:00
Jan Vidar Krey
c6cf03614f Implement more plugin invokers, and call them. 2010-07-23 00:38:11 +02:00
Jan Vidar Krey
bdcf35b63d Cleanup code and allow for plugins to provide an error message. 2010-07-19 01:36:23 +02:00
Jan Vidar Krey
56e5557146 Cleaned up the credentials handling, and made it ready for plugins. 2010-07-12 19:05:50 +02:00
Jan Vidar Krey
aa26052479 Misc plugin work
* Fix crash when unloading plugins.
* Fixed plugin loader and plugin unload handler.
* Added a new example plugin: mod_logging which logs users logging in and out of the hub to stdout.
2010-06-29 15:40:19 +02:00
Jan Vidar Krey
ccaa4860b4 Started working on the plugin configuration and loader code.
The example plugin works, but does not do anything.
2010-06-13 19:34:20 +02:00
Jan Vidar Krey
7218011449 Added missing plugin file. 2010-06-07 15:42:38 +02:00
Jan Vidar Krey
07d4e4470c More work on the plugin API. 2010-06-06 16:19:59 +02:00
Jan Vidar Krey
ed53034ad5 Added plugin loader code, merely a wrapper around dlopen() and friends. 2010-05-30 23:33:06 +02:00
Jan Vidar Krey
fc8965f1c5 Started working on an authentication plugin API. 2010-05-30 13:03:03 +02:00