1 _info?> {} }; if ($content =~ s/(^|\n)lj-mood:\s*(.*)\n//i) { $event->{'props'}->{'current_mood'} = $2; } if ($content =~ s/(^|\n)lj-music:\s*(.*)\n//i) { $event->{'props'}->{'current_music'} = $2; } $content =~ s/^\s+//; $content =~ s/\s+$//; $event->{'event'} = $content; return $event; }; $u = LJ::get_remote() or return $err->( BML::ml( ".post.login", { aopts => "href='login'" } ) ); $res = LJ::Protocol::do_request("login", { "ver" => $LJ::PROTOCOL_VER, "username" => $u->{'user'}, "getpickws" => 1, }, undef, { "noauth" => 1, "u" => $u, }); return "" unless LJ::did_post(); return "$ML{'.post.error'} $ML{'error.invalidform'}" unless LJ::check_form_auth(); my $event = $parse_content->($POST{'event'}); my $journal = $POST{'usejournal'}; my $sec = $POST{'security'}; my $allowmask = undef; if ($sec eq "friends") { $sec = "usemask"; $allowmask = 1; } my $req = { 'usejournal' => $journal ne $u->{user} ? $journal : undef, 'ver' => 1, 'username' => $u->user, 'event' => $event->{'event'}, 'subject' => $POST{'subject'}, 'props' => $event->{'props'}, 'tz' => 'guess', 'security' => $sec, 'allowmask' => $allowmask, }; my $errcode; my $res = LJ::Protocol::do_request("postevent", $req, \$errcode, { "noauth" => 1, "u" => $u, }); if ($errcode) { return $err->( ": " . LJ::Protocol::error_message($errcode) ); } my $url = $res->{url}; BML::finish(); my $ret = ""; $ret .= BML::ml( ".post.back", { aopts => "href='./'", sitename => $LJ::SITENAMESHORT } ) . "