Commit Graph

61 Commits

Author SHA1 Message Date
Boris Pek cf3a6e06df Secure URLs: http --> https (part 2) 2019-04-23 15:59:03 +02:00
Boris Pek ef83b31cec Fix spelling errors 2019-02-25 19:46:24 +01:00
Felix Brucker 99711a5c6e Allow many large messages 2018-10-11 23:29:32 +02:00
Felix Brucker e43aea35cc Use localtime instead of utc 2018-10-11 23:29:32 +02:00
Yorhel 90d05c9a19 mod_logging: Fix inverted if statement in syslog config check 2016-07-11 09:26:34 +00:00
mimicmod 96cc46117f Fix previous commit (Added sqlite VACUUM to cleanup commands)
Conflicts:
	src/plugins/mod_chat_history_sqlite.c
2014-11-25 15:46:35 +01:00
Michal Micka 5e63ab2ccd Fix: Chat history sqlite truncating long messages 2014-11-25 15:42:40 +01:00
Jan Vidar Krey 7706e1cb8a Fix copyright year. 2014-05-14 11:39:18 +02:00
Tillmann Karras c295461f4e mod_topic: check argument for NULL
Better safe than sorry.
2013-09-10 08:30:27 +02:00
Tilka a81757c483 Merge remote-tracking branch 'upstream/master' 2013-09-06 01:43:10 +02:00
mimicmod 5672ba14e3 Added mod_chat_history_sqlite and mod_chat_is_privileged.
Use file=/path/to/db to specify the database file where chat history should be stored. Other config variables are the same as those for mod_chat_history.

Code merged adapted and merged from Mimicmod's repository:
https://github.com/mimicmod/uhub.git
2013-03-23 22:47:32 +01:00
Jan Vidar Krey 52211a6bac Updated copyright year. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey f25015927a Clean up white space. 2013-03-22 20:00:40 +01:00
Jan Vidar Krey 2d6f69d299 Cleaned up usage of linked lists and added missing functionality.
- Added a list_remove_first() which is generally better than list_remove()
  provided you want to remove the first element.
- Added a list_append_list() to append and move all nodes from one list to
  another.
2013-03-22 20:00:40 +01:00
Jan Vidar Krey b81bb2cbd9 Cleaned up all list iterations, added macro named LIST_FOREACH.
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.
2013-03-22 00:58:14 +01:00
Tillmann Karras 37c80fd403 rename !cleartopic to !resettopic
The command resets the topic to the default as configured in uhub.conf.
"clear" wrongly implies that the topic will be emptied.

Also added a plugin description in plugins.conf.
2012-11-08 15:14:58 +01:00
Jan Vidar Krey a43953bc0d Added simple plugin that blocks downloads for non-registered users (guests). 2012-11-01 22:07:55 +01:00
Jan Vidar Krey 0a7cb86014 Fixed a crash in plugin mod_chat_only. 2012-10-09 10:02:08 +02:00
Jan Vidar Krey 20a847e1b4 Moved the ipcalc code to the network directory. 2012-10-03 12:59:05 +02:00
Jan Vidar Krey e95a892fb7 MSVC compile warnings fixed. 2012-10-02 22:47:43 +02:00
Jan Vidar Krey 62d14a9c52 Plugin compile fixes for windows systems. 2012-10-02 21:42:58 +02:00
Tilka d49127b507 changed all calls to assert() to uhub_assert() 2012-05-02 21:06:46 +02:00
Jan Vidar Krey 781f22edab Fixed tiny memory leak on reload/shutdown. 2012-04-19 20:05:37 +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 ff639d87c3 Disable SQL debugging output. 2012-01-10 02:21:22 +01: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 ca3782c570 Merge branch 'mod_chat_history_work'
Conflicts:
	doc/plugins.conf
2012-01-03 23:22:41 +01:00
Jan Vidar Krey 875f55a401 Added a chat history plugin.
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.
2012-01-03 23:22:41 +01:00
Jan Vidar Krey a9ed03cf38 Cleaned up the mod_welcome parse failure code. 2012-01-02 12:54:35 +01:00
Jan Vidar Krey 66c77d5170 Don't broadcast the \!example command when issuing it (mod_example.c bug). 2011-12-28 10:44:03 +01:00
Jan Vidar Krey ecedd44fee Added %c substitution to mod_welcome to print the current user credentials. 2011-12-22 00:14:34 +00:00
Jan Vidar Krey 24e2c2090e Fix welcome plugin handle, and build issues. 2011-12-21 23:50:23 +00:00
Jan Vidar Krey 88dd1341d2 Started working on mod_welcome which will replace the built-in file_motd and file_rules configuration options. 2011-12-21 14:31:29 +01:00
Jan Vidar Krey f31fc65e1d VS2010 fixes. 2011-12-21 01:42:21 +01:00
Jan Vidar Krey 7325b15786 Fix bug #174 - Wrong check for fdatasync() availability. 2011-12-21 00:55:22 +01:00
Jan Vidar Krey ba26f4c5e2 Update copyright notices and added licenses to files that were missing it. 2011-12-19 10:54:47 +01:00
Jan Vidar Krey 583900cec5 Fix compile warning about unused result for write() function. 2011-12-19 00:40:02 +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 9f16298688 Fix minor valgrind issues
- Fix valgrind invalid write of 1 byte.
- Fix a few plugin related memory leaks.
2011-12-01 15:14:01 +01:00
Jan Vidar Krey 2396d8555c Fix bug #167 - Build errors on OpenBSD.
- 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().
2011-11-30 13:43:39 +01:00
Jan Vidar Krey 39572c3684 Made plugin loading work properly on Windows. 2011-09-08 01:00:32 +02:00
Jan Vidar Krey bba7c0d05b Require setting the file name via file=/path/to/file for log file. 2011-08-16 14:33:15 +02:00
Jan Vidar Krey bf4ad5624a Visual Studio compile fixes. 2011-01-12 16:58:18 +01:00
Jan Vidar Krey 16fc3ea68e Clean up argument parsing for plugins. 2010-11-12 18:03:39 +01:00
Jan Vidar Krey 21c22288a2 Simplified plugin initialization by using a macro. 2010-11-12 18:03:39 +01: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 4a977da514 Remember to terminate the SQL escaped string. 2010-08-03 23:15:37 +02:00
Jan Vidar Krey e03b4ff0c1 Use correct sqlite escapes of strings. 2010-07-29 11:29:40 +02:00
Jan Vidar Krey 4bf882d385 Fixed credentials handling, and added debug output for SQL. 2010-07-29 11:22:57 +02:00