瀏覽代碼

Merged 53ad5cdf0371fc068fa03bf287fc94be.

Alexandre Oliva 2 月之前
父節點
當前提交
8e1a2c5ff9
共有 5 個文件被更改,包括 7 次插入2 次删除
  1. 2 0
      RELEASE_NOTES.md
  2. 2 0
      doc/snac.8
  3. 1 1
      html.c
  4. 1 1
      httpd.c
  5. 1 0
      utils.c

+ 2 - 0
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).
 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.
 Special thanks to fellow developer inz for bringing my attention to code places where I should have been more careful.
 
 
 ## 2.71
 ## 2.71

+ 2 - 0
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
 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
 value (but also take into account that processing the queue will take longer
 while waiting for these molasses to respond).
 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
 .It Ic max_timeline_entries
 This is the maximum timeline entries shown in the web interface.
 This is the maximum timeline entries shown in the web interface.
 .It Ic timeline_purge_days
 .It Ic timeline_purge_days

+ 1 - 1
html.c

@@ -3306,7 +3306,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
         cache = 0;
         cache = 0;
 
 
     int skip = 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;
     int show = def_show;
 
 
     if ((v = xs_dict_get(q_vars, "skip")) != NULL)
     if ((v = xs_dict_get(q_vars, "skip")) != NULL)

+ 1 - 1
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"))) {
         if (xs_type(q_vars) == XSTYPE_DICT && (t = xs_dict_get(q_vars, "t"))) {
             /** search by tag **/
             /** search by tag **/
             int skip = 0;
             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;
             const char *v;
 
 
             if ((v = xs_dict_get(q_vars, "skip")) != NULL)
             if ((v = xs_dict_get(q_vars, "skip")) != NULL)

+ 1 - 0
utils.c

@@ -28,6 +28,7 @@ static const char *default_srv_config = "{"
     "\"queue_timeout\":        6,"
     "\"queue_timeout\":        6,"
     "\"queue_timeout_2\":      8,"
     "\"queue_timeout_2\":      8,"
     "\"cssurls\":              [\"\"],"
     "\"cssurls\":              [\"\"],"
+    "\"def_timeline_entries\": 50,"
     "\"max_timeline_entries\": 50,"
     "\"max_timeline_entries\": 50,"
     "\"timeline_purge_days\":  120,"
     "\"timeline_purge_days\":  120,"
     "\"local_purge_days\":     0,"
     "\"local_purge_days\":     0,"