Selaa lähdekoodia

mastoapi: also exclude posts with blocked hashtags.

grunfink 1 viikko sitten
vanhempi
sitoutus
79eb0d8fc2
2 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 3 0
      mastoapi.c
  2. 2 0
      snac.h

+ 3 - 0
mastoapi.c

@@ -1712,6 +1712,9 @@ xs_list *mastoapi_timeline(snac *user, const xs_dict *args, const char *index_fn
                 if (words_in_content(xs_dict_get(user->config, "muted_words"),
                 if (words_in_content(xs_dict_get(user->config, "muted_words"),
                                      xs_dict_get(msg, "content")))
                                      xs_dict_get(msg, "content")))
                     continue;
                     continue;
+
+                if (blocked_hashtag_check(user, msg))
+                    continue;
             }
             }
             else {
             else {
                 /* skip non-public messages */
                 /* skip non-public messages */

+ 2 - 0
snac.h

@@ -384,6 +384,8 @@ const char *get_atto(const xs_dict *msg);
 const char *get_in_reply_to(const xs_dict *msg);
 const char *get_in_reply_to(const xs_dict *msg);
 xs_list *get_attachments(const xs_dict *msg);
 xs_list *get_attachments(const xs_dict *msg);
 
 
+int blocked_hashtag_check(snac *user, const xs_dict *msg);
+
 xs_dict *msg_admiration(snac *snac, const char *object, const char *type);
 xs_dict *msg_admiration(snac *snac, const char *object, const char *type);
 xs_dict *msg_repulsion(snac *user, const char *id, const char *type);
 xs_dict *msg_repulsion(snac *user, const char *id, const char *type);
 xs_dict *msg_emoji_init(snac *user, const char *mid, const char *eid);
 xs_dict *msg_emoji_init(snac *user, const char *mid, const char *eid);