FossilOrigin-Name: 69b265f1adaa240d8ec99f3448ed386a9e543e4f30cf1534cb387c57ee198a4d
This commit is contained in:
nekobit 2022-08-04 04:31:28 +00:00
parent ff3d383464
commit 473b3b5920
5 changed files with 29 additions and 15 deletions

View file

@ -7,6 +7,8 @@ our @EXPORT = qw( generate_attachment );
use template_helpers 'to_template';
use icons 'get_icon';
use postbox 'generate_postbox';
use status 'generate_status';
sub content_timeline
{
@ -18,6 +20,8 @@ sub content_timeline
statuses => $statuses,
title => $title,
show_post_box => $show_post_box,
postbox => \&postbox,
create_status => \&generate_status,
);
to_template(\&vars, \&data->{'timeline.tt'});

View file

@ -43,7 +43,7 @@ void init_template_files()
hv_stores(template_files, "attachment.tt", newSVpv(data_attachment_tt, data_attachment_tt_size));
hv_stores(template_files, "emoji.tt", newSVpv(data_emoji_tt, data_emoji_tt_size));
hv_stores(template_files, "postbox.tt", newSVpv(data_postbox_tt, data_postbox_tt_size));
hv_stores(template_files, "timeline.tt", newSVpv(data_timeline_tt, data_timeline_tt_size);)
hv_stores(template_files, "timeline.tt", newSVpv(data_timeline_tt, data_timeline_tt_size));
}
void cleanup_template_files()

View file

@ -947,16 +947,16 @@ void content_status(PATH_ARGS, uint8_t flags)
SAVETMPS;
PUSHMARK(SP);
HV* session_hv = perlify_session(ssn);
XPUSHs(newRV_noinc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)template_files));
XPUSHs(newRV_noinc((SV*)perlify_status(&status)));
XPUSHs(newRV_inc((SV*)session_hv));
XPUSHs(newRV_inc((SV*)template_files));
XPUSHs(newRV_inc((SV*)perlify_status(&status)));
if (statuses_before)
XPUSHs(newRV_noinc((AV*)perlify_statuses(statuses_before, stat_before_len)));
XPUSHs(newRV_inc((AV*)perlify_statuses(statuses_before, stat_before_len)));
else
XPUSHs(&PL_sv_undef);
if (statuses_after)
XPUSHs(newRV_noinc((AV*)perlify_statuses(statuses_after, stat_after_len)));
XPUSHs(newRV_inc((AV*)perlify_statuses(statuses_after, stat_after_len)));
else
XPUSHs(&PL_sv_undef);
// ARGS

View file

@ -30,7 +30,7 @@
#include "query.h"
#include "error.h"
#include "string_helpers.h"
#include "perl_global.h"
#include "global_perl.h"
#include "../static/timeline_options.ctmpl"
#include "../static/navigation.ctmpl"
@ -51,21 +51,21 @@ void content_timeline(FCGX_Request* req,
SAVETMPS;
PUSHMARK(SP);
HV* session_hv = perlify_session(ssn);
XPUSHs(newRV_noinc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)template_files));
XPUSHs(newRV_inc((SV*)session_hv));
XPUSHs(newRV_inc((SV*)template_files));
if (statuses)
XPUSHs(newRV_noinc((AV*)perlify_statuses(statuses, statuses_len)));
else ARG_UNDEFINED();
XPUSHs(newRV_inc((SV*)perlify_statuses(statuses, statuses_len)));
else { ARG_UNDEFINED(); }
if (title)
if (header_text)
XPUSHs(newSVpv(header_text, 0));
else ARG_UNDEFINED();
else { ARG_UNDEFINED(); }
XPUSHi(show_post_box);
PUTBACK;
call_pv("status::content_timeline", G_SCALAR);
call_pv("timeline::content_timeline", G_SCALAR);
SPAGAIN;
// Duplicate to free temps
@ -78,7 +78,7 @@ void content_timeline(FCGX_Request* req,
struct base_page b = {
.category = cat,
.content = output,
.content = dup,
.session = session_hv,
.sidebar_left = NULL
};

View file

@ -1,3 +1,7 @@
[% IF show_post_box %]
[% postbox(ssn, data, undef) %]
[% END %]
<div class="menubar">
<form action="." method="post">
Only media:
@ -12,3 +16,9 @@
<input type="submit" value="Filter">
</form>
</div>
[% FOREACH i IN statuses %]
[% create_status(ssn, data, i) %]
[% END %]
[%# TODO navigation %]