summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-05-11 19:18:07 +0200
committerGravatar default2024-05-11 19:18:07 +0200
commit0a11d70fbecd69e0c93000581b800ff434d42767 (patch)
treeae77df1ea5686254090650af3fcfef64817aa28b
parentIn timeline_request(), call enqueue_actor_request on actor errors. (diff)
parentShow 'Event' object types as Notes. (diff)
downloadpenes-snac2-0a11d70fbecd69e0c93000581b800ff434d42767.tar.gz
penes-snac2-0a11d70fbecd69e0c93000581b800ff434d42767.tar.xz
penes-snac2-0a11d70fbecd69e0c93000581b800ff434d42767.zip
Fixed git conflict.
-rw-r--r--activitypub.c2
-rw-r--r--data.c2
-rw-r--r--format.c5
-rw-r--r--html.c5
-rw-r--r--mastoapi.c4
-rw-r--r--snac.h2
6 files changed, 11 insertions, 9 deletions
diff --git a/activitypub.c b/activitypub.c
index 280ac87..dee127d 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -355,7 +355,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level)
355 type = "(null)"; 355 type = "(null)";
356 } 356 }
357 357
358 if (xs_match(type, "Note|Page|Article|Video")) { 358 if (xs_match(type, POSTLIKE_OBJECT_TYPE)) {
359 if (content_check("filter_reject.txt", object)) 359 if (content_check("filter_reject.txt", object))
360 snac_log(snac, xs_fmt("timeline_request rejected by content %s", nid)); 360 snac_log(snac, xs_fmt("timeline_request rejected by content %s", nid));
361 else { 361 else {
diff --git a/data.c b/data.c
index 8016ce1..706e8e1 100644
--- a/data.c
+++ b/data.c
@@ -2577,7 +2577,7 @@ xs_list *content_search(snac *user, const char *regex,
2577 if (!valid_status(timeline_get_by_md5(user, md5, &post))) 2577 if (!valid_status(timeline_get_by_md5(user, md5, &post)))
2578 continue; 2578 continue;
2579 2579
2580 if (!xs_match(xs_dict_get_def(post, "type", "-"), "Note|Question|Page|Article|Video")) 2580 if (!xs_match(xs_dict_get_def(post, "type", "-"), POSTLIKE_OBJECT_TYPE))
2581 continue; 2581 continue;
2582 2582
2583 char *content = xs_dict_get(post, "content"); 2583 char *content = xs_dict_get(post, "content");
diff --git a/format.c b/format.c
index 8d51351..631c11c 100644
--- a/format.c
+++ b/format.c
@@ -311,9 +311,8 @@ xs_str *sanitize(const char *content)
311 311
312 s = xs_str_cat(s, s2); 312 s = xs_str_cat(s, s2);
313 } else { 313 } else {
314 /* else? just show it with encoded code.. that's it. */ 314 if (strcmp(v, "</div>"))
315 xs *el = encode_html(v); 315 s = xs_str_cat(s, "<p>");
316 s = xs_str_cat(s, el);
317 } 316 }
318 } 317 }
319 else { 318 else {
diff --git a/html.c b/html.c
index 0cdb608..201456e 100644
--- a/html.c
+++ b/html.c
@@ -256,7 +256,7 @@ xs_html *html_msg_icon(snac *user, char *actor_id, const xs_dict *msg)
256 int priv = 0; 256 int priv = 0;
257 const char *type = xs_dict_get(msg, "type"); 257 const char *type = xs_dict_get(msg, "type");
258 258
259 if (xs_match(type, "Note|Question|Page|Article|Video")) 259 if (xs_match(type, POSTLIKE_OBJECT_TYPE))
260 url = xs_dict_get(msg, "id"); 260 url = xs_dict_get(msg, "id");
261 261
262 priv = !is_msg_public(msg); 262 priv = !is_msg_public(msg);
@@ -1405,8 +1405,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
1405 html_msg_icon(read_only ? NULL : user, xs_dict_get(msg, "actor"), msg))); 1405 html_msg_icon(read_only ? NULL : user, xs_dict_get(msg, "actor"), msg)));
1406 } 1406 }
1407 else 1407 else
1408 if (!xs_match(type, "Note|Question|Page|Article|Video")) { 1408 if (!xs_match(type, POSTLIKE_OBJECT_TYPE)) {
1409 /* skip oddities */ 1409 /* skip oddities */
1410 snac_debug(user, 1, xs_fmt("html_entry: ignoring object type '%s' %s", type, id));
1410 return NULL; 1411 return NULL;
1411 } 1412 }
1412 1413
diff --git a/mastoapi.c b/mastoapi.c
index 1071bfd..2bf5fdc 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1504,7 +1504,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1504 /* discard non-Notes */ 1504 /* discard non-Notes */
1505 const char *id = xs_dict_get(msg, "id"); 1505 const char *id = xs_dict_get(msg, "id");
1506 const char *type = xs_dict_get(msg, "type"); 1506 const char *type = xs_dict_get(msg, "type");
1507 if (!xs_match(type, "Note|Question|Page|Article|Video")) 1507 if (!xs_match(type, POSTLIKE_OBJECT_TYPE))
1508 continue; 1508 continue;
1509 1509
1510 const char *from = NULL; 1510 const char *from = NULL;
@@ -1681,7 +1681,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1681 /* discard non-Notes */ 1681 /* discard non-Notes */
1682 const char *id = xs_dict_get(msg, "id"); 1682 const char *id = xs_dict_get(msg, "id");
1683 const char *type = xs_dict_get(msg, "type"); 1683 const char *type = xs_dict_get(msg, "type");
1684 if (!xs_match(type, "Note|Question|Page|Article|Video")) 1684 if (!xs_match(type, POSTLIKE_OBJECT_TYPE))
1685 continue; 1685 continue;
1686 1686
1687 const char *from = NULL; 1687 const char *from = NULL;
diff --git a/snac.h b/snac.h
index de2ee1e..91033cf 100644
--- a/snac.h
+++ b/snac.h
@@ -29,6 +29,8 @@ extern int dbglevel;
29 29
30#define L(s) (s) 30#define L(s) (s)
31 31
32#define POSTLIKE_OBJECT_TYPE "Note|Question|Page|Article|Video|Event"
33
32int mkdirx(const char *pathname); 34int mkdirx(const char *pathname);
33 35
34int valid_status(int status); 36int valid_status(int status);