HTML stuff

FossilOrigin-Name: a0e5a97d5a6ed7cbc2b7fd45a66e1adc9b8ea8563c0fa284df0b96be6a24ec29
This commit is contained in:
me@ow.nekobit.net 2022-04-21 15:07:08 +00:00
parent 71204d5007
commit 9f434eb3a4
6 changed files with 44 additions and 3 deletions

View File

@ -90,6 +90,10 @@ $(PAGES_DIR)/scrobble.chtml: $(PAGES_DIR)/scrobble.html
./filec $< data_scrobble_html > $@
$(PAGES_DIR)/directs_page.chtml: $(PAGES_DIR)/directs_page.html
./filec $< data_directs_page_html > $@
$(PAGES_DIR)/status_interactions.chtml: $(PAGES_DIR)/status_interactions.html
./filec $< data_status_interactions_html > $@
$(PAGES_DIR)/status_interactions_label.chtml: $(PAGES_DIR)/status_interactions_label.html
./filec $< data_status_interactions_label_html > $@
$(MASTODONT_DIR):
git clone $(MASTODONT_URL) || true

View File

@ -246,11 +246,30 @@ char* construct_status(mastodont_t* api,
char* emoji_reactions = NULL;
char* notif_info = NULL;
char* in_reply_to_str = NULL;
char* interactions_html;
struct mstdnt_status* status = local_status;
// Create a "fake" notification header which contains information for
// the reblogged status
struct mstdnt_notification notif_reblog;
struct mstdnt_notification* notif = local_notif;
struct mstdnt_account* favourites = NULL;
struct mstdnt_account* reblogs = NULL;
struct mstdnt_storage favourites_storage = { 0 };
struct mstdnt_storage reblogs_storage = { 0 };
size_t favourites_len;
size_t reblogs_len;
// If focused, show status interactions
if ((flags & STATUS_FOCUSED) == STATUS_FOCUSED &&
(status->reblogs_count || status->favourites_count))
{
if (status->reblogs_count)
mastodont_status_favourited_by(api, status->id,
&favourites_storage,
&favourites,
&favourites_len);
}
// Repoint value if it's a reblog
if (status->reblog)
@ -312,6 +331,7 @@ char* construct_status(mastodont_t* api,
parse_content,
attachments ? attachments : "",
emoji_reactions ? emoji_reactions : "",
interactions_html ? interactions_html : "",
config_url_prefix,
status->id,
status->id,

View File

@ -27,7 +27,6 @@
#define STATUS_FOCUSED (1<<0)
#define STATUS_EMOJI_PICKER (1<<1)
char* construct_in_reply_to(mastodont_t* api, struct mstdnt_status* status, size_t* size);
int try_post_status(struct session* ssn, mastodont_t* api);
int try_interact_status(struct session* ssn, mastodont_t* api, char* id);
void content_status_create(struct session* ssn, mastodont_t* api, char** data);
@ -36,10 +35,12 @@ void content_status_create(struct session* ssn, mastodont_t* api, char** data);
char* construct_post_box(char* reply_id,
char* default_content,
int* size);
char* reformat_status(char* content, struct mstdnt_emoji* emos, size_t emos_len);
char* greentextify(char* content);
char* construct_status(mastodont_t* api, struct mstdnt_status* status, int* size, struct mstdnt_notification* notif, uint8_t flags);
char* construct_statuses(mastodont_t* api, struct mstdnt_status* statuses, size_t size, size_t* ret_size);
char* construct_in_reply_to(mastodont_t* api, struct mstdnt_status* status, size_t* size);
char* construct_status_interactions(struct mstdnt_account* accounts, size_t accounts_len);
char* reformat_status(char* content, struct mstdnt_emoji* emos, size_t emos_len);
char* greentextify(char* content);
// Status frontends
void status_view(struct session* ssn, mastodont_t* api, char** data);

View File

@ -43,6 +43,7 @@
</span>
%s
%s
%s
<div class="status-interact">
<table class="ui-table">
<tr>

View File

@ -0,0 +1,11 @@
<div class="status-interactions">
<div class="status-interactions-labels">
<!-- Favourites count -->
%s
<!-- Reblog count -->
%s
</div>
<div class="status-interactions-pfps">
%s
</div>
</div>

View File

@ -0,0 +1,4 @@
<div class="header-btn btn">
<span class="btn-header">%s</span>
<span class="btn-content">%s</span>
</div>