diff options
author | default <nobody@localhost> | 2024-05-11 19:18:07 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-11 19:18:07 +0200 |
commit | 0a11d70fbecd69e0c93000581b800ff434d42767 (patch) | |
tree | ae77df1ea5686254090650af3fcfef64817aa28b | |
parent | 4d53a7b6f7f45f524313980461f5d2a6ef965949 (diff) | |
parent | 6f3763f452ba55ee6ddd9f63f5bc523807e7288f (diff) |
Fixed git conflict.
-rw-r--r-- | activitypub.c | 2 | ||||
-rw-r--r-- | data.c | 2 | ||||
-rw-r--r-- | format.c | 5 | ||||
-rw-r--r-- | html.c | 5 | ||||
-rw-r--r-- | mastoapi.c | 4 | ||||
-rw-r--r-- | snac.h | 2 |
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) type = "(null)"; } - if (xs_match(type, "Note|Page|Article|Video")) { + if (xs_match(type, POSTLIKE_OBJECT_TYPE)) { if (content_check("filter_reject.txt", object)) snac_log(snac, xs_fmt("timeline_request rejected by content %s", nid)); else { @@ -2577,7 +2577,7 @@ xs_list *content_search(snac *user, const char *regex, if (!valid_status(timeline_get_by_md5(user, md5, &post))) continue; - if (!xs_match(xs_dict_get_def(post, "type", "-"), "Note|Question|Page|Article|Video")) + if (!xs_match(xs_dict_get_def(post, "type", "-"), POSTLIKE_OBJECT_TYPE)) continue; char *content = xs_dict_get(post, "content"); @@ -311,9 +311,8 @@ xs_str *sanitize(const char *content) s = xs_str_cat(s, s2); } else { - /* else? just show it with encoded code.. that's it. */ - xs *el = encode_html(v); - s = xs_str_cat(s, el); + if (strcmp(v, "</div>")) + s = xs_str_cat(s, "<p>"); } } else { @@ -256,7 +256,7 @@ xs_html *html_msg_icon(snac *user, char *actor_id, const xs_dict *msg) int priv = 0; const char *type = xs_dict_get(msg, "type"); - if (xs_match(type, "Note|Question|Page|Article|Video")) + if (xs_match(type, POSTLIKE_OBJECT_TYPE)) url = xs_dict_get(msg, "id"); priv = !is_msg_public(msg); @@ -1405,8 +1405,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, html_msg_icon(read_only ? NULL : user, xs_dict_get(msg, "actor"), msg))); } else - if (!xs_match(type, "Note|Question|Page|Article|Video")) { + if (!xs_match(type, POSTLIKE_OBJECT_TYPE)) { /* skip oddities */ + snac_debug(user, 1, xs_fmt("html_entry: ignoring object type '%s' %s", type, id)); return NULL; } @@ -1504,7 +1504,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, /* discard non-Notes */ const char *id = xs_dict_get(msg, "id"); const char *type = xs_dict_get(msg, "type"); - if (!xs_match(type, "Note|Question|Page|Article|Video")) + if (!xs_match(type, POSTLIKE_OBJECT_TYPE)) continue; const char *from = NULL; @@ -1681,7 +1681,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, /* discard non-Notes */ const char *id = xs_dict_get(msg, "id"); const char *type = xs_dict_get(msg, "type"); - if (!xs_match(type, "Note|Question|Page|Article|Video")) + if (!xs_match(type, POSTLIKE_OBJECT_TYPE)) continue; const char *from = NULL; @@ -29,6 +29,8 @@ extern int dbglevel; #define L(s) (s) +#define POSTLIKE_OBJECT_TYPE "Note|Question|Page|Article|Video|Event" + int mkdirx(const char *pathname); int valid_status(int status); |