properly set mastodon data into user object

master
Benjamin Schieder 2017-04-26 07:45:02 +01:00
parent 4a09181498
commit 0e83b8d0de
3 changed files with 7 additions and 6 deletions

View File

@ -38,7 +38,8 @@ sub authenticate {
}
$reply->{token} = $token;
$reply->{instance} = $instance;
return $class->new($reply);
$user->{mastodon} = $reply;
return $user;
}
return 0;
}

View File

@ -22,13 +22,13 @@ sub fill_content {
if ($main::FORM{inputURL}){
my %nf;
$nf{url} = $main::FORM{inputURL};
$nf{username} = $main::CURRENTUSER->{data}->{acct};
$nf{username} = $main::CURRENTUSER->{mastodon}->{acct};
$nf{instance} = $main::FORM{instance};
$nf{enabled} = "n";
my $feed = RSSTootalizer::Feed->create_and_fetch(%nf);
}
my @feeds = RSSTootalizer::Feed->get_by_user_instance($main::CURRENTUSER->{data}->{acct}, $main::FORM{instance});
my @feeds = RSSTootalizer::Feed->get_by_user_instance($main::CURRENTUSER->{mastodon}->{acct}, $main::FORM{instance});
my @param_feeds;
my $count = 0;
FEED: foreach my $feed (@feeds){
@ -61,8 +61,8 @@ sub prerender {
$self->{"content_type"} = "html";
$self->{"params"}->{"currentmode"} = "Dashboard";
foreach my $key (keys %{$main::CURRENTUSER->{data}}){
$self->{"params"}->{"acct_$key"} = $main::CURRENTUSER->{data}->{$key};
foreach my $key (keys %{$main::CURRENTUSER->{mastodon}}){
$self->{"params"}->{"acct_$key"} = $main::CURRENTUSER->{mastodon}->{$key};
}
}

View File

@ -25,7 +25,7 @@ sub fill_content {
return 1;
}
if ($feed->{data}->{username} ne $main::CURRENTUSER->{data}->{acct} or $feed->{data}->{instance} ne $main::FORM{instance}){
if ($feed->{data}->{username} ne $main::CURRENTUSER->{mastodon}->{acct} or $feed->{data}->{instance} ne $main::FORM{instance}){
main::Error("Unknown feed", "This feed id is not known");
return 1;
}