Fix visibility

FossilOrigin-Name: 72af980137a4bb8e62fa2264acf2da95ecdaf7d1abd649e794646d454cb96934
This commit is contained in:
me@ow.nekobit.net 2022-04-19 14:33:13 +00:00
parent 600dca63b6
commit e762140822
4 changed files with 12 additions and 11 deletions

View file

@ -38,9 +38,9 @@ struct mstdnt_get_notifications_args
mstdnt_notification_t exclude_types;
char* account_id;
/* Bitmask */
mstdnt_visibility_t exclude_visibilities;
mstdnt_visibility_t* exclude_visibilities;
/* Bitmask */
mstdnt_visibility_t include_types;
mstdnt_visibility_t* include_types;
mstdnt_bool with_muted;
char* max_id;
char* min_id;

View file

@ -38,7 +38,7 @@ struct mstdnt_status
char* created_at;
struct mstdnt_account account;
char* content;
mstdnt_visibility_t visibility;
char* visibility;
mstdnt_bool sensitive;
char* spoiler_text;
struct mstdnt_attachment* media_attachments;

View file

@ -17,14 +17,14 @@
#define MASTODONT_VISIBILITY_TYPES_H
#include <stdint.h>
#define MSTDNT_VISIBILITY_NOOP 0
#define MSTDNT_VISIBILITY_PUBLIC (1<<0)
#define MSTDNT_VISIBILITY_UNLISTED (1<<1)
#define MSTDNT_VISIBILITY_PRIVATE (1<<2)
#define MSTDNT_VISIBILITY_DIRECT (1<<3)
#define MSTDNT_VISIBILITY_LIST (1<<4)
#define MSTDNT_VISIBILITY_LOCAL (1<<5)
/* These used to uint8_t's, but because lists are custom strings,
it was better to make these regular strings */
#define MSTDNT_VISIBILITY_PUBLIC "public"
#define MSTDNT_VISIBILITY_UNLISTED "unlisted"
#define MSTDNT_VISIBILITY_PRIVATE "private"
#define MSTDNT_VISIBILITY_DIRECT "direct"
#define MSTDNT_VISIBILITY_LOCAL "local"
typedef uint8_t mstdnt_visibility_t;
typedef char* mstdnt_visibility_t;
#endif /* MASTODONT_VISIBILITY_TYPES_H */

View file

@ -66,6 +66,7 @@ int mstdnt_status_from_json(struct mstdnt_status* status, cJSON* js)
{ "language", &(status->language), _mstdnt_val_string_call },
{ "url", &(status->url), _mstdnt_val_string_call },
{ "text", &(status->text), _mstdnt_val_string_call },
{ "visibility", &(status->visibility), _mstdnt_val_string_call },
{ "in_reply_to_account_id", &(status->in_reply_to_account_id), _mstdnt_val_string_call },
{ "sensitive", &(status->sensitive), _mstdnt_val_bool_call },
{ "favourited", &(status->favourited), _mstdnt_val_bool_call },