From 3b818f557ae3c1073f1464fe0a7319a0e025ba86 Mon Sep 17 00:00:00 2001 From: Eirik Oeverby Date: Mon, 6 Jan 2025 20:03:00 +0100 Subject: Add short_description_raw option --- utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 0740d4d..0f97a2f 100644 --- a/utils.c +++ b/utils.c @@ -36,6 +36,7 @@ static const char *default_srv_config = "{" "\"admin_account\": \"\"," "\"title\": \"\"," "\"short_description\": \"\"," + "\"short_description_raw\": false," "\"protocol\": \"https\"," "\"fastcgi\": false" "}"; -- cgit From bf07718f02081c88b48ea18c0bd38e49e971d398 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 28 Jan 2025 08:04:57 +0100 Subject: Added some default styling to CSS class snac-no-more-unseen-posts. --- doc/style.css | 1 + utils.c | 1 + 2 files changed, 2 insertions(+) (limited to 'utils.c') diff --git a/doc/style.css b/doc/style.css index 13cef97..546cfb3 100644 --- a/doc/style.css +++ b/doc/style.css @@ -29,6 +29,7 @@ pre { overflow-x: scroll; } .snac-list-of-lists { padding-left: 0; } .snac-list-of-lists li { display: inline; border: 1px solid #a0a0a0; border-radius: 25px; margin-right: 0.5em; padding-left: 0.5em; padding-right: 0.5em; } +.snac-no-more-unseen-posts { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0.5em 0; margin: 1em 0; } @media (prefers-color-scheme: dark) { body, input, textarea { background-color: #000; color: #fff; } a { color: #7799dd } diff --git a/utils.c b/utils.c index fd00e99..eb83884 100644 --- a/utils.c +++ b/utils.c @@ -72,6 +72,7 @@ static const char *default_css = ".snac-list-of-lists { padding-left: 0; }\n" ".snac-list-of-lists li { display: inline; border: 1px solid #a0a0a0; border-radius: 25px;\n" " margin-right: 0.5em; padding-left: 0.5em; padding-right: 0.5em; }\n" + ".snac-no-more-unseen-posts { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0.5em 0; margin: 1em 0; }\n" "@media (prefers-color-scheme: dark) { \n" " body, input, textarea { background-color: #000; color: #fff; }\n" " a { color: #7799dd }\n" -- cgit From ca9ff0538ef4e4bc6c23d1d30d83b0879c4d5351 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 28 Jan 2025 08:07:43 +0100 Subject: Some CSS tweaks. --- doc/style.css | 2 +- utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'utils.c') diff --git a/doc/style.css b/doc/style.css index 546cfb3..87c5598 100644 --- a/doc/style.css +++ b/doc/style.css @@ -29,7 +29,7 @@ pre { overflow-x: scroll; } .snac-list-of-lists { padding-left: 0; } .snac-list-of-lists li { display: inline; border: 1px solid #a0a0a0; border-radius: 25px; margin-right: 0.5em; padding-left: 0.5em; padding-right: 0.5em; } -.snac-no-more-unseen-posts { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0.5em 0; margin: 1em 0; } +.snac-no-more-unseen-posts { border-top: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0; padding: 0.5em 0; margin: 1em 0; } @media (prefers-color-scheme: dark) { body, input, textarea { background-color: #000; color: #fff; } a { color: #7799dd } diff --git a/utils.c b/utils.c index eb83884..946897f 100644 --- a/utils.c +++ b/utils.c @@ -72,7 +72,7 @@ static const char *default_css = ".snac-list-of-lists { padding-left: 0; }\n" ".snac-list-of-lists li { display: inline; border: 1px solid #a0a0a0; border-radius: 25px;\n" " margin-right: 0.5em; padding-left: 0.5em; padding-right: 0.5em; }\n" - ".snac-no-more-unseen-posts { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 0.5em 0; margin: 1em 0; }\n" + ".snac-no-more-unseen-posts { border-top: 1px solid #a0a0a0; border-bottom: 1px solid #a0a0a0; padding: 0.5em 0; margin: 1em 0; }\n" "@media (prefers-color-scheme: dark) { \n" " body, input, textarea { background-color: #000; color: #fff; }\n" " a { color: #7799dd }\n" -- cgit From 8e1a2c5ff92d01789e02980f2e36c8808c8ea033 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 6 Feb 2025 09:04:36 +0100 Subject: Merged 53ad5cdf0371fc068fa03bf287fc94be. --- RELEASE_NOTES.md | 2 ++ doc/snac.8 | 2 ++ html.c | 2 +- httpd.c | 2 +- utils.c | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) (limited to 'utils.c') diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 78f5694..8e95766 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -12,6 +12,8 @@ Fixed link detection in posts (contributed by inz). Allow multiple editors for command-line posts (contributed by inz). +Separated maximum and default timeline entry count, allowing larger timelines to be requested without having to increase the default (contributed by lxo). + Special thanks to fellow developer inz for bringing my attention to code places where I should have been more careful. ## 2.71 diff --git a/doc/snac.8 b/doc/snac.8 index e9b33dd..aac9f70 100644 --- a/doc/snac.8 +++ b/doc/snac.8 @@ -154,6 +154,8 @@ to those servers that went timeout in the previous retry. If you want to give slow servers a chance to receive your messages, you can increase this value (but also take into account that processing the queue will take longer while waiting for these molasses to respond). +.It Ic def_timeline_entries +This is the default timeline entries shown in the web interface. .It Ic max_timeline_entries This is the maximum timeline entries shown in the web interface. .It Ic timeline_purge_days diff --git a/html.c b/html.c index 5f1cd6c..82d2e55 100644 --- a/html.c +++ b/html.c @@ -3306,7 +3306,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, cache = 0; int skip = 0; - int def_show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); + int def_show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", "50")); int show = def_show; if ((v = xs_dict_get(q_vars, "skip")) != NULL) diff --git a/httpd.c b/httpd.c index e0a36b6..b856b7d 100644 --- a/httpd.c +++ b/httpd.c @@ -219,7 +219,7 @@ int server_get_handler(xs_dict *req, const char *q_path, if (xs_type(q_vars) == XSTYPE_DICT && (t = xs_dict_get(q_vars, "t"))) { /** search by tag **/ int skip = 0; - int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); + int show = xs_number_get(xs_dict_get_def(srv_config, "def_timeline_entries", "50")); const char *v; if ((v = xs_dict_get(q_vars, "skip")) != NULL) diff --git a/utils.c b/utils.c index ae1c1b6..b799813 100644 --- a/utils.c +++ b/utils.c @@ -28,6 +28,7 @@ static const char *default_srv_config = "{" "\"queue_timeout\": 6," "\"queue_timeout_2\": 8," "\"cssurls\": [\"\"]," + "\"def_timeline_entries\": 50," "\"max_timeline_entries\": 50," "\"timeline_purge_days\": 120," "\"local_purge_days\": 0," -- cgit