Răsfoiți Sursa

personal: bigger limit for polls

green 1 an în urmă
părinte
comite
ce8e11adc7
2 a modificat fișierele cu 13 adăugiri și 3 ștergeri
  1. 3 2
      activitypub.c
  2. 10 1
      html.c

+ 3 - 2
activitypub.c

@@ -2321,6 +2321,7 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
 /* creates a Question message */
 {
     xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0, NULL, NULL);
+    int max_line = 200;
     int max      = 8;
     const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
     xs_set seen;
@@ -2345,8 +2346,8 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
             xs *v2 = xs_dup(v);
             xs *d  = xs_dict_new();
 
-            if (strlen(v2) > 60) {
-                v2[60] = '\0';
+            if (strlen(v2) > max_line) {
+                v2[max_line] = '\0';
                 v2 = xs_str_cat(v2, "...");
             }
 

+ 10 - 1
html.c

@@ -817,7 +817,13 @@ xs_html *html_note(snac *user, const char *summary,
                         xs_html_text(L("End in 1 hour"))),
                     xs_html_tag("option",
                         xs_html_attr("value", "86400"),
-                        xs_html_text(L("End in 1 day"))))));
+                        xs_html_text(L("End in 1 day"))),
+                    xs_html_tag("option",
+                        xs_html_attr("value", "259200"),
+                        xs_html_text(L("End in 3 days"))),
+                    xs_html_tag("option",
+                        xs_html_attr("value", "31536000"),
+                        xs_html_text(L("End in 1 year"))))));
     }
 
     xs_html_add(form,
@@ -3207,6 +3213,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
         xs_html *add_hashtags = xs_html_tag("ul",
             xs_html_attr("class", "snac-more-hashtags"));
 
+        // todo: wafrn hashtags
         xs_list_foreach(tags, tag) {
             const char *type = xs_dict_get(tag, "type");
 
@@ -3857,6 +3864,8 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
                 xs_free(xs_html_render(snac_metadata));
             }
 
+            // todo: add metadata from "attachemnt"->"PropertyValue"
+
             /* buttons */
             xs *btn_form_action = xs_fmt("%s/admin/action", user->actor);