1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-01 09:06:37 +02:00
Files
unrealircd/src/modules/history_backend_null.c
T
Bram Matthys a8c191b291 Add new command: HISTORY #chan [lines]. This is meant for end-users
so they can fetch more history than the standard on-join history.

In the future we are also likely to implement IRCv3 CHATHISTORY
once that becomes an official specification. However, until it is
specified and until most major clients support it, several years
are likely to pass. It would be a shame to withhold channel
history to many end-users in the meantime when it takes so little
effort from us to provide an easy command.

See also
https://www.unrealircd.org/docs/Channel_history
And in particular the new section:
https://www.unrealircd.org/docs/Channel_history#Playback_frontends
which explains the relationship between on-join playback,
HISTORY and CHATHISTORY.
2020-02-02 11:57:51 +01:00

76 lines
1.6 KiB
C

/* src/modules/history_backend_null.c - History Backend: null / none
* (C) Copyright 2019 Bram Matthys (Syzop) and the UnrealIRCd team
* License: GPLv2
*/
#include "unrealircd.h"
/* This is the null backend type. It does not store anything at all.
* This can be useful on a hub server where you don't need channel
* history but still need to have a backend loaded to use the
* channel mode +H.
*/
ModuleHeader MOD_HEADER
= {
"history_backend_null",
"2.0",
"History backend: null/none",
"UnrealIRCd Team",
"unrealircd-5",
};
/* Forward declarations */
int hbn_history_set_limit(char *object, int max_lines, long max_time);
int hbn_history_add(char *object, MessageTag *mtags, char *line);
int hbn_history_request(Client *client, char *object, HistoryFilter *filter);
int hbn_history_destroy(char *object);
MOD_INIT()
{
HistoryBackendInfo hbi;
MARK_AS_OFFICIAL_MODULE(modinfo);
ModuleSetOptions(modinfo->handle, MOD_OPT_PERM, 1);
memset(&hbi, 0, sizeof(hbi));
hbi.name = "mem";
hbi.history_set_limit = hbn_history_set_limit;
hbi.history_add = hbn_history_add;
hbi.history_request = hbn_history_request;
hbi.history_destroy = hbn_history_destroy;
if (!HistoryBackendAdd(modinfo->handle, &hbi))
return MOD_FAILED;
return MOD_SUCCESS;
}
MOD_LOAD()
{
return MOD_SUCCESS;
}
MOD_UNLOAD()
{
return MOD_SUCCESS;
}
int hbn_history_add(char *object, MessageTag *mtags, char *line)
{
return 1;
}
int hbn_history_request(Client *client, char *object, HistoryFilter *filter)
{
return 0;
}
int hbn_history_set_limit(char *object, int max_lines, long max_time)
{
return 1;
}
int hbn_history_destroy(char *object)
{
return 1;
}