diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-06-11 22:54:50 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-06-11 22:54:50 +0100 |
commit | 511e258e901e5248e1706609ba1099507fd750ae (patch) | |
tree | 4c7ee92fbe3634e7c78579657a023948a1a6bbae /blabouncer.c | |
parent | 9db9fb396aaf601bd00f2b62face2693307a0e16 (diff) |
Implement configurable auto replay modes. So far there is "none", "time" (auto replay the last X seconds), and "lastspoke" (auto replay everything since you last spoke).
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c index 469eb68..0db2dca 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -789,6 +789,17 @@ int main(int argc, char *argv[]) { // Populate settings from configuration file + // What is the auto replay mode? + if (!getconfstr("replaymode", settings.conffile, settings.replaymode)) { + printf("main(): error getting 'replaymode' from configuration file.\n"); + exit(1); + } else { + if (strcmp(settings.replaymode, "none") && strcmp(settings.replaymode, "time") && strcmp(settings.replaymode, "lastspoke")) { + printf("main(): replaymode in configuration file must be one of \"none\", \"time\", or \"lastspoke\".\n"); + exit(1); + } + } + // How many seconds of replay log should automatically be replayed - TODO - Can we do error checking on this? settings.replayseconds = getconfint("replayseconds", settings.conffile); if (errno == ECONFINT) { |