unrealircd- supernets unrealircd source & configuration |
git clone git://git.acid.vegas/unrealircd.git |
Log | Files | Refs | Archive | README | LICENSE |
history_backend_null.c (1663B)
1 /* src/modules/history_backend_null.c - History Backend: null / none 2 * (C) Copyright 2019 Bram Matthys (Syzop) and the UnrealIRCd team 3 * License: GPLv2 or later 4 */ 5 #include "unrealircd.h" 6 7 /* This is the null backend type. It does not store anything at all. 8 * This can be useful on a hub server where you don't need channel 9 * history but still need to have a backend loaded to use the 10 * channel mode +H. 11 */ 12 13 ModuleHeader MOD_HEADER 14 = { 15 "history_backend_null", 16 "2.0", 17 "History backend: null/none", 18 "UnrealIRCd Team", 19 "unrealircd-6", 20 }; 21 22 /* Forward declarations */ 23 int hbn_history_set_limit(const char *object, int max_lines, long max_time); 24 int hbn_history_add(const char *object, MessageTag *mtags, const char *line); 25 HistoryResult *hbn_history_request(const char *object, HistoryFilter *filter); 26 int hbn_history_destroy(const char *object); 27 28 MOD_INIT() 29 { 30 HistoryBackendInfo hbi; 31 32 MARK_AS_OFFICIAL_MODULE(modinfo); 33 34 memset(&hbi, 0, sizeof(hbi)); 35 hbi.name = "mem"; 36 hbi.history_set_limit = hbn_history_set_limit; 37 hbi.history_add = hbn_history_add; 38 hbi.history_request = hbn_history_request; 39 hbi.history_destroy = hbn_history_destroy; 40 if (!HistoryBackendAdd(modinfo->handle, &hbi)) 41 return MOD_FAILED; 42 43 return MOD_SUCCESS; 44 } 45 46 MOD_LOAD() 47 { 48 return MOD_SUCCESS; 49 } 50 51 MOD_UNLOAD() 52 { 53 return MOD_SUCCESS; 54 } 55 56 int hbn_history_add(const char *object, MessageTag *mtags, const char *line) 57 { 58 return 1; 59 } 60 61 HistoryResult *hbn_history_request(const char *object, HistoryFilter *filter) 62 { 63 return NULL; 64 } 65 66 int hbn_history_set_limit(const char *object, int max_lines, long max_time) 67 { 68 return 1; 69 } 70 71 int hbn_history_destroy(const char *object) 72 { 73 return 1; 74 }