FossilOrigin-Name: ce623bcfc6aa85e250f8861966654b8c476372c1829d14d96b4b80bbd799a34c
This commit is contained in:
nekobit 2022-08-04 04:49:28 +00:00
parent 473b3b5920
commit 6ab40c0a66
5 changed files with 17 additions and 15 deletions

View file

@ -5,6 +5,7 @@ use Template;
use l10n qw( &lang %L10N );
use notifications qw( generate_notification_compact );
use template_helpers qw( &to_template );
use timeline;
use status;
# my $template = Template->new(

View file

@ -3,7 +3,7 @@ use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw( generate_attachment );
our @EXPORT = qw( content_timeline );
use template_helpers 'to_template';
use icons 'get_icon';
@ -17,6 +17,7 @@ sub content_timeline
my %vars = (
prefix => '',
ssn => $ssn,
data => $data,
statuses => $statuses,
title => $title,
show_post_box => $show_post_box,

View file

@ -32,10 +32,10 @@ static PerlInterpreter* perl;
extern HV* template_files;
extern pthread_mutex_t perl_mutex;
#define perl_lock() do { pthread_mutex_lock(&perl_mutex); } while (1)
#define perl_unlock() do { pthread_mutex_unlock(&perl_mutex); } while (1)
#define perl_lock() do { pthread_mutex_lock(&perl_mutex); } while (0)
#define perl_unlock() do { pthread_mutex_unlock(&perl_mutex); } while (0)
#define ARG_UNDEFINED() do { XPUSHs(&PL_sv_undef); } while (1)
#define ARG_UNDEFINED() do { XPUSHs(&PL_sv_undef); } while (0)
void init_template_files();
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_inc((SV*)session_hv));
XPUSHs(newRV_inc((SV*)template_files));
XPUSHs(newRV_inc((SV*)perlify_status(&status)));
XPUSHs(newRV_noinc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)template_files));
XPUSHs(newRV_noinc((SV*)perlify_status(&status)));
if (statuses_before)
XPUSHs(newRV_inc((AV*)perlify_statuses(statuses_before, stat_before_len)));
XPUSHs(newRV_noinc((AV*)perlify_statuses(statuses_before, stat_before_len)));
else
XPUSHs(&PL_sv_undef);
if (statuses_after)
XPUSHs(newRV_inc((AV*)perlify_statuses(statuses_after, stat_after_len)));
XPUSHs(newRV_noinc((AV*)perlify_statuses(statuses_after, stat_after_len)));
else
XPUSHs(&PL_sv_undef);
// ARGS

View file

@ -51,18 +51,18 @@ void content_timeline(FCGX_Request* req,
SAVETMPS;
PUSHMARK(SP);
HV* session_hv = perlify_session(ssn);
XPUSHs(newRV_inc((SV*)session_hv));
XPUSHs(newRV_inc((SV*)template_files));
XPUSHs(newRV_noinc((SV*)session_hv));
XPUSHs(newRV_noinc((SV*)template_files));
if (statuses)
XPUSHs(newRV_inc((SV*)perlify_statuses(statuses, statuses_len)));
else { ARG_UNDEFINED(); }
XPUSHs(newRV_noinc((SV*)perlify_statuses(statuses, statuses_len)));
else ARG_UNDEFINED();
if (header_text)
XPUSHs(newSVpv(header_text, 0));
else { ARG_UNDEFINED(); }
else ARG_UNDEFINED();
XPUSHi(show_post_box);
mXPUSHi(show_post_box);
PUTBACK;
call_pv("timeline::content_timeline", G_SCALAR);