Compare commits

..

2 Commits

Author SHA1 Message Date
Trinity Pointard 140a1f8eda cargo update 2019-12-19 09:36:40 +01:00
Trinity Pointard 07b70c084e upgrade compiler to nightly-2019-12-17 2019-12-19 09:17:05 +01:00
212 changed files with 14784 additions and 16481 deletions
+2 -3
View File
@@ -10,7 +10,7 @@ executors:
type: boolean type: boolean
default: false default: false
docker: docker:
- image: plumeorg/plume-buildenv:v0.0.9 - image: plumeorg/plume-buildenv:v0.0.7
- image: <<#parameters.postgres>>circleci/postgres:9.6-alpine<</parameters.postgres>><<^parameters.postgres>>alpine:latest<</parameters.postgres>> - image: <<#parameters.postgres>>circleci/postgres:9.6-alpine<</parameters.postgres>><<^parameters.postgres>>alpine:latest<</parameters.postgres>>
environment: environment:
POSTGRES_USER: postgres POSTGRES_USER: postgres
@@ -82,7 +82,7 @@ commands:
type: string type: string
steps: steps:
- run: zip -0 ccov.zip `find . -name 'plume*.gc*' -o -name 'plm*.gc*'` - run: zip -0 ccov.zip `find . -name 'plume*.gc*' -o -name 'plm*.gc*'`
- run: grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore '/*' -o lcov.info - run: grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore-dir '/*' -o lcov.info
- run: bash <(curl -s https://codecov.io/bash) -f lcov.info -F <<parameters.type>> - run: bash <(curl -s https://codecov.io/bash) -f lcov.info -F <<parameters.type>>
- run: find . -name 'plume*.gc*' -delete -o -name 'plm*.gc*' -delete - run: find . -name 'plume*.gc*' -delete -o -name 'plm*.gc*' -delete
- run: rm ccov.zip lcov.info - run: rm ccov.zip lcov.info
@@ -226,7 +226,6 @@ jobs:
steps: steps:
- restore_env: - restore_env:
cache: none cache: none
- run: cargo build
- run: crowdin upload -b master - run: crowdin upload -b master
workflows: workflows:
+2 -2
View File
@@ -4,11 +4,11 @@ ENV PATH="/root/.cargo/bin:${PATH}"
#install native/circleci/build dependancies #install native/circleci/build dependancies
RUN apt update &&\ RUN apt update &&\
apt install -y --no-install-recommends git ssh tar gzip ca-certificates default-jre&&\ apt install -y --no-install-recommends git ssh tar gzip ca-certificates default-jre&&\
apt install -y --no-install-recommends binutils-dev build-essential cmake curl gcc gettext git libcurl4-openssl-dev libdw-dev libelf-dev libiberty-dev libpq-dev libsqlite3-dev libssl-dev make openssl pkg-config postgresql postgresql-contrib python zlib1g-dev python3-pip zip unzip libclang-dev&&\ apt install -y --no-install-recommends binutils-dev build-essential cmake curl gcc gettext git libcurl4-openssl-dev libdw-dev libelf-dev libiberty-dev libpq-dev libsqlite3-dev libssl-dev make openssl pkg-config postgresql postgresql-contrib python zlib1g-dev python3-pip zip unzip &&\
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
#install and configure rust #install and configure rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2020-01-15 -y &&\ RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2019-03-23 -y &&\
rustup component add rustfmt clippy &&\ rustup component add rustfmt clippy &&\
rustup component add rust-std --target wasm32-unknown-unknown rustup component add rust-std --target wasm32-unknown-unknown
-1
View File
@@ -18,4 +18,3 @@ tags.*
search_index search_index
.buildconfig .buildconfig
__pycache__ __pycache__
.vscode/
Generated
+1858 -2029
View File
File diff suppressed because it is too large Load Diff
+12 -16
View File
@@ -1,14 +1,12 @@
[package] [package]
authors = ["Plume contributors"] authors = ["Plume contributors"]
name = "plume" name = "plume"
version = "0.4.0" version = "0.3.0"
repository = "https://github.com/Plume-org/Plume" repository = "https://github.com/Plume-org/Plume"
edition = "2018"
[dependencies] [dependencies]
activitypub = "0.1.3" activitypub = "0.1.3"
askama_escape = "0.1" askama_escape = "0.1"
async-trait = "*"
atom_syndication = "0.6" atom_syndication = "0.6"
clap = "2.33" clap = "2.33"
colored = "1.8" colored = "1.8"
@@ -21,19 +19,19 @@ heck = "0.3.0"
lettre = "0.9.2" lettre = "0.9.2"
lettre_email = "0.9.2" lettre_email = "0.9.2"
num_cpus = "1.10" num_cpus = "1.10"
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "async" } rocket = "0.4.0"
rocket_contrib = { git = "https://github.com/SergioBenitez/Rocket", rev = "async" , features = ["json"] } rocket_contrib = { version = "0.4.0", features = ["json"] }
rocket_i18n = { git = "https://github.com/Plume-org/rocket_i18n", rev = "e922afa7c366038b3433278c03b1456b346074f2" }
rpassword = "4.0" rpassword = "4.0"
runtime-fmt = "0.4.0"
scheduled-thread-pool = "0.2.2" scheduled-thread-pool = "0.2.2"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
serde_qs = "0.5" serde_qs = "0.5"
shrinkwraprs = "0.2.1" shrinkwraprs = "0.2.1"
syntect = "3.3" validator = "0.8"
tokio = "0.2" validator_derive = "0.8"
validator = "0.10" webfinger = "0.4.1"
validator_derive = "0.10"
webfinger = { git = "https://github.com/Plume-org/webfinger", rev = "4e8f12810c4a7ba7a07bbcb722cd265fdff512b6", features = ["async"] }
[[bin]] [[bin]]
name = "plume" name = "plume"
@@ -65,14 +63,12 @@ path = "plume-common"
[dependencies.plume-models] [dependencies.plume-models]
path = "plume-models" path = "plume-models"
[dependencies.rocket_i18n] [dependencies.rocket_csrf]
git = "https://github.com/Plume-org/rocket_i18n" git = "https://github.com/fdb-hiroshima/rocket_csrf"
branch = "go-async" rev = "29910f2829e7e590a540da3804336577b48c7b31"
default-features = false
features = ["rocket"]
[build-dependencies] [build-dependencies]
ructe = "0.9.0" ructe = "0.6.2"
rsass = "0.9" rsass = "0.9"
[features] [features]
+1 -2
View File
@@ -10,8 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \ gcc \
make \ make \
openssl \ openssl \
libssl-dev \ libssl-dev
clang
WORKDIR /scratch WORKDIR /scratch
COPY script/wasm-deps.sh . COPY script/wasm-deps.sh .
@@ -17,12 +17,3 @@ $text-color: $white;
$primary: $purple; $primary: $purple;
$primary-text-color: $white; // text color on primary background (buttons for instance) $primary-text-color: $white; // text color on primary background (buttons for instance)
$success-color: $blue; $success-color: $blue;
//Code Highlighting
$code-keyword-color: #f79ac1;
$code-source-color: #a6f0ab;
$code-constant-color: #dfec84;
$code-operator-color: #eddf95;
$code-string-color: #f2ae60;
$code-comment-color: #a3b4f9;
+88 -47
View File
@@ -190,28 +190,7 @@ p.error {
background: $gray; background: $gray;
text-overflow: ellipsis; text-overflow: ellipsis;
footer.authors {
div {
float: left;
margin-right: 0.25em;
}
.likes { color: $red; }
.reshares { color: $primary; }
span.likes, span.resahres {
font-family: "Route159",serif;
font-size: 1em;
}
svg.feather {
width: 0.85em;
height: 0.85em;
}
}
> * { > * {
margin: 20px; margin: 20px;
@@ -490,6 +469,93 @@ figure {
/// Small screens /// Small screens
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}
body > header {
flex-direction: column;
nav#menu {
display: inline-flex;
z-index: 21;
}
#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}
body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
animation: 0.2s menuOpening;
&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;
z-index: -10;
background: $primary;
}
> nav {
flex-direction: column;
align-items: flex-start;
a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;
&.title { font-size: 1.8em; }
> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}
main .article-meta { main .article-meta {
> *, .comments { > *, .comments {
margin: 0 5%; margin: 0 5%;
@@ -557,28 +623,3 @@ figure {
} }
} }
} }
//highlighting
code {
.constant{
color: $code-constant-color;
}
.string{
color: $code-string-color;
}
.keyword.type,.keyword.control,.type{
color: $code-keyword-color;
}
.keyword.operator{
color: $code-operator-color;
}
.source{
color: $code-source-color;
}
.comment{
color: $code-comment-color;
}
.function{
color:inherit;
}
}
-90
View File
@@ -101,96 +101,6 @@ body > header {
} }
} }
/// Small screens
@media screen and (max-width: 600px) {
@keyframes menuOpening {
from {
transform: scaleX(0);
transform-origin: left;
opacity: 0;
}
to {
transform: scaleX(1);
transform-origin: left;
opacity: 1;
}
}
body > header {
flex-direction: column;
nav#menu {
display: inline-flex;
z-index: 21;
}
#content {
display: none;
appearance: none;
text-align: center;
z-index: 20;
}
}
body > header:focus-within #content, #content.show {
position: fixed;
display: flex;
flex-direction: column;
justify-content: flex-start;
top: 0;
left: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
animation: 0.2s menuOpening;
&::before {
content: "";
position: absolute;
transform: skewX(-10deg);
top: 0;
left: -20%;
width: 100%;
height: 100%;
z-index: -10;
background: $primary;
}
> nav {
flex-direction: column;
align-items: flex-start;
a {
display: flex;
flex-direction: row;
align-items: center;
margin: 0;
padding: 1rem 1.5rem;
color: $background;
font-size: 1.4em;
font-weight: 300;
&.title { font-size: 1.8em; }
> *:first-child { width: 3rem; }
> img:first-child { height: 3rem; }
> *:last-child { margin-left: 1rem; }
> nav hr {
display: block;
margin: 0;
width: 100%;
border: solid $background 0.1rem;
}
.mobile-label { display: initial; }
}
}
}
}
/* Only enable label animations on large screens */ /* Only enable label animations on large screens */
@media screen and (min-width: 600px) { @media screen and (min-width: 600px) {
header nav a { header nav a {
-8
View File
@@ -27,11 +27,3 @@ $margin: 0 $horizontal-margin;
$route159: "Route159", serif; $route159: "Route159", serif;
$playfair: "Playfair Display", serif; $playfair: "Playfair Display", serif;
$lora: "Lora", serif; $lora: "Lora", serif;
//Code Highlighting
$code-keyword-color: #45244a;
$code-source-color: #4c588c;
$code-constant-color: scale-color(magenta,$lightness:-5%);
$code-operator-color: scale-color($code-source-color,$lightness:-5%);
$code-string-color: #8a571c;
$code-comment-color: #1c4c8a;
+2
View File
@@ -1,3 +1,5 @@
extern crate rsass;
extern crate ructe;
use ructe::Ructe; use ructe::Ructe;
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::{ffi::OsStr, fs::*, io::Write, path::*}; use std::{ffi::OsStr, fs::*, io::Write, path::*};
@@ -1,3 +0,0 @@
-- This file should undo anything in `up.sql`
drop table email_blocklist;
@@ -1,6 +0,0 @@
-- Your SQL goes here
CREATE TABLE email_blocklist(id SERIAL PRIMARY KEY,
email_address TEXT UNIQUE,
note TEXT,
notify_user BOOLEAN DEFAULT FALSE,
notification_text TEXT);
@@ -1,3 +0,0 @@
-- This file should undo anything in `up.sql`
drop table email_blocklist;
@@ -1,6 +0,0 @@
-- Your SQL goes here
CREATE TABLE email_blocklist(id INTEGER PRIMARY KEY,
email_address TEXT UNIQUE,
note TEXT,
notify_user BOOLEAN DEFAULT FALSE,
notification_text TEXT);
+1 -2
View File
@@ -1,8 +1,7 @@
[package] [package]
name = "plume-api" name = "plume-api"
version = "0.4.0" version = "0.3.0"
authors = ["Plume contributors"] authors = ["Plume contributors"]
edition = "2018"
[dependencies] [dependencies]
serde = "1.0" serde = "1.0"
+1
View File
@@ -1,3 +1,4 @@
extern crate serde;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
+1 -2
View File
@@ -1,8 +1,7 @@
[package] [package]
name = "plume-cli" name = "plume-cli"
version = "0.4.0" version = "0.3.0"
authors = ["Plume contributors"] authors = ["Plume contributors"]
edition = "2018"
[[bin]] [[bin]]
name = "plm" name = "plm"
+5 -1
View File
@@ -1,4 +1,8 @@
use dotenv; extern crate clap;
extern crate diesel;
extern crate dotenv;
extern crate plume_models;
extern crate rpassword;
use clap::App; use clap::App;
use diesel::Connection; use diesel::Connection;
+6 -13
View File
@@ -1,28 +1,25 @@
[package] [package]
name = "plume-common" name = "plume-common"
version = "0.4.0" version = "0.3.0"
authors = ["Plume contributors"] authors = ["Plume contributors"]
edition = "2018"
[dependencies] [dependencies]
activitypub = "0.1.1" activitypub = "0.1.1"
activitystreams-derive = "0.2" activitystreams-derive = "0.1.1"
activitystreams-traits = "0.1.0" activitystreams-traits = "0.1.0"
array_tool = "1.0" array_tool = "1.0"
base64 = "0.10" base64 = "0.10"
futures-util = "*"
heck = "0.3.0" heck = "0.3.0"
hex = "0.3" hex = "0.3"
hyper = "0.13" hyper = "0.12.33"
openssl = "0.10.22" openssl = "0.10.22"
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "async" } rocket = "0.4.0"
reqwest = "0.9"
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1.0" serde_json = "1.0"
shrinkwraprs = "0.2.1" shrinkwraprs = "0.2.1"
syntect = "3.3" tokio = "0.1.22"
tokio = "0.2"
regex-syntax = { version = "0.6.17", default-features = false, features = ["unicode-perl"] }
[dependencies.chrono] [dependencies.chrono]
features = ["serde"] features = ["serde"]
@@ -31,7 +28,3 @@ version = "0.4"
[dependencies.pulldown-cmark] [dependencies.pulldown-cmark]
default-features = false default-features = false
version = "0.2.0" version = "0.2.0"
[dependencies.reqwest]
features = ["json", "blocking"]
version = "0.10"
+3 -4
View File
@@ -279,9 +279,8 @@ pub trait FromId<C>: Sized {
/// Dereferences an ID /// Dereferences an ID
fn deref(id: &str) -> Result<Self::Object, (Option<serde_json::Value>, Self::Error)> { fn deref(id: &str) -> Result<Self::Object, (Option<serde_json::Value>, Self::Error)> {
// Use blocking reqwest API here, since defer cannot be async (yet) reqwest::ClientBuilder::new()
reqwest::blocking::Client::builder() .connect_timeout(Some(std::time::Duration::from_secs(5)))
.connect_timeout(std::time::Duration::from_secs(5))
.build() .build()
.map_err(|_| (None, InboxError::DerefError.into()))? .map_err(|_| (None, InboxError::DerefError.into()))?
.get(id) .get(id)
@@ -297,7 +296,7 @@ pub trait FromId<C>: Sized {
) )
.send() .send()
.map_err(|_| (None, InboxError::DerefError)) .map_err(|_| (None, InboxError::DerefError))
.and_then(|r| { .and_then(|mut r| {
let json: serde_json::Value = r let json: serde_json::Value = r
.json() .json()
.map_err(|_| (None, InboxError::InvalidObject(None)))?; .map_err(|_| (None, InboxError::InvalidObject(None)))?;
+37 -42
View File
@@ -1,12 +1,14 @@
use activitypub::{Activity, Link, Object}; use activitypub::{Activity, Link, Object};
use array_tool::vec::Uniq; use array_tool::vec::Uniq;
use reqwest::ClientBuilder; use reqwest::r#async::ClientBuilder;
use rocket::{ use rocket::{
http::Status, http::Status,
request::{FromRequest, Request}, request::{FromRequest, Request},
response::{Responder, Response, Result}, response::{Responder, Response},
Outcome, Outcome,
}; };
use serde_json;
use tokio::prelude::*;
use self::sign::Signable; use self::sign::Signable;
@@ -60,45 +62,39 @@ impl<T> ActivityStream<T> {
ActivityStream(t) ActivityStream(t)
} }
} }
#[rocket::async_trait]
impl<'r, O: Object + Send + 'r> Responder<'r> for ActivityStream<O> { impl<'r, O: Object> Responder<'r> for ActivityStream<O> {
async fn respond_to(self, request: &'r Request<'_>) -> Result<'r> { fn respond_to(self, request: &Request) -> Result<Response<'r>, Status> {
let mut json = serde_json::to_value(&self.0).map_err(|_| Status::InternalServerError)?; let mut json = serde_json::to_value(&self.0).map_err(|_| Status::InternalServerError)?;
json["@context"] = context(); json["@context"] = context();
let result = serde_json::to_string(&json).map_err(rocket::response::Debug); serde_json::to_string(&json).respond_to(request).map(|r| {
match result.respond_to(request).await { Response::build_from(r)
Ok(r) => Response::build_from(r)
.raw_header("Content-Type", "application/activity+json") .raw_header("Content-Type", "application/activity+json")
.ok(), .finalize()
Err(e) => Err(e), })
}
} }
} }
#[derive(Clone)] #[derive(Clone)]
pub struct ApRequest; pub struct ApRequest;
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for ApRequest { impl<'a, 'r> FromRequest<'a, 'r> for ApRequest {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> Outcome<Self, (Status, Self::Error), ()> { fn from_request(request: &'a Request<'r>) -> Outcome<Self, (Status, Self::Error), ()> {
request request
.headers() .headers()
.get_one("Accept") .get_one("Accept")
.map(|header| { .map(|header| {
header header
.split(',') .split(',')
.map(|ct| { .map(|ct| match ct.trim() {
match ct.trim() { // bool for Forward: true if found a valid Content-Type for Plume first (HTML), false otherwise
// bool for Forward: true if found a valid Content-Type for Plume first (HTML), "application/ld+json; profile=\"https://w3.org/ns/activitystreams\""
// false otherwise | "application/ld+json;profile=\"https://w3.org/ns/activitystreams\""
"application/ld+json; profile=\"https://w3.org/ns/activitystreams\"" | "application/activity+json"
| "application/ld+json;profile=\"https://w3.org/ns/activitystreams\"" | "application/ld+json" => Outcome::Success(ApRequest),
| "application/activity+json" "text/html" => Outcome::Forward(true),
| "application/ld+json" => Outcome::Success(ApRequest), _ => Outcome::Forward(false),
"text/html" => Outcome::Forward(true),
_ => Outcome::Forward(false),
}
}) })
.fold(Outcome::Forward(false), |out, ct| { .fold(Outcome::Forward(false), |out, ct| {
if out.clone().forwarded().unwrap_or_else(|| out.is_success()) { if out.clone().forwarded().unwrap_or_else(|| out.is_success()) {
@@ -134,38 +130,36 @@ where
.sign(sender) .sign(sender)
.expect("activity_pub::broadcast: signature error"); .expect("activity_pub::broadcast: signature error");
let rt = tokio::runtime::Builder::new() let mut rt = tokio::runtime::current_thread::Runtime::new()
.threaded_scheduler()
.build()
.expect("Error while initializing tokio runtime for federation"); .expect("Error while initializing tokio runtime for federation");
let client = ClientBuilder::new()
.connect_timeout(std::time::Duration::from_secs(5))
.build()
.expect("Can't build client");
for inbox in boxes { for inbox in boxes {
let body = signed.to_string(); let body = signed.to_string();
let mut headers = request::headers(); let mut headers = request::headers();
headers.insert("Digest", request::Digest::digest(&body)); headers.insert("Digest", request::Digest::digest(&body));
let sig = request::signature(sender, &headers) rt.spawn(
.expect("activity_pub::broadcast: request signature error");
let client = ClientBuilder::new()
.connect_timeout(std::time::Duration::from_secs(5))
.build()
.expect("Can't build client");
rt.spawn(async move {
client client
.post(&inbox) .post(&inbox)
.headers(headers.clone()) .headers(headers.clone())
.header("Signature", sig) .header(
"Signature",
request::signature(sender, &headers)
.expect("activity_pub::broadcast: request signature error"),
)
.body(body) .body(body)
.send() .send()
.await .and_then(|r| r.into_body().concat2())
.unwrap()
.text()
.await
.map(move |response| { .map(move |response| {
println!("Successfully sent activity to inbox ({})", inbox); println!("Successfully sent activity to inbox ({})", inbox);
println!("Response: \"{:?}\"\n", response) println!("Response: \"{:?}\"\n", response)
}) })
.map_err(|e| println!("Error while sending to inbox ({:?})", e)) .map_err(|e| println!("Error while sending to inbox ({:?})", e)),
}); );
} }
rt.run().unwrap();
} }
#[derive(Shrinkwrap, Clone, Serialize, Deserialize)] #[derive(Shrinkwrap, Clone, Serialize, Deserialize)]
@@ -209,7 +203,8 @@ pub struct PublicKey {
pub public_key_pem: Option<serde_json::Value>, pub public_key_pem: Option<serde_json::Value>,
} }
#[derive(Clone, Debug, Default, Deserialize, Serialize)] #[derive(Clone, Debug, Default, UnitString)]
#[activitystreams(Hashtag)]
pub struct HashtagType; pub struct HashtagType;
#[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)] #[derive(Clone, Debug, Default, Deserialize, Serialize, Properties)]
+3 -2
View File
@@ -1,11 +1,12 @@
use base64;
use chrono::{offset::Utc, DateTime}; use chrono::{offset::Utc, DateTime};
use openssl::hash::{Hasher, MessageDigest}; use openssl::hash::{Hasher, MessageDigest};
use reqwest::header::{HeaderMap, HeaderValue, ACCEPT, CONTENT_TYPE, DATE, USER_AGENT}; use reqwest::header::{HeaderMap, HeaderValue, ACCEPT, CONTENT_TYPE, DATE, USER_AGENT};
use std::ops::Deref; use std::ops::Deref;
use std::time::SystemTime; use std::time::SystemTime;
use crate::activity_pub::sign::Signer; use activity_pub::sign::Signer;
use crate::activity_pub::{ap_accept_header, AP_CONTENT_TYPE}; use activity_pub::{ap_accept_header, AP_CONTENT_TYPE};
const PLUME_USER_AGENT: &str = concat!("Plume/", env!("CARGO_PKG_VERSION")); const PLUME_USER_AGENT: &str = concat!("Plume/", env!("CARGO_PKG_VERSION"));
+4 -1
View File
@@ -1,7 +1,10 @@
use super::request; use super::request;
use base64;
use chrono::{naive::NaiveDateTime, DateTime, Duration, Utc}; use chrono::{naive::NaiveDateTime, DateTime, Duration, Utc};
use hex;
use openssl::{pkey::PKey, rsa::Rsa, sha::sha256}; use openssl::{pkey::PKey, rsa::Rsa, sha::sha256};
use rocket::http::HeaderMap; use rocket::http::HeaderMap;
use serde_json;
/// Returns (public key, private key) /// Returns (public key, private key)
pub fn gen_keypair() -> (Vec<u8>, Vec<u8>) { pub fn gen_keypair() -> (Vec<u8>, Vec<u8>) {
@@ -128,7 +131,7 @@ impl SignatureValidity {
pub fn verify_http_headers<S: Signer + ::std::fmt::Debug>( pub fn verify_http_headers<S: Signer + ::std::fmt::Debug>(
sender: &S, sender: &S,
all_headers: &HeaderMap<'_>, all_headers: &HeaderMap,
data: &request::Digest, data: &request::Digest,
) -> SignatureValidity { ) -> SignatureValidity {
let sig_header = all_headers.get_one("Signature"); let sig_header = all_headers.get_one("Signature");
+13 -1
View File
@@ -1,14 +1,26 @@
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
extern crate activitypub;
#[macro_use] #[macro_use]
extern crate activitystreams_derive; extern crate activitystreams_derive;
extern crate activitystreams_traits;
extern crate array_tool;
extern crate base64;
extern crate chrono;
extern crate heck;
extern crate hex;
extern crate openssl;
extern crate pulldown_cmark;
extern crate reqwest;
extern crate rocket;
extern crate serde;
#[macro_use] #[macro_use]
extern crate shrinkwraprs; extern crate shrinkwraprs;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
#[macro_use] #[macro_use]
extern crate serde_json; extern crate serde_json;
extern crate tokio;
pub mod activity_pub; pub mod activity_pub;
pub mod utils; pub mod utils;
+17 -96
View File
@@ -1,15 +1,12 @@
use heck::CamelCase; use heck::CamelCase;
use openssl::rand::rand_bytes; use openssl::rand::rand_bytes;
use pulldown_cmark::{html, Event, Options, Parser, Tag}; use pulldown_cmark::{html, Event, Options, Parser, Tag};
use regex_syntax::is_word_character;
use rocket::{ use rocket::{
http::uri::Uri, http::uri::Uri,
response::{Flash, Redirect}, response::{Flash, Redirect},
}; };
use std::borrow::Cow; use std::borrow::Cow;
use std::collections::HashSet; use std::collections::HashSet;
use syntect::html::ClassedHTMLGenerator;
use syntect::parsing::SyntaxSet;
/// Generates an hexadecimal representation of 32 bytes of random data /// Generates an hexadecimal representation of 32 bytes of random data
pub fn random_hex() -> String { pub fn random_hex() -> String {
@@ -49,7 +46,7 @@ enum State {
Ready, Ready,
} }
fn to_inline(tag: Tag<'_>) -> Tag<'_> { fn to_inline(tag: Tag) -> Tag {
match tag { match tag {
Tag::Header(_) | Tag::Table(_) | Tag::TableHead | Tag::TableRow | Tag::TableCell => { Tag::Header(_) | Tag::Table(_) | Tag::TableHead | Tag::TableRow | Tag::TableCell => {
Tag::Paragraph Tag::Paragraph
@@ -58,54 +55,7 @@ fn to_inline(tag: Tag<'_>) -> Tag<'_> {
t => t, t => t,
} }
} }
struct HighlighterContext {
content: Vec<String>,
}
fn highlight_code<'a>(
context: &mut Option<HighlighterContext>,
evt: Event<'a>,
) -> Option<Vec<Event<'a>>> {
match evt {
Event::Start(Tag::CodeBlock(lang)) => {
if lang.is_empty() {
Some(vec![Event::Start(Tag::CodeBlock(lang))])
} else {
*context = Some(HighlighterContext { content: vec![] });
Some(vec![Event::Start(Tag::CodeBlock(lang))])
}
}
Event::End(Tag::CodeBlock(x)) => {
let mut result = vec![];
if let Some(ctx) = context.take() {
let syntax_set = SyntaxSet::load_defaults_newlines();
let syntax = syntax_set.find_syntax_by_token(&x).unwrap_or_else(|| {
syntax_set
.find_syntax_by_name(&x)
.unwrap_or_else(|| syntax_set.find_syntax_plain_text())
});
let mut html = ClassedHTMLGenerator::new(&syntax, &syntax_set);
for line in ctx.content {
html.parse_html_for_line(&line);
}
let q = html.finalize();
result.push(Event::Html(q.into()));
}
result.push(Event::End(Tag::CodeBlock(x)));
*context = None;
Some(result)
}
Event::Text(t) => {
if let Some(mut c) = context.take() {
c.content.push(t.to_string());
*context = Some(c);
Some(vec![])
} else {
Some(vec![Event::Text(t)])
}
}
_ => Some(vec![evt]),
}
}
fn flatten_text<'a>(state: &mut Option<String>, evt: Event<'a>) -> Option<Vec<Event<'a>>> { fn flatten_text<'a>(state: &mut Option<String>, evt: Event<'a>) -> Option<Vec<Event<'a>>> {
let (s, res) = match evt { let (s, res) = match evt {
Event::Text(txt) => match state.take() { Event::Text(txt) => match state.take() {
@@ -158,7 +108,9 @@ fn process_image<'a, 'b>(
match evt { match evt {
Event::Start(Tag::Image(id, title)) => { Event::Start(Tag::Image(id, title)) => {
if let Some((url, cw)) = id.parse::<i32>().ok().and_then(processor.as_ref()) { if let Some((url, cw)) = id.parse::<i32>().ok().and_then(processor.as_ref()) {
if let (Some(cw), false) = (cw, inline) { if inline || cw.is_none() {
Event::Start(Tag::Image(Cow::Owned(url), title))
} else {
// there is a cw, and where are not inline // there is a cw, and where are not inline
Event::Html(Cow::Owned(format!( Event::Html(Cow::Owned(format!(
r#"<label for="postcontent-cw-{id}"> r#"<label for="postcontent-cw-{id}">
@@ -169,11 +121,9 @@ fn process_image<'a, 'b>(
</span> </span>
<img src="{url}" alt=""#, <img src="{url}" alt=""#,
id = random_hex(), id = random_hex(),
cw = cw, cw = cw.unwrap(),
url = url url = url
))) )))
} else {
Event::Start(Tag::Image(Cow::Owned(url), title))
} }
} else { } else {
Event::Start(Tag::Image(id, title)) Event::Start(Tag::Image(id, title))
@@ -201,12 +151,6 @@ fn process_image<'a, 'b>(
} }
} }
#[derive(Default, Debug)]
struct DocumentContext {
in_code: bool,
in_link: bool,
}
/// Returns (HTML, mentions, hashtags) /// Returns (HTML, mentions, hashtags)
pub fn md_to_html<'a>( pub fn md_to_html<'a>(
md: &str, md: &str,
@@ -221,32 +165,14 @@ pub fn md_to_html<'a>(
}; };
let parser = Parser::new_ext(md, Options::all()); let parser = Parser::new_ext(md, Options::all());
let (parser, mentions, hashtags): (Vec<Event<'_>>, Vec<String>, Vec<String>) = parser let (parser, mentions, hashtags): (Vec<Event>, Vec<String>, Vec<String>) = parser
// Flatten text because pulldown_cmark break #hashtag in two individual text elements // Flatten text because pulldown_cmark break #hashtag in two individual text elements
.scan(None, flatten_text) .scan(None, flatten_text)
.flatten() .flat_map(IntoIterator::into_iter)
.scan(None, highlight_code)
.flatten()
.map(|evt| process_image(evt, inline, &media_processor)) .map(|evt| process_image(evt, inline, &media_processor))
// Ignore headings, images, and tables if inline = true // Ignore headings, images, and tables if inline = true
.scan((vec![], inline), inline_tags) .scan((vec![], inline), inline_tags)
.scan(&mut DocumentContext::default(), |ctx, evt| match evt { .map(|evt| match evt {
Event::Start(Tag::CodeBlock(_)) | Event::Start(Tag::Code) => {
ctx.in_code = true;
Some((vec![evt], vec![], vec![]))
}
Event::End(Tag::CodeBlock(_)) | Event::End(Tag::Code) => {
ctx.in_code = false;
Some((vec![evt], vec![], vec![]))
}
Event::Start(Tag::Link(_, _)) => {
ctx.in_link = true;
Some((vec![evt], vec![], vec![]))
}
Event::End(Tag::Link(_, _)) => {
ctx.in_link = false;
Some((vec![evt], vec![], vec![]))
}
Event::Text(txt) => { Event::Text(txt) => {
let (evts, _, _, _, new_mentions, new_hashtags) = txt.chars().fold( let (evts, _, _, _, new_mentions, new_hashtags) = txt.chars().fold(
(vec![], State::Ready, String::new(), 0, vec![], vec![]), (vec![], State::Ready, String::new(), 0, vec![], vec![]),
@@ -262,7 +188,7 @@ pub fn md_to_html<'a>(
text_acc.push(c) text_acc.push(c)
} }
let mention = text_acc; let mention = text_acc;
let short_mention = mention.splitn(1, '@').next().unwrap_or(""); let short_mention = mention.splitn(1, '@').nth(0).unwrap_or("");
let link = Tag::Link( let link = Tag::Link(
format!("{}@/{}/", base_url, &mention).into(), format!("{}@/{}/", base_url, &mention).into(),
short_mention.to_owned().into(), short_mention.to_owned().into(),
@@ -284,7 +210,7 @@ pub fn md_to_html<'a>(
} }
} }
State::Hashtag => { State::Hashtag => {
let char_matches = c == '-' || is_word_character(c); let char_matches = c.is_alphanumeric() || "-_".contains(c);
if char_matches && (n < (txt.chars().count() - 1)) { if char_matches && (n < (txt.chars().count() - 1)) {
text_acc.push(c); text_acc.push(c);
(events, State::Hashtag, text_acc, n + 1, mentions, hashtags) (events, State::Hashtag, text_acc, n + 1, mentions, hashtags)
@@ -315,7 +241,7 @@ pub fn md_to_html<'a>(
} }
} }
State::Ready => { State::Ready => {
if !ctx.in_code && !ctx.in_link && c == '@' { if c == '@' {
events.push(Event::Text(text_acc.into())); events.push(Event::Text(text_acc.into()));
( (
events, events,
@@ -325,7 +251,7 @@ pub fn md_to_html<'a>(
mentions, mentions,
hashtags, hashtags,
) )
} else if !ctx.in_code && !ctx.in_link && c == '#' { } else if c == '#' {
events.push(Event::Text(text_acc.into())); events.push(Event::Text(text_acc.into()));
( (
events, events,
@@ -370,9 +296,9 @@ pub fn md_to_html<'a>(
} }
}, },
); );
Some((evts, new_mentions, new_hashtags)) (evts, new_mentions, new_hashtags)
} }
_ => Some((vec![evt], vec![], vec![])), _ => (vec![evt], vec![], vec![]),
}) })
.fold( .fold(
(vec![], vec![], vec![]), (vec![], vec![], vec![]),
@@ -409,12 +335,9 @@ mod tests {
("mention at @end", vec!["end"]), ("mention at @end", vec!["end"]),
("between parenthesis (@test)", vec!["test"]), ("between parenthesis (@test)", vec!["test"]),
("with some punctuation @test!", vec!["test"]), ("with some punctuation @test!", vec!["test"]),
(" @spaces ", vec!["spaces"]), (" @spaces ", vec!["spaces"]),
("@is_a@mention", vec!["is_a@mention"]), ("@is_a@mention", vec!["is_a@mention"]),
("not_a@mention", vec![]), ("not_a@mention", vec![]),
("`@helo`", vec![]),
("```\n@hello\n```", vec![]),
("[@atmark in link](https://example.org/)", vec![]),
]; ];
for (md, mentions) in tests { for (md, mentions) in tests {
@@ -438,10 +361,8 @@ mod tests {
("hashtag at #end", vec!["end"]), ("hashtag at #end", vec!["end"]),
("between parenthesis (#test)", vec!["test"]), ("between parenthesis (#test)", vec!["test"]),
("with some punctuation #test!", vec!["test"]), ("with some punctuation #test!", vec!["test"]),
(" #spaces ", vec!["spaces"]), (" #spaces ", vec!["spaces"]),
("not_a#hashtag", vec![]), ("not_a#hashtag", vec![]),
("#نرم‌افزار_آزاد", vec!["نرم‌افزار_آزاد"]),
("[#hash in link](https://example.org/)", vec![]),
]; ];
for (md, mentions) in tests { for (md, mentions) in tests {
+2 -3
View File
@@ -1,8 +1,7 @@
[package] [package]
name = "plume-front" name = "plume-front"
version = "0.4.0" version = "0.3.0"
authors = ["Plume contributors"] authors = ["Plume contributors"]
edition = "2018"
[dependencies] [dependencies]
stdweb = "=0.4.18" stdweb = "=0.4.18"
@@ -12,4 +11,4 @@ gettext-macros = { git = "https://github.com/Plume-org/gettext-macros/", rev = "
gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" } gettext-utils = { git = "https://github.com/Plume-org/gettext-macros/", rev = "a7c605f7edd6bfbfbfe7778026bfefd88d82db10" }
lazy_static = "1.3" lazy_static = "1.3"
serde = "1.0" serde = "1.0"
serde_json = "1.0" serde_json = "1.0"
+1 -1
View File
@@ -1,4 +1,3 @@
use crate::CATALOG;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json; use serde_json;
use std::sync::Mutex; use std::sync::Mutex;
@@ -6,6 +5,7 @@ use stdweb::{
unstable::{TryFrom, TryInto}, unstable::{TryFrom, TryInto},
web::{event::*, html_element::*, *}, web::{event::*, html_element::*, *},
}; };
use CATALOG;
macro_rules! mv { macro_rules! mv {
( $( $var:ident ),* => $exp:expr ) => { ( $( $var:ident ),* => $exp:expr ) => {
+3
View File
@@ -1,12 +1,15 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
#![feature(decl_macro, proc_macro_hygiene, try_trait)] #![feature(decl_macro, proc_macro_hygiene, try_trait)]
extern crate gettext;
#[macro_use] #[macro_use]
extern crate gettext_macros; extern crate gettext_macros;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
#[macro_use] #[macro_use]
extern crate stdweb; extern crate stdweb;
extern crate serde;
extern crate serde_json;
use stdweb::web::{event::*, *}; use stdweb::web::{event::*, *};
init_i18n!( init_i18n!(
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "plume-macro" name = "plume-macro"
version = "0.4.0" version = "0.1.0"
authors = ["Trinity Pointard <trinity.pointard@insa-rennes.fr>"] authors = ["Trinity Pointard <trinity.pointard@insa-rennes.fr>"]
edition = "2018" edition = "2018"
description = "Plume procedural macros" description = "Plume procedural macros"
+14 -11
View File
@@ -1,7 +1,8 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
extern crate proc_macro;
#[macro_use] #[macro_use]
extern crate quote; extern crate quote;
extern crate syn;
use proc_macro::TokenStream; use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2; use proc_macro2::TokenStream as TokenStream2;
@@ -102,17 +103,19 @@ fn file_to_migration(file: &str) -> TokenStream2 {
acc.push_str(line); acc.push_str(line);
acc.push('\n'); acc.push('\n');
} }
} else if line.starts_with("--#!") {
acc.push_str(&line[4..]);
acc.push('\n');
} else if line.starts_with("--") {
continue;
} else { } else {
let func: TokenStream2 = trampoline(TokenStream::from_str(&acc).unwrap().into()); if line.starts_with("--#!") {
actions.push(quote!(Action::Function(&#func))); acc.push_str(&line[4..]);
sql = true; acc.push('\n');
acc = line.to_string(); } else if line.starts_with("--") {
acc.push('\n'); continue;
} else {
let func: TokenStream2 = trampoline(TokenStream::from_str(&acc).unwrap().into());
actions.push(quote!(Action::Function(&#func)));
sql = true;
acc = line.to_string();
acc.push('\n');
}
} }
} }
if !acc.trim().is_empty() { if !acc.trim().is_empty() {
+8 -21
View File
@@ -1,8 +1,7 @@
[package] [package]
name = "plume-models" name = "plume-models"
version = "0.4.0" version = "0.3.0"
authors = ["Plume contributors"] authors = ["Plume contributors"]
edition = "2018"
[dependencies] [dependencies]
activitypub = "0.1.1" activitypub = "0.1.1"
@@ -10,26 +9,25 @@ ammonia = "2.1.1"
askama_escape = "0.1" askama_escape = "0.1"
bcrypt = "0.5" bcrypt = "0.5"
guid-create = "0.1" guid-create = "0.1"
futures = "0.3"
heck = "0.3.0" heck = "0.3.0"
itertools = "0.8.0" itertools = "0.8.0"
lazy_static = "1.0" lazy_static = "*"
migrations_internals= "1.4.0" migrations_internals= "1.4.0"
openssl = "0.10.22" openssl = "0.10.22"
rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "async" } rocket = "0.4.0"
rocket_i18n = { git = "https://github.com/Plume-org/rocket_i18n", rev = "e922afa7c366038b3433278c03b1456b346074f2" }
reqwest = "0.9"
scheduled-thread-pool = "0.2.2" scheduled-thread-pool = "0.2.2"
serde = "1.0" serde = "1.0"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1.0" serde_json = "1.0"
tantivy = "0.10.1" tantivy = "0.10.1"
tokio = "0.2"
url = "2.1" url = "2.1"
walkdir = "2.2" walkdir = "2.2"
webfinger = { git = "https://github.com/Plume-org/webfinger", rev = "4e8f12810c4a7ba7a07bbcb722cd265fdff512b6", features = ["async"] } webfinger = "0.4.1"
whatlang = "0.7.1" whatlang = "0.7.1"
shrinkwraprs = "0.3" shrinkwraprs = "0.2.1"
diesel-derive-newtype = "0.1.2" diesel-derive-newtype = "0.1.2"
glob = "0.3.0"
[dependencies.chrono] [dependencies.chrono]
features = ["serde"] features = ["serde"]
@@ -48,19 +46,8 @@ path = "../plume-common"
[dependencies.plume-macro] [dependencies.plume-macro]
path = "../plume-macro" path = "../plume-macro"
[dependencies.reqwest]
features = ["json", "blocking"]
version = "0.10"
[dependencies.rocket_i18n]
git = "https://github.com/Plume-org/rocket_i18n"
branch = "go-async"
default-features = false
features = ["rocket"]
[dev-dependencies] [dev-dependencies]
diesel_migrations = "1.4.0" diesel_migrations = "1.3.0"
[features] [features]
postgres = ["diesel/postgres", "plume-macro/postgres" ] postgres = ["diesel/postgres", "plume-macro/postgres" ]
+6 -7
View File
@@ -1,19 +1,19 @@
use crate::users::User;
use rocket::{ use rocket::{
http::Status, http::Status,
request::{self, FromRequest, Request}, request::{self, FromRequest, Request},
Outcome, Outcome,
}; };
use users::User;
/// Wrapper around User to use as a request guard on pages reserved to admins. /// Wrapper around User to use as a request guard on pages reserved to admins.
pub struct Admin(pub User); pub struct Admin(pub User);
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for Admin { impl<'a, 'r> FromRequest<'a, 'r> for Admin {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<Admin, ()> {
let user = try_outcome!(User::from_request(request).await); let user = request.guard::<User>()?;
if user.is_admin() { if user.is_admin() {
Outcome::Success(Admin(user)) Outcome::Success(Admin(user))
} else { } else {
@@ -25,12 +25,11 @@ impl<'a, 'r> FromRequest<'a, 'r> for Admin {
/// Same as `Admin` but for moderators. /// Same as `Admin` but for moderators.
pub struct Moderator(pub User); pub struct Moderator(pub User);
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for Moderator { impl<'a, 'r> FromRequest<'a, 'r> for Moderator {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<Moderator, ()> {
let user = try_outcome!(User::from_request(request).await); let user = request.guard::<User>()?;
if user.is_moderator() { if user.is_moderator() {
Outcome::Success(Moderator(user)) Outcome::Success(Moderator(user))
} else { } else {
+20 -21
View File
@@ -1,4 +1,3 @@
use crate::{db_conn::DbConn, schema::api_tokens, Error, Result};
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use rocket::{ use rocket::{
@@ -7,6 +6,10 @@ use rocket::{
Outcome, Outcome,
}; };
use db_conn::DbConn;
use schema::api_tokens;
use {Error, Result};
#[derive(Clone, Queryable)] #[derive(Clone, Queryable)]
pub struct ApiToken { pub struct ApiToken {
pub id: i32, pub id: i32,
@@ -76,36 +79,32 @@ pub enum TokenError {
DbError, DbError,
} }
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for ApiToken { impl<'a, 'r> FromRequest<'a, 'r> for ApiToken {
type Error = TokenError; type Error = TokenError;
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<ApiToken, TokenError> {
let headers: Vec<_> = request.headers().get("Authorization").collect(); let headers: Vec<_> = request.headers().get("Authorization").collect();
if headers.len() != 1 { if headers.len() != 1 {
return Outcome::Failure((Status::BadRequest, TokenError::NoHeader)); return Outcome::Failure((Status::BadRequest, TokenError::NoHeader));
} }
let mut parsed_header = headers[0].split(' '); let mut parsed_header = headers[0].split(' ');
if let Some(auth_type) = parsed_header.next() { let auth_type = parsed_header.next().map_or_else(
if let Some(val) = parsed_header.next() { || Outcome::Failure((Status::BadRequest, TokenError::NoType)),
if auth_type == "Bearer" { Outcome::Success,
if let Outcome::Success(conn) = DbConn::from_request(request).await { )?;
if let Ok(token) = ApiToken::find_by_value(&*conn, val) { let val = parsed_header.next().map_or_else(
return Outcome::Success(token); || Outcome::Failure((Status::BadRequest, TokenError::NoValue)),
} Outcome::Success,
} else { )?;
return Outcome::Failure((
Status::InternalServerError, if auth_type == "Bearer" {
TokenError::DbError, let conn = request
)); .guard::<DbConn>()
} .map_failure(|_| (Status::InternalServerError, TokenError::DbError))?;
} if let Ok(token) = ApiToken::find_by_value(&*conn, val) {
} else { return Outcome::Success(token);
return Outcome::Failure((Status::BadRequest, TokenError::NoValue));
} }
} else {
return Outcome::Failure((Status::BadRequest, TokenError::NoType));
} }
Outcome::Forward(()) Outcome::Forward(())
+3 -1
View File
@@ -1,7 +1,9 @@
use crate::{schema::apps, Error, Result};
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use schema::apps;
use {Error, Result};
#[derive(Clone, Queryable, Serialize)] #[derive(Clone, Queryable, Serialize)]
pub struct App { pub struct App {
pub id: i32, pub id: i32,
-139
View File
@@ -1,139 +0,0 @@
use crate::{schema::email_blocklist, Connection, Error, Result};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, TextExpressionMethods};
use glob::Pattern;
#[derive(Clone, Queryable, Identifiable)]
#[table_name = "email_blocklist"]
pub struct BlocklistedEmail {
pub id: i32,
pub email_address: String,
pub note: String,
pub notify_user: bool,
pub notification_text: String,
}
#[derive(Insertable, FromForm)]
#[table_name = "email_blocklist"]
pub struct NewBlocklistedEmail {
pub email_address: String,
pub note: String,
pub notify_user: bool,
pub notification_text: String,
}
impl BlocklistedEmail {
insert!(email_blocklist, NewBlocklistedEmail);
get!(email_blocklist);
find_by!(email_blocklist, find_by_id, id as i32);
pub fn delete_entries(conn: &Connection, ids: Vec<i32>) -> Result<bool> {
use diesel::delete;
for i in ids {
let be: BlocklistedEmail = BlocklistedEmail::find_by_id(&conn, i)?;
delete(&be).execute(conn)?;
}
Ok(true)
}
pub fn find_for_domain(conn: &Connection, domain: &str) -> Result<Vec<BlocklistedEmail>> {
let effective = format!("%@{}", domain);
email_blocklist::table
.filter(email_blocklist::email_address.like(effective))
.load::<BlocklistedEmail>(conn)
.map_err(Error::from)
}
pub fn matches_blocklist(conn: &Connection, email: &str) -> Result<Option<BlocklistedEmail>> {
let mut result = email_blocklist::table.load::<BlocklistedEmail>(conn)?;
for i in result.drain(..) {
if let Ok(x) = Pattern::new(&i.email_address) {
if x.matches(email) {
return Ok(Some(i));
}
}
}
Ok(None)
}
pub fn page(conn: &Connection, (min, max): (i32, i32)) -> Result<Vec<BlocklistedEmail>> {
email_blocklist::table
.offset(min.into())
.limit((max - min).into())
.load::<BlocklistedEmail>(conn)
.map_err(Error::from)
}
pub fn count(conn: &Connection) -> Result<i64> {
email_blocklist::table
.count()
.get_result(conn)
.map_err(Error::from)
}
pub fn pattern_errors(pat: &str) -> Option<glob::PatternError> {
let c = Pattern::new(pat);
c.err()
}
pub fn new(
conn: &Connection,
pattern: &str,
note: &str,
show_notification: bool,
notification_text: &str,
) -> Result<BlocklistedEmail> {
let c = NewBlocklistedEmail {
email_address: pattern.to_owned(),
note: note.to_owned(),
notify_user: show_notification,
notification_text: notification_text.to_owned(),
};
BlocklistedEmail::insert(conn, c)
}
}
#[cfg(test)]
pub(crate) mod tests {
use super::*;
use crate::{instance::tests as instance_tests, tests::rockets, Connection as Conn};
use diesel::Connection;
pub(crate) fn fill_database(conn: &Conn) -> Vec<BlocklistedEmail> {
instance_tests::fill_database(conn);
let domainblock =
BlocklistedEmail::new(conn, "*@bad-actor.com", "Mean spammers", false, "").unwrap();
let userblock = BlocklistedEmail::new(
conn,
"spammer@lax-administration.com",
"Decent enough domain, but this user is a problem.",
true,
"Stop it please",
)
.unwrap();
vec![domainblock, userblock]
}
#[test]
fn test_match() {
let r = rockets();
let conn = &*r.conn;
conn.test_transaction::<_, (), _>(|| {
let various = fill_database(conn);
let match1 = "user1@bad-actor.com";
let match2 = "spammer@lax-administration.com";
let no_match = "happy-user@lax-administration.com";
assert_eq!(
BlocklistedEmail::matches_blocklist(conn, match1)
.unwrap()
.unwrap()
.id,
various[0].id
);
assert_eq!(
BlocklistedEmail::matches_blocklist(conn, match2)
.unwrap()
.unwrap()
.id,
various[1].id
);
assert_eq!(
BlocklistedEmail::matches_blocklist(conn, no_match)
.unwrap()
.is_none(),
true
);
Ok(())
});
}
}
+3 -1
View File
@@ -1,6 +1,8 @@
use crate::{schema::blog_authors, Error, Result};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use schema::blog_authors;
use {Error, Result};
#[derive(Clone, Queryable, Identifiable)] #[derive(Clone, Queryable, Identifiable)]
pub struct BlogAuthor { pub struct BlogAuthor {
pub id: i32, pub id: i32,
+28 -26
View File
@@ -1,7 +1,3 @@
use crate::{
ap_url, instance::*, medias::Media, posts::Post, safe_string::SafeString, schema::blogs,
search::Searcher, users::User, Connection, Error, PlumeRocket, Result, ITEMS_PER_PAGE,
};
use activitypub::{ use activitypub::{
actor::Group, actor::Group,
collection::{OrderedCollection, OrderedCollectionPage}, collection::{OrderedCollection, OrderedCollectionPage},
@@ -16,12 +12,22 @@ use openssl::{
rsa::Rsa, rsa::Rsa,
sign::{Signer, Verifier}, sign::{Signer, Verifier},
}; };
use serde_json;
use url::Url;
use webfinger::*;
use instance::*;
use medias::Media;
use plume_common::activity_pub::{ use plume_common::activity_pub::{
inbox::{AsActor, FromId}, inbox::{AsActor, FromId},
sign, ActivityStream, ApSignature, Id, IntoId, PublicKey, Source, sign, ActivityStream, ApSignature, Id, IntoId, PublicKey, Source,
}; };
use url::Url; use posts::Post;
use webfinger::*; use safe_string::SafeString;
use schema::blogs;
use search::Searcher;
use users::User;
use {ap_url, Connection, Error, PlumeRocket, Result, ITEMS_PER_PAGE};
pub type CustomGroup = CustomObject<ApSignature, Group>; pub type CustomGroup = CustomObject<ApSignature, Group>;
@@ -70,8 +76,7 @@ impl Blog {
insert!(blogs, NewBlog, |inserted, conn| { insert!(blogs, NewBlog, |inserted, conn| {
let instance = inserted.get_instance(conn)?; let instance = inserted.get_instance(conn)?;
if inserted.outbox_url.is_empty() { if inserted.outbox_url.is_empty() {
inserted.outbox_url = inserted.outbox_url = instance.compute_box(BLOG_PREFIX, &inserted.actor_id, "outbox");
instance.compute_box(BLOG_PREFIX, &inserted.actor_id, r#"outbox"#);
} }
if inserted.inbox_url.is_empty() { if inserted.inbox_url.is_empty() {
@@ -101,8 +106,8 @@ impl Blog {
} }
pub fn list_authors(&self, conn: &Connection) -> Result<Vec<User>> { pub fn list_authors(&self, conn: &Connection) -> Result<Vec<User>> {
use crate::schema::blog_authors; use schema::blog_authors;
use crate::schema::users; use schema::users;
let authors_ids = blog_authors::table let authors_ids = blog_authors::table
.filter(blog_authors::blog_id.eq(self.id)) .filter(blog_authors::blog_id.eq(self.id))
.select(blog_authors::author_id); .select(blog_authors::author_id);
@@ -113,7 +118,7 @@ impl Blog {
} }
pub fn count_authors(&self, conn: &Connection) -> Result<i64> { pub fn count_authors(&self, conn: &Connection) -> Result<i64> {
use crate::schema::blog_authors; use schema::blog_authors;
blog_authors::table blog_authors::table
.filter(blog_authors::blog_id.eq(self.id)) .filter(blog_authors::blog_id.eq(self.id))
.count() .count()
@@ -122,7 +127,7 @@ impl Blog {
} }
pub fn find_for_author(conn: &Connection, author: &User) -> Result<Vec<Blog>> { pub fn find_for_author(conn: &Connection, author: &User) -> Result<Vec<Blog>> {
use crate::schema::blog_authors; use schema::blog_authors;
let author_ids = blog_authors::table let author_ids = blog_authors::table
.filter(blog_authors::author_id.eq(author.id)) .filter(blog_authors::author_id.eq(author.id))
.select(blog_authors::blog_id); .select(blog_authors::blog_id);
@@ -132,7 +137,7 @@ impl Blog {
.map_err(Error::from) .map_err(Error::from)
} }
pub async fn find_by_fqn(c: &PlumeRocket, fqn: &str) -> Result<Blog> { pub fn find_by_fqn(c: &PlumeRocket, fqn: &str) -> Result<Blog> {
let from_db = blogs::table let from_db = blogs::table
.filter(blogs::fqn.eq(fqn)) .filter(blogs::fqn.eq(fqn))
.first(&*c.conn) .first(&*c.conn)
@@ -140,13 +145,12 @@ impl Blog {
if let Some(from_db) = from_db { if let Some(from_db) = from_db {
Ok(from_db) Ok(from_db)
} else { } else {
Blog::fetch_from_webfinger(c, fqn).await Blog::fetch_from_webfinger(c, fqn)
} }
} }
async fn fetch_from_webfinger(c: &PlumeRocket, acct: &str) -> Result<Blog> { fn fetch_from_webfinger(c: &PlumeRocket, acct: &str) -> Result<Blog> {
resolve_with_prefix(Prefix::Group, acct.to_owned(), true) resolve_with_prefix(Prefix::Group, acct.to_owned(), true)?
.await?
.links .links
.into_iter() .into_iter()
.find(|l| l.mime_type == Some(String::from("application/activity+json"))) .find(|l| l.mime_type == Some(String::from("application/activity+json")))
@@ -497,16 +501,14 @@ impl NewBlog {
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::{ use blog_authors::*;
blog_authors::*,
instance::tests as instance_tests,
medias::NewMedia,
search::tests::get_searcher,
tests::{db, rockets},
users::tests as usersTests,
Connection as Conn,
};
use diesel::Connection; use diesel::Connection;
use instance::tests as instance_tests;
use medias::NewMedia;
use search::tests::get_searcher;
use tests::{db, rockets};
use users::tests as usersTests;
use Connection as Conn;
pub(crate) fn fill_database(conn: &Conn) -> (Vec<User>, Vec<Blog>) { pub(crate) fn fill_database(conn: &Conn) -> (Vec<User>, Vec<Blog>) {
instance_tests::fill_database(conn); instance_tests::fill_database(conn);
+5 -1
View File
@@ -1,6 +1,10 @@
use crate::{comments::Comment, schema::comment_seers, users::User, Connection, Error, Result};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use comments::Comment;
use schema::comment_seers;
use users::User;
use {Connection, Error, Result};
#[derive(Queryable, Clone)] #[derive(Queryable, Clone)]
pub struct CommentSeers { pub struct CommentSeers {
pub id: i32, pub id: i32,
+29 -30
View File
@@ -1,15 +1,3 @@
use crate::{
comment_seers::{CommentSeers, NewCommentSeers},
instance::Instance,
medias::Media,
mentions::Mention,
notifications::*,
posts::Post,
safe_string::SafeString,
schema::comments,
users::User,
Connection, Error, PlumeRocket, Result,
};
use activitypub::{ use activitypub::{
activity::{Create, Delete}, activity::{Create, Delete},
link, link,
@@ -17,16 +5,26 @@ use activitypub::{
}; };
use chrono::{self, NaiveDateTime}; use chrono::{self, NaiveDateTime};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl};
use futures::stream::{self, StreamExt}; use serde_json;
use plume_common::{
activity_pub::{
inbox::{AsActor, AsObject, FromId},
Id, IntoId, PUBLIC_VISIBILITY,
},
utils,
};
use std::collections::HashSet; use std::collections::HashSet;
use comment_seers::{CommentSeers, NewCommentSeers};
use instance::Instance;
use medias::Media;
use mentions::Mention;
use notifications::*;
use plume_common::activity_pub::{
inbox::{AsActor, AsObject, FromId},
Id, IntoId, PUBLIC_VISIBILITY,
};
use plume_common::utils;
use posts::Post;
use safe_string::SafeString;
use schema::comments;
use users::User;
use {Connection, Error, PlumeRocket, Result};
#[derive(Queryable, Identifiable, Clone, AsChangeset)] #[derive(Queryable, Identifiable, Clone, AsChangeset)]
pub struct Comment { pub struct Comment {
pub id: i32, pub id: i32,
@@ -79,7 +77,7 @@ impl Comment {
} }
pub fn count_local(conn: &Connection) -> Result<i64> { pub fn count_local(conn: &Connection) -> Result<i64> {
use crate::schema::users; use schema::users;
let local_authors = users::table let local_authors = users::table
.filter(users::instance_id.eq(Instance::get_local()?.id)) .filter(users::instance_id.eq(Instance::get_local()?.id))
.select(users::id); .select(users::id);
@@ -105,7 +103,7 @@ impl Comment {
.unwrap_or(false) .unwrap_or(false)
} }
pub async fn to_activity(&self, c: &PlumeRocket) -> Result<Note> { pub fn to_activity(&self, c: &PlumeRocket) -> Result<Note> {
let author = User::get(&c.conn, self.author_id)?; let author = User::get(&c.conn, self.author_id)?;
let (html, mentions, _hashtags) = utils::md_to_html( let (html, mentions, _hashtags) = utils::md_to_html(
self.content.get().as_ref(), self.content.get().as_ref(),
@@ -129,21 +127,22 @@ impl Comment {
)?))?; )?))?;
note.object_props note.object_props
.set_published_string(chrono::Utc::now().to_rfc3339())?; .set_published_string(chrono::Utc::now().to_rfc3339())?;
note.object_props.set_attributed_to_link(author.into_id())?; note.object_props
note.object_props.set_to_link_vec(to)?; .set_attributed_to_link(author.clone().into_id())?;
note.object_props.set_to_link_vec(to.clone())?;
note.object_props.set_tag_link_vec( note.object_props.set_tag_link_vec(
stream::iter(mentions) mentions
.filter_map(|m| async move { Mention::build_activity(c, &m).await.ok() }) .into_iter()
.collect::<Vec<link::Mention>>() .filter_map(|m| Mention::build_activity(c, &m).ok())
.await, .collect::<Vec<link::Mention>>(),
)?; )?;
Ok(note) Ok(note)
} }
pub async fn create_activity(&self, c: &PlumeRocket) -> Result<Create> { pub fn create_activity(&self, c: &PlumeRocket) -> Result<Create> {
let author = User::get(&c.conn, self.author_id)?; let author = User::get(&c.conn, self.author_id)?;
let note = self.to_activity(c).await?; let note = self.to_activity(c)?;
let mut act = Create::default(); let mut act = Create::default();
act.create_props.set_actor_link(author.into_id())?; act.create_props.set_actor_link(author.into_id())?;
act.create_props.set_object_object(note.clone())?; act.create_props.set_object_object(note.clone())?;
-10
View File
@@ -11,8 +11,6 @@ pub struct Config {
pub base_url: String, pub base_url: String,
pub database_url: String, pub database_url: String,
pub db_name: &'static str, pub db_name: &'static str,
pub db_max_size: Option<u32>,
pub db_min_idle: Option<u32>,
pub search_index: String, pub search_index: String,
pub rocket: Result<RocketConfig, RocketError>, pub rocket: Result<RocketConfig, RocketError>,
pub logo: LogoConfig, pub logo: LogoConfig,
@@ -195,14 +193,6 @@ lazy_static! {
var("ROCKET_PORT").unwrap_or_else(|_| "7878".to_owned()) var("ROCKET_PORT").unwrap_or_else(|_| "7878".to_owned())
)), )),
db_name: DB_NAME, db_name: DB_NAME,
db_max_size: var("DB_MAX_SIZE").map_or(None, |s| Some(
s.parse::<u32>()
.expect("Couldn't parse DB_MAX_SIZE into u32")
)),
db_min_idle: var("DB_MIN_IDLE").map_or(None, |s| Some(
s.parse::<u32>()
.expect("Couldn't parse DB_MIN_IDLE into u32")
)),
#[cfg(feature = "postgres")] #[cfg(feature = "postgres")]
database_url: var("DATABASE_URL") database_url: var("DATABASE_URL")
.unwrap_or_else(|_| format!("postgres://plume:plume@localhost/{}", DB_NAME)), .unwrap_or_else(|_| format!("postgres://plume:plume@localhost/{}", DB_NAME)),
+8 -7
View File
@@ -1,4 +1,3 @@
use crate::Connection;
use diesel::r2d2::{ use diesel::r2d2::{
ConnectionManager, CustomizeConnection, Error as ConnError, Pool, PooledConnection, ConnectionManager, CustomizeConnection, Error as ConnError, Pool, PooledConnection,
}; };
@@ -7,10 +6,12 @@ use diesel::{dsl::sql_query, ConnectionError, RunQueryDsl};
use rocket::{ use rocket::{
http::Status, http::Status,
request::{self, FromRequest}, request::{self, FromRequest},
Outcome, Request, Outcome, Request, State,
}; };
use std::ops::Deref; use std::ops::Deref;
use Connection;
pub type DbPool = Pool<ConnectionManager<Connection>>; pub type DbPool = Pool<ConnectionManager<Connection>>;
// From rocket documentation // From rocket documentation
@@ -21,14 +22,14 @@ pub struct DbConn(pub PooledConnection<ConnectionManager<Connection>>);
/// Attempts to retrieve a single connection from the managed database pool. If /// Attempts to retrieve a single connection from the managed database pool. If
/// no pool is currently managed, fails with an `InternalServerError` status. If /// no pool is currently managed, fails with an `InternalServerError` status. If
/// no connections are available, fails with a `ServiceUnavailable` status. /// no connections are available, fails with a `ServiceUnavailable` status.
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for DbConn { impl<'a, 'r> FromRequest<'a, 'r> for DbConn {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> {
match DbConn::from_request(request).await { let pool = request.guard::<State<DbPool>>()?;
Outcome::Success(a) => Outcome::Success(a), match pool.get() {
_ => Outcome::Failure((Status::ServiceUnavailable, ())), Ok(conn) => Outcome::Success(DbConn(conn)),
Err(_) => Outcome::Failure((Status::ServiceUnavailable, ())),
} }
} }
} }
+9 -6
View File
@@ -1,15 +1,16 @@
use crate::{
ap_url, notifications::*, schema::follows, users::User, Connection, Error, PlumeRocket, Result,
CONFIG,
};
use activitypub::activity::{Accept, Follow as FollowAct, Undo}; use activitypub::activity::{Accept, Follow as FollowAct, Undo};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl};
use notifications::*;
use plume_common::activity_pub::{ use plume_common::activity_pub::{
broadcast, broadcast,
inbox::{AsActor, AsObject, FromId}, inbox::{AsActor, AsObject, FromId},
sign::Signer, sign::Signer,
Id, IntoId, PUBLIC_VISIBILITY, Id, IntoId, PUBLIC_VISIBILITY,
}; };
use schema::follows;
use users::User;
use {ap_url, Connection, Error, PlumeRocket, Result, CONFIG};
#[derive(Clone, Queryable, Identifiable, Associations, AsChangeset)] #[derive(Clone, Queryable, Identifiable, Associations, AsChangeset)]
#[belongs_to(User, foreign_key = "following_id")] #[belongs_to(User, foreign_key = "following_id")]
@@ -55,7 +56,8 @@ impl Follow {
let target = User::get(conn, self.following_id)?; let target = User::get(conn, self.following_id)?;
let mut act = FollowAct::default(); let mut act = FollowAct::default();
act.follow_props.set_actor_link::<Id>(user.into_id())?; act.follow_props
.set_actor_link::<Id>(user.clone().into_id())?;
act.follow_props act.follow_props
.set_object_link::<Id>(target.clone().into_id())?; .set_object_link::<Id>(target.clone().into_id())?;
act.object_props.set_id_string(self.ap_url.clone())?; act.object_props.set_id_string(self.ap_url.clone())?;
@@ -200,8 +202,9 @@ impl IntoId for Follow {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{tests::db, users::tests as user_tests};
use diesel::Connection; use diesel::Connection;
use tests::db;
use users::tests as user_tests;
#[test] #[test]
fn test_id() { fn test_id() {
+1 -2
View File
@@ -6,11 +6,10 @@ use rocket::{
pub struct Headers<'r>(pub HeaderMap<'r>); pub struct Headers<'r>(pub HeaderMap<'r>);
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for Headers<'r> { impl<'a, 'r> FromRequest<'a, 'r> for Headers<'r> {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, ()> { fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, ()> {
let mut headers = HeaderMap::new(); let mut headers = HeaderMap::new();
for header in request.headers().clone().into_iter() { for header in request.headers().clone().into_iter() {
headers.add(header); headers.add(header);
+1
View File
@@ -1,4 +1,5 @@
use activitypub::activity::*; use activitypub::activity::*;
use serde_json;
use crate::{ use crate::{
comments::Comment, comments::Comment,
+10 -10
View File
@@ -1,16 +1,15 @@
use crate::{
ap_url,
medias::Media,
safe_string::SafeString,
schema::{instances, users},
users::{Role, User},
Connection, Error, Result,
};
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use plume_common::utils::md_to_html;
use std::sync::RwLock; use std::sync::RwLock;
use ap_url;
use medias::Media;
use plume_common::utils::md_to_html;
use safe_string::SafeString;
use schema::{instances, users};
use users::{Role, User};
use {Connection, Error, Result};
#[derive(Clone, Identifiable, Queryable)] #[derive(Clone, Identifiable, Queryable)]
pub struct Instance { pub struct Instance {
pub id: i32, pub id: i32,
@@ -243,8 +242,9 @@ impl Instance {
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::{tests::db, Connection as Conn};
use diesel::Connection; use diesel::Connection;
use tests::db;
use Connection as Conn;
pub(crate) fn fill_database(conn: &Conn) -> Vec<(NewInstance, Instance)> { pub(crate) fn fill_database(conn: &Conn) -> Vec<(NewInstance, Instance)> {
let res = vec![ let res = vec![
+29 -13
View File
@@ -1,22 +1,42 @@
#![feature(try_trait)] #![feature(try_trait)]
#![feature(never_type)] #![feature(never_type)]
//#![feature(register_attr)]
//#![feature(register_tool)]
#![feature(proc_macro_hygiene)] #![feature(proc_macro_hygiene)]
extern crate activitypub;
extern crate ammonia;
extern crate askama_escape;
extern crate bcrypt;
extern crate chrono;
#[macro_use] #[macro_use]
extern crate diesel; extern crate diesel;
extern crate futures; extern crate guid_create;
extern crate heck;
extern crate itertools;
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
extern crate migrations_internals;
extern crate openssl;
extern crate plume_api;
extern crate plume_common;
#[macro_use] #[macro_use]
extern crate plume_macro; extern crate plume_macro;
#[macro_use] extern crate reqwest;
extern crate rocket; extern crate rocket;
extern crate rocket_i18n;
extern crate scheduled_thread_pool;
extern crate serde;
#[macro_use] #[macro_use]
extern crate serde_derive; extern crate serde_derive;
#[macro_use] #[macro_use]
extern crate serde_json; extern crate serde_json;
#[macro_use] #[macro_use]
extern crate tantivy; extern crate tantivy;
extern crate url;
extern crate walkdir;
extern crate webfinger;
extern crate whatlang;
use plume_common::activity_pub::inbox::InboxError; use plume_common::activity_pub::inbox::InboxError;
@@ -34,7 +54,6 @@ pub type Connection = diesel::PgConnection;
/// All the possible errors that can be encoutered in this crate /// All the possible errors that can be encoutered in this crate
#[derive(Debug)] #[derive(Debug)]
pub enum Error { pub enum Error {
Blocklisted(bool, String),
Db(diesel::result::Error), Db(diesel::result::Error),
Inbox(Box<InboxError<Error>>), Inbox(Box<InboxError<Error>>),
InvalidValue, InvalidValue,
@@ -76,12 +95,6 @@ impl From<std::option::NoneError> for Error {
} }
} }
impl From<Error> for std::option::NoneError {
fn from(_: Error) -> Self {
std::option::NoneError
}
}
impl From<url::ParseError> for Error { impl From<url::ParseError> for Error {
fn from(_: url::ParseError) -> Self { fn from(_: url::ParseError) -> Self {
Error::Url Error::Url
@@ -235,10 +248,10 @@ macro_rules! get {
/// Model::insert(connection, NewModelType::new()); /// Model::insert(connection, NewModelType::new());
/// ``` /// ```
macro_rules! insert { macro_rules! insert {
($table:ident, $from:ty) => { ($table:ident, $from:ident) => {
insert!($table, $from, |x, _conn| Ok(x)); insert!($table, $from, |x, _conn| Ok(x));
}; };
($table:ident, $from:ty, |$val:ident, $conn:ident | $( $after:tt )+) => { ($table:ident, $from:ident, |$val:ident, $conn:ident | $( $after:tt )+) => {
last!($table); last!($table);
#[allow(dead_code)] #[allow(dead_code)]
@@ -288,12 +301,16 @@ pub fn ap_url(url: &str) -> String {
#[cfg(test)] #[cfg(test)]
#[macro_use] #[macro_use]
mod tests { mod tests {
use crate::{db_conn, migrations::IMPORTED_MIGRATIONS, search, Connection as Conn, CONFIG}; use db_conn;
use diesel::r2d2::ConnectionManager; use diesel::r2d2::ConnectionManager;
use migrations::IMPORTED_MIGRATIONS;
use plume_common::utils::random_hex; use plume_common::utils::random_hex;
use scheduled_thread_pool::ScheduledThreadPool; use scheduled_thread_pool::ScheduledThreadPool;
use search;
use std::env::temp_dir; use std::env::temp_dir;
use std::sync::Arc; use std::sync::Arc;
use Connection as Conn;
use CONFIG;
#[macro_export] #[macro_export]
macro_rules! part_eq { macro_rules! part_eq {
@@ -337,7 +354,6 @@ mod tests {
pub mod admin; pub mod admin;
pub mod api_tokens; pub mod api_tokens;
pub mod apps; pub mod apps;
pub mod blocklisted_emails;
pub mod blog_authors; pub mod blog_authors;
pub mod blogs; pub mod blogs;
pub mod comment_seers; pub mod comment_seers;
+7 -4
View File
@@ -1,14 +1,17 @@
use crate::{
notifications::*, posts::Post, schema::likes, timeline::*, users::User, Connection, Error,
PlumeRocket, Result,
};
use activitypub::activity; use activitypub::activity;
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use notifications::*;
use plume_common::activity_pub::{ use plume_common::activity_pub::{
inbox::{AsActor, AsObject, FromId}, inbox::{AsActor, AsObject, FromId},
Id, IntoId, PUBLIC_VISIBILITY, Id, IntoId, PUBLIC_VISIBILITY,
}; };
use posts::Post;
use schema::likes;
use timeline::*;
use users::User;
use {Connection, Error, PlumeRocket, Result};
#[derive(Clone, Queryable, Identifiable)] #[derive(Clone, Queryable, Identifiable)]
pub struct Like { pub struct Like {
+30 -70
View File
@@ -1,14 +1,13 @@
use crate::{
blogs::Blog,
schema::{blogs, list_elems, lists, users},
users::User,
Connection, Error, Result,
};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use std::convert::{TryFrom, TryInto};
#[derive(Copy, Clone, Debug, PartialEq, Eq)] use blogs::Blog;
use schema::{blogs, list_elems, lists, users};
use std::convert::{TryFrom, TryInto};
use users::User;
use {Connection, Error, Result};
/// Represent what a list is supposed to store. Represented in database as an integer /// Represent what a list is supposed to store. Represented in database as an integer
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum ListType { pub enum ListType {
User, User,
Blog, Blog,
@@ -58,11 +57,7 @@ struct NewList<'a> {
} }
macro_rules! func { macro_rules! func {
( (@elem User $id:expr, $value:expr) => {
$(#[$outer:meta])*
@elem User $id:expr, $value:expr
) => {
$(#[$outer])*
NewListElem { NewListElem {
list_id: $id, list_id: $id,
user_id: Some(*$value), user_id: Some(*$value),
@@ -70,11 +65,7 @@ macro_rules! func {
word: None, word: None,
} }
}; };
( (@elem Blog $id:expr, $value:expr) => {
$(#[$outer:meta])*
@elem Blog $id:expr, $value:expr
) => {
$(#[$outer])*
NewListElem { NewListElem {
list_id: $id, list_id: $id,
user_id: None, user_id: None,
@@ -82,11 +73,7 @@ macro_rules! func {
word: None, word: None,
} }
}; };
( (@elem Word $id:expr, $value:expr) => {
$(#[$outer:meta])*
@elem Word $id:expr, $value:expr
) => {
$(#[$outer])*
NewListElem { NewListElem {
list_id: $id, list_id: $id,
user_id: None, user_id: None,
@@ -94,11 +81,7 @@ macro_rules! func {
word: Some($value), word: Some($value),
} }
}; };
( (@elem Prefix $id:expr, $value:expr) => {
$(#[$outer:meta])*
@elem Prefix $id:expr, $value:expr
) => {
$(#[$outer])*
NewListElem { NewListElem {
list_id: $id, list_id: $id,
user_id: None, user_id: None,
@@ -115,11 +98,7 @@ macro_rules! func {
(@out_type Word) => { String }; (@out_type Word) => { String };
(@out_type Prefix) => { String }; (@out_type Prefix) => { String };
( (add: $fn:ident, $kind:ident) => {
$(#[$outer:meta])*
add: $fn:ident, $kind:ident
) => {
$(#[$outer])*
pub fn $fn(&self, conn: &Connection, vals: &[func!(@in_type $kind)]) -> Result<()> { pub fn $fn(&self, conn: &Connection, vals: &[func!(@in_type $kind)]) -> Result<()> {
if self.kind() != ListType::$kind { if self.kind() != ListType::$kind {
return Err(Error::InvalidValue); return Err(Error::InvalidValue);
@@ -136,11 +115,7 @@ macro_rules! func {
} }
}; };
( (list: $fn:ident, $kind:ident, $table:ident) => {
$(#[$outer:meta])*
list: $fn:ident, $kind:ident, $table:ident
) => {
$(#[$outer])*
pub fn $fn(&self, conn: &Connection) -> Result<Vec<func!(@out_type $kind)>> { pub fn $fn(&self, conn: &Connection) -> Result<Vec<func!(@out_type $kind)>> {
if self.kind() != ListType::$kind { if self.kind() != ListType::$kind {
return Err(Error::InvalidValue); return Err(Error::InvalidValue);
@@ -156,11 +131,7 @@ macro_rules! func {
( (set: $fn:ident, $kind:ident, $add:ident) => {
$(#[$outer:meta])*
set: $fn:ident, $kind:ident, $add:ident
) => {
$(#[$outer])*
pub fn $fn(&self, conn: &Connection, val: &[func!(@in_type $kind)]) -> Result<()> { pub fn $fn(&self, conn: &Connection, val: &[func!(@in_type $kind)]) -> Result<()> {
if self.kind() != ListType::$kind { if self.kind() != ListType::$kind {
return Err(Error::InvalidValue); return Err(Error::InvalidValue);
@@ -193,7 +164,7 @@ impl List {
last!(lists); last!(lists);
get!(lists); get!(lists);
fn insert(conn: &Connection, val: NewList<'_>) -> Result<Self> { fn insert(conn: &Connection, val: NewList) -> Result<Self> {
diesel::insert_into(lists::table) diesel::insert_into(lists::table)
.values(val) .values(val)
.execute(conn)?; .execute(conn)?;
@@ -274,35 +245,23 @@ impl List {
private::ListElem::prefix_in_list(conn, self, word) private::ListElem::prefix_in_list(conn, self, word)
} }
func! { /// Insert new users in a list
/// Insert new users in a list func! {add: add_users, User}
add: add_users, User
}
func! { /// Insert new blogs in a list
/// Insert new blogs in a list func! {add: add_blogs, Blog}
add: add_blogs, Blog
}
func! { /// Insert new words in a list
/// Insert new words in a list func! {add: add_words, Word}
add: add_words, Word
}
func! { /// Insert new prefixes in a list
/// Insert new prefixes in a list func! {add: add_prefixes, Prefix}
add: add_prefixes, Prefix
}
func! { /// Get all users in the list
/// Get all users in the list func! {list: list_users, User, users}
list: list_users, User, users
}
func! { /// Get all blogs in the list
/// Get all blogs in the list func! {list: list_blogs, Blog, blogs}
list: list_blogs, Blog, blogs
}
/// Get all words in the list /// Get all words in the list
pub fn list_words(&self, conn: &Connection) -> Result<Vec<String>> { pub fn list_words(&self, conn: &Connection) -> Result<Vec<String>> {
@@ -350,7 +309,7 @@ mod private {
}; };
impl ListElem { impl ListElem {
insert!(list_elems, NewListElem<'_>); insert!(list_elems, NewListElem);
pub fn user_in_list(conn: &Connection, list: &List, user: i32) -> Result<bool> { pub fn user_in_list(conn: &Connection, list: &List, user: i32) -> Result<bool> {
dsl::select(dsl::exists( dsl::select(dsl::exists(
@@ -400,8 +359,9 @@ mod private {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{blogs::tests as blog_tests, tests::db}; use blogs::tests as blog_tests;
use diesel::Connection; use diesel::Connection;
use tests::db;
#[test] #[test]
fn list_type() { fn list_type() {
+18 -11
View File
@@ -1,17 +1,20 @@
use crate::{
ap_url, instance::Instance, safe_string::SafeString, schema::medias, users::User, Connection,
Error, PlumeRocket, Result,
};
use activitypub::object::Image; use activitypub::object::Image;
use askama_escape::escape; use askama_escape::escape;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use guid_create::GUID; use guid_create::GUID;
use reqwest;
use std::{fs, path::Path};
use plume_common::{ use plume_common::{
activity_pub::{inbox::FromId, Id}, activity_pub::{inbox::FromId, Id},
utils::MediaProcessor, utils::MediaProcessor,
}; };
use std::{fs, path::Path};
use tokio::prelude::*; use instance::Instance;
use safe_string::SafeString;
use schema::medias;
use users::User;
use {ap_url, Connection, Error, PlumeRocket, Result};
#[derive(Clone, Identifiable, Queryable)] #[derive(Clone, Identifiable, Queryable)]
pub struct Media { pub struct Media {
@@ -197,7 +200,7 @@ impl Media {
} }
// TODO: merge with save_remote? // TODO: merge with save_remote?
pub async fn from_activity(c: &PlumeRocket, image: &Image) -> Result<Media> { pub fn from_activity(c: &PlumeRocket, image: &Image) -> Result<Media> {
let conn = &*c.conn; let conn = &*c.conn;
let remote_url = image.object_props.url_string().ok()?; let remote_url = image.object_props.url_string().ok()?;
let ext = remote_url let ext = remote_url
@@ -211,9 +214,11 @@ impl Media {
ext ext
)); ));
let mut dest = tokio::fs::File::create(path.clone()).await?; let mut dest = fs::File::create(path.clone()).ok()?;
let contents = reqwest::get(remote_url.as_str()).await?.bytes().await?; reqwest::get(remote_url.as_str())
dest.write_all(&contents).await?; .ok()?
.copy_to(&mut dest)
.ok()?;
Media::insert( Media::insert(
conn, conn,
@@ -258,11 +263,13 @@ impl Media {
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::{tests::db, users::tests as usersTests, Connection as Conn};
use diesel::Connection; use diesel::Connection;
use std::env::{current_dir, set_current_dir}; use std::env::{current_dir, set_current_dir};
use std::fs; use std::fs;
use std::path::Path; use std::path::Path;
use tests::db;
use users::tests as usersTests;
use Connection as Conn;
pub(crate) fn fill_database(conn: &Conn) -> (Vec<User>, Vec<Media>) { pub(crate) fn fill_database(conn: &Conn) -> (Vec<User>, Vec<Media>) {
let mut wd = current_dir().unwrap().to_path_buf(); let mut wd = current_dir().unwrap().to_path_buf();
+10 -6
View File
@@ -1,10 +1,14 @@
use crate::{
comments::Comment, notifications::*, posts::Post, schema::mentions, users::User, Connection,
Error, PlumeRocket, Result,
};
use activitypub::link; use activitypub::link;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use comments::Comment;
use notifications::*;
use plume_common::activity_pub::inbox::AsActor; use plume_common::activity_pub::inbox::AsActor;
use posts::Post;
use schema::mentions;
use users::User;
use PlumeRocket;
use {Connection, Error, Result};
#[derive(Clone, Queryable, Identifiable)] #[derive(Clone, Queryable, Identifiable)]
pub struct Mention { pub struct Mention {
@@ -52,8 +56,8 @@ impl Mention {
} }
} }
pub async fn build_activity(c: &PlumeRocket, ment: &str) -> Result<link::Mention> { pub fn build_activity(c: &PlumeRocket, ment: &str) -> Result<link::Mention> {
let user = User::find_by_fqn(c, ment).await?; let user = User::find_by_fqn(c, ment)?;
let mut mention = link::Mention::default(); let mut mention = link::Mention::default();
mention.link_props.set_href_string(user.ap_url)?; mention.link_props.set_href_string(user.ap_url)?;
mention.link_props.set_name_string(format!("@{}", ment))?; mention.link_props.set_name_string(format!("@{}", ment))?;
+5 -1
View File
@@ -1,6 +1,10 @@
use crate::{Connection, Error, Result}; use Connection;
use Error;
use Result;
use diesel::connection::{Connection as Conn, SimpleConnection}; use diesel::connection::{Connection as Conn, SimpleConnection};
use migrations_internals::{setup_database, MigrationConnection}; use migrations_internals::{setup_database, MigrationConnection};
use std::path::Path; use std::path::Path;
#[allow(dead_code)] //variants might not be constructed if not required by current migrations #[allow(dead_code)] //variants might not be constructed if not required by current migrations
+10 -11
View File
@@ -1,17 +1,16 @@
use crate::{
comments::Comment,
follows::Follow,
likes::Like,
mentions::Mention,
posts::Post,
reshares::Reshare,
schema::{follows, notifications},
users::User,
Connection, Error, Result,
};
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, JoinOnDsl, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, JoinOnDsl, QueryDsl, RunQueryDsl};
use comments::Comment;
use follows::Follow;
use likes::Like;
use mentions::Mention;
use posts::Post;
use reshares::Reshare;
use schema::{follows, notifications};
use users::User;
use {Connection, Error, Result};
pub mod notification_kind { pub mod notification_kind {
pub const COMMENT: &str = "COMMENT"; pub const COMMENT: &str = "COMMENT";
pub const FOLLOW: &str = "FOLLOW"; pub const FOLLOW: &str = "FOLLOW";
+4 -2
View File
@@ -1,6 +1,7 @@
use crate::{schema::password_reset_requests, Connection, Error, Result};
use chrono::{offset::Utc, Duration, NaiveDateTime}; use chrono::{offset::Utc, Duration, NaiveDateTime};
use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl};
use schema::password_reset_requests;
use {Connection, Error, Result};
#[derive(Clone, Identifiable, Queryable)] #[derive(Clone, Identifiable, Queryable)]
pub struct PasswordResetRequest { pub struct PasswordResetRequest {
@@ -74,8 +75,9 @@ impl PasswordResetRequest {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{tests::db, users::tests as user_tests};
use diesel::Connection; use diesel::Connection;
use tests::db;
use users::tests as user_tests;
#[test] #[test]
fn test_insert_and_find_password_reset_request() { fn test_insert_and_find_password_reset_request() {
+20 -32
View File
@@ -2,7 +2,9 @@ pub use self::module::PlumeRocket;
#[cfg(not(test))] #[cfg(not(test))]
mod module { mod module {
use crate::{db_conn::DbConn, search, users}; use crate::db_conn::DbConn;
use crate::search;
use crate::users;
use rocket::{ use rocket::{
request::{self, FlashMessage, FromRequest, Request}, request::{self, FlashMessage, FromRequest, Request},
Outcome, State, Outcome, State,
@@ -20,35 +22,20 @@ mod module {
pub flash_msg: Option<(String, String)>, pub flash_msg: Option<(String, String)>,
} }
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for PlumeRocket { impl<'a, 'r> FromRequest<'a, 'r> for PlumeRocket {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<PlumeRocket, ()> {
let conn = DbConn::from_request(request).await.succeeded().unwrap(); let conn = request.guard::<DbConn>()?;
let intl = rocket_i18n::I18n::from_request(request) let intl = request.guard::<rocket_i18n::I18n>()?;
.await let user = request.guard::<users::User>().succeeded();
.succeeded() let worker = request.guard::<State<Arc<ScheduledThreadPool>>>()?;
.unwrap(); let searcher = request.guard::<State<Arc<search::Searcher>>>()?;
let user = users::User::from_request(request) let flash_msg = request.guard::<FlashMessage>().succeeded();
.await
.succeeded()
.unwrap();
let worker = request
.guard::<State<'_, Arc<ScheduledThreadPool>>>()
.await
.succeeded()
.unwrap();
let searcher = request
.guard::<State<'_, Arc<search::Searcher>>>()
.await
.succeeded()
.unwrap();
let flash_msg = request.guard::<FlashMessage<'_, '_>>().await.succeeded();
Outcome::Success(PlumeRocket { Outcome::Success(PlumeRocket {
conn, conn,
intl, intl,
user: Some(user), user,
flash_msg: flash_msg.map(|f| (f.name().into(), f.msg().into())), flash_msg: flash_msg.map(|f| (f.name().into(), f.msg().into())),
worker: worker.clone(), worker: worker.clone(),
searcher: searcher.clone(), searcher: searcher.clone(),
@@ -59,7 +46,9 @@ mod module {
#[cfg(test)] #[cfg(test)]
mod module { mod module {
use crate::{db_conn::DbConn, search, users}; use crate::db_conn::DbConn;
use crate::search;
use crate::users;
use rocket::{ use rocket::{
request::{self, FromRequest, Request}, request::{self, FromRequest, Request},
Outcome, State, Outcome, State,
@@ -75,18 +64,17 @@ mod module {
pub worker: Arc<ScheduledThreadPool>, pub worker: Arc<ScheduledThreadPool>,
} }
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for PlumeRocket { impl<'a, 'r> FromRequest<'a, 'r> for PlumeRocket {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<PlumeRocket, ()> {
let conn = try_outcome!(DbConn::from_request(request).await); let conn = request.guard::<DbConn>()?;
let user = try_outcome!(users::User::from_request(request).await); let user = request.guard::<users::User>().succeeded();
let worker = try_outcome!(request.guard::<'_, State<'_, Arc<ScheduledThreadPool>>>()); let worker = request.guard::<State<Arc<ScheduledThreadPool>>>()?;
let searcher = try_outcome!(request.guard::<'_, State<'_, Arc<search::Searcher>>>()); let searcher = request.guard::<State<Arc<search::Searcher>>>()?;
Outcome::Success(PlumeRocket { Outcome::Success(PlumeRocket {
conn, conn,
user: Some(user), user,
worker: worker.clone(), worker: worker.clone(),
searcher: searcher.clone(), searcher: searcher.clone(),
}) })
+5 -1
View File
@@ -1,6 +1,10 @@
use crate::{posts::Post, schema::post_authors, users::User, Error, Result};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use posts::Post;
use schema::post_authors;
use users::User;
use {Error, Result};
#[derive(Clone, Queryable, Identifiable, Associations)] #[derive(Clone, Queryable, Identifiable, Associations)]
#[belongs_to(Post)] #[belongs_to(Post)]
#[belongs_to(User, foreign_key = "author_id")] #[belongs_to(User, foreign_key = "author_id")]
+41 -38
View File
@@ -1,8 +1,3 @@
use crate::{
ap_url, blogs::Blog, instance::Instance, medias::Media, mentions::Mention, post_authors::*,
safe_string::SafeString, schema::posts, search::Searcher, tags::*, timeline::*, users::User,
Connection, Error, PlumeRocket, Result, CONFIG,
};
use activitypub::{ use activitypub::{
activity::{Create, Delete, Update}, activity::{Create, Delete, Update},
link, link,
@@ -12,6 +7,13 @@ use activitypub::{
use chrono::{NaiveDateTime, TimeZone, Utc}; use chrono::{NaiveDateTime, TimeZone, Utc};
use diesel::{self, BelongingToDsl, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; use diesel::{self, BelongingToDsl, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl};
use heck::{CamelCase, KebabCase}; use heck::{CamelCase, KebabCase};
use serde_json;
use std::collections::HashSet;
use blogs::Blog;
use instance::Instance;
use medias::Media;
use mentions::Mention;
use plume_common::{ use plume_common::{
activity_pub::{ activity_pub::{
inbox::{AsObject, FromId}, inbox::{AsObject, FromId},
@@ -19,8 +21,14 @@ use plume_common::{
}, },
utils::md_to_html, utils::md_to_html,
}; };
use std::collections::HashSet; use post_authors::*;
use tokio::runtime::Runtime; use safe_string::SafeString;
use schema::posts;
use search::Searcher;
use tags::*;
use timeline::*;
use users::User;
use {ap_url, Connection, Error, PlumeRocket, Result, CONFIG};
pub type LicensedArticle = CustomObject<Licensed, Article>; pub type LicensedArticle = CustomObject<Licensed, Article>;
@@ -103,7 +111,7 @@ impl Post {
tag: String, tag: String,
(min, max): (i32, i32), (min, max): (i32, i32),
) -> Result<Vec<Post>> { ) -> Result<Vec<Post>> {
use crate::schema::tags; use schema::tags;
let ids = tags::table.filter(tags::tag.eq(tag)).select(tags::post_id); let ids = tags::table.filter(tags::tag.eq(tag)).select(tags::post_id);
posts::table posts::table
@@ -117,7 +125,7 @@ impl Post {
} }
pub fn count_for_tag(conn: &Connection, tag: String) -> Result<i64> { pub fn count_for_tag(conn: &Connection, tag: String) -> Result<i64> {
use crate::schema::tags; use schema::tags;
let ids = tags::table.filter(tags::tag.eq(tag)).select(tags::post_id); let ids = tags::table.filter(tags::tag.eq(tag)).select(tags::post_id);
posts::table posts::table
.filter(posts::id.eq_any(ids)) .filter(posts::id.eq_any(ids))
@@ -131,8 +139,8 @@ impl Post {
} }
pub fn count_local(conn: &Connection) -> Result<i64> { pub fn count_local(conn: &Connection) -> Result<i64> {
use crate::schema::post_authors; use schema::post_authors;
use crate::schema::users; use schema::users;
let local_authors = users::table let local_authors = users::table
.filter(users::instance_id.eq(Instance::get_local()?.id)) .filter(users::instance_id.eq(Instance::get_local()?.id))
.select(users::id); .select(users::id);
@@ -180,7 +188,7 @@ impl Post {
author: &User, author: &User,
limit: i64, limit: i64,
) -> Result<Vec<Post>> { ) -> Result<Vec<Post>> {
use crate::schema::post_authors; use schema::post_authors;
let posts = PostAuthor::belonging_to(author).select(post_authors::post_id); let posts = PostAuthor::belonging_to(author).select(post_authors::post_id);
posts::table posts::table
@@ -231,7 +239,7 @@ impl Post {
} }
pub fn drafts_by_author(conn: &Connection, author: &User) -> Result<Vec<Post>> { pub fn drafts_by_author(conn: &Connection, author: &User) -> Result<Vec<Post>> {
use crate::schema::post_authors; use schema::post_authors;
let posts = PostAuthor::belonging_to(author).select(post_authors::post_id); let posts = PostAuthor::belonging_to(author).select(post_authors::post_id);
posts::table posts::table
@@ -243,8 +251,8 @@ impl Post {
} }
pub fn get_authors(&self, conn: &Connection) -> Result<Vec<User>> { pub fn get_authors(&self, conn: &Connection) -> Result<Vec<User>> {
use crate::schema::post_authors; use schema::post_authors;
use crate::schema::users; use schema::users;
let author_list = PostAuthor::belonging_to(self).select(post_authors::author_id); let author_list = PostAuthor::belonging_to(self).select(post_authors::author_id);
users::table users::table
.filter(users::id.eq_any(author_list)) .filter(users::id.eq_any(author_list))
@@ -253,7 +261,7 @@ impl Post {
} }
pub fn is_author(&self, conn: &Connection, author_id: i32) -> Result<bool> { pub fn is_author(&self, conn: &Connection, author_id: i32) -> Result<bool> {
use crate::schema::post_authors; use schema::post_authors;
Ok(PostAuthor::belonging_to(self) Ok(PostAuthor::belonging_to(self)
.filter(post_authors::author_id.eq(author_id)) .filter(post_authors::author_id.eq(author_id))
.count() .count()
@@ -262,7 +270,7 @@ impl Post {
} }
pub fn get_blog(&self, conn: &Connection) -> Result<Blog> { pub fn get_blog(&self, conn: &Connection) -> Result<Blog> {
use crate::schema::blogs; use schema::blogs;
blogs::table blogs::table
.filter(blogs::id.eq(self.blog_id)) .filter(blogs::id.eq(self.blog_id))
.first(conn) .first(conn)
@@ -270,7 +278,7 @@ impl Post {
} }
pub fn count_likes(&self, conn: &Connection) -> Result<i64> { pub fn count_likes(&self, conn: &Connection) -> Result<i64> {
use crate::schema::likes; use schema::likes;
likes::table likes::table
.filter(likes::post_id.eq(self.id)) .filter(likes::post_id.eq(self.id))
.count() .count()
@@ -279,7 +287,7 @@ impl Post {
} }
pub fn count_reshares(&self, conn: &Connection) -> Result<i64> { pub fn count_reshares(&self, conn: &Connection) -> Result<i64> {
use crate::schema::reshares; use schema::reshares;
reshares::table reshares::table
.filter(reshares::post_id.eq(self.id)) .filter(reshares::post_id.eq(self.id))
.count() .count()
@@ -579,11 +587,11 @@ impl FromId<PlumeRocket> for Post {
} }
}); });
let image = article.object_props.icon_object::<Image>().ok().unwrap(); let cover = article
.object_props
let mut r = Runtime::new().unwrap(); .icon_object::<Image>()
let cover = .ok()
Some(r.block_on(async { Media::from_activity(&c, &image).await.ok().unwrap().id })); .and_then(|img| Media::from_activity(&c, &img).ok().map(|m| m.id));
let title = article.object_props.name_string()?; let title = article.object_props.name_string()?;
let post = Post::insert( let post = Post::insert(
@@ -624,7 +632,7 @@ impl FromId<PlumeRocket> for Post {
.into_iter() .into_iter()
.map(|s| s.to_camel_case()) .map(|s| s.to_camel_case())
.collect::<HashSet<_>>(); .collect::<HashSet<_>>();
if let Some(serde_json::Value::Array(tags)) = article.object_props.tag { if let Some(serde_json::Value::Array(tags)) = article.object_props.tag.clone() {
for tag in tags { for tag in tags {
serde_json::from_value::<link::Mention>(tag.clone()) serde_json::from_value::<link::Mention>(tag.clone())
.map(|m| Mention::from_activity(conn, &m, post.id, true, true)) .map(|m| Mention::from_activity(conn, &m, post.id, true, true))
@@ -699,22 +707,17 @@ impl FromId<PlumeRocket> for PostUpdate {
} }
fn from_activity(c: &PlumeRocket, updated: LicensedArticle) -> Result<Self> { fn from_activity(c: &PlumeRocket, updated: LicensedArticle) -> Result<Self> {
let image = updated
.object
.object_props
.icon_object::<Image>()
.ok()
.unwrap();
let mut r = Runtime::new().unwrap();
let cover =
Some(r.block_on(async { Media::from_activity(&c, &image).await.ok().unwrap().id }));
Ok(PostUpdate { Ok(PostUpdate {
ap_url: updated.object.object_props.id_string()?, ap_url: updated.object.object_props.id_string()?,
title: updated.object.object_props.name_string().ok(), title: updated.object.object_props.name_string().ok(),
subtitle: updated.object.object_props.summary_string().ok(), subtitle: updated.object.object_props.summary_string().ok(),
content: updated.object.object_props.content_string().ok(), content: updated.object.object_props.content_string().ok(),
cover, cover: updated
.object
.object_props
.icon_object::<Image>()
.ok()
.and_then(|img| Media::from_activity(&c, &img).ok().map(|m| m.id)),
source: updated source: updated
.object .object
.ap_object_props .ap_object_props
@@ -722,7 +725,7 @@ impl FromId<PlumeRocket> for PostUpdate {
.ok() .ok()
.map(|x| x.content), .map(|x| x.content),
license: updated.custom_props.license_string().ok(), license: updated.custom_props.license_string().ok(),
tags: updated.object.object_props.tag, tags: updated.object.object_props.tag.clone(),
}) })
} }
} }
@@ -803,7 +806,7 @@ impl AsObject<User, Update, &PlumeRocket> for PostUpdate {
impl IntoId for Post { impl IntoId for Post {
fn into_id(self) -> Id { fn into_id(self) -> Id {
Id::new(self.ap_url) Id::new(self.ap_url.clone())
} }
} }
+7 -4
View File
@@ -1,14 +1,17 @@
use crate::{
notifications::*, posts::Post, schema::reshares, timeline::*, users::User, Connection, Error,
PlumeRocket, Result,
};
use activitypub::activity::{Announce, Undo}; use activitypub::activity::{Announce, Undo};
use chrono::NaiveDateTime; use chrono::NaiveDateTime;
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use notifications::*;
use plume_common::activity_pub::{ use plume_common::activity_pub::{
inbox::{AsActor, AsObject, FromId}, inbox::{AsActor, AsObject, FromId},
Id, IntoId, PUBLIC_VISIBILITY, Id, IntoId, PUBLIC_VISIBILITY,
}; };
use posts::Post;
use schema::reshares;
use timeline::*;
use users::User;
use {Connection, Error, PlumeRocket, Result};
#[derive(Clone, Queryable, Identifiable)] #[derive(Clone, Queryable, Identifiable)]
pub struct Reshare { pub struct Reshare {
+5 -36
View File
@@ -31,41 +31,10 @@ lazy_static! {
.add_tag_attributes("label", ["for"].iter()) .add_tag_attributes("label", ["for"].iter())
.add_tag_attributes("input", ["type", "checked"].iter()) .add_tag_attributes("input", ["type", "checked"].iter())
.add_allowed_classes("input", ["cw-checkbox"].iter()) .add_allowed_classes("input", ["cw-checkbox"].iter())
.add_allowed_classes(
"span",
[
"cw-container",
"cw-text",
//Scope classes for the syntax highlighting.
"attribute-name",
"comment",
"constant",
"control",
"declaration",
"entity",
"function",
"invalid",
"keyword",
"language",
"modifier",
"name",
"numeric",
"operator",
"parameter",
"punctuation",
"source",
"storage",
"string",
"support",
"tag",
"type",
"variable",
]
.iter(),
)
// Related to https://github.com/Plume-org/Plume/issues/637 // Related to https://github.com/Plume-org/Plume/issues/637
.add_allowed_classes("sup", ["footnote-reference", "footnote-definition-label"].iter()) .add_allowed_classes("sup", ["footnote-reference", "footnote-definition-label"].iter())
.add_allowed_classes("div", ["footnote-definition"].iter()) .add_allowed_classes("div", ["footnote-definition"].iter())
.add_allowed_classes("span", ["cw-container", "cw-text"].iter())
.attribute_filter(|elem, att, val| match (elem, att) { .attribute_filter(|elem, att, val| match (elem, att) {
("input", "type") => Some("checkbox".into()), ("input", "type") => Some("checkbox".into()),
("input", "checked") => Some("checked".into()), ("input", "checked") => Some("checked".into()),
@@ -82,7 +51,7 @@ lazy_static! {
}; };
} }
fn url_add_prefix(url: &str) -> Option<Cow<'_, str>> { fn url_add_prefix(url: &str) -> Option<Cow<str>> {
if url.starts_with('#') && !url.starts_with("#postcontent-") { if url.starts_with('#') && !url.starts_with("#postcontent-") {
//if start with an # //if start with an #
let mut new_url = "#postcontent-".to_owned(); //change to valid id let mut new_url = "#postcontent-".to_owned(); //change to valid id
@@ -139,7 +108,7 @@ struct SafeStringVisitor;
impl<'de> Visitor<'de> for SafeStringVisitor { impl<'de> Visitor<'de> for SafeStringVisitor {
type Value = SafeString; type Value = SafeString;
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("a string") formatter.write_str("a string")
} }
@@ -181,7 +150,7 @@ where
DB: diesel::backend::Backend, DB: diesel::backend::Backend,
str: ToSql<diesel::sql_types::Text, DB>, str: ToSql<diesel::sql_types::Text, DB>,
{ {
fn to_sql<W: Write>(&self, out: &mut Output<'_, W, DB>) -> serialize::Result { fn to_sql<W: Write>(&self, out: &mut Output<W, DB>) -> serialize::Result {
str::to_sql(&self.value, out) str::to_sql(&self.value, out)
} }
} }
@@ -193,7 +162,7 @@ impl Borrow<str> for SafeString {
} }
impl Display for SafeString { impl Display for SafeString {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.value) write!(f, "{}", self.value)
} }
} }
-9
View File
@@ -73,15 +73,6 @@ table! {
user_id -> Int4, user_id -> Int4,
} }
} }
table! {
email_blocklist(id){
id -> Int4,
email_address -> VarChar,
note -> Text,
notify_user -> Bool,
notification_text -> Text,
}
}
table! { table! {
follows (id) { follows (id) {
+6 -8
View File
@@ -8,17 +8,15 @@ pub use self::searcher::*;
pub(crate) mod tests { pub(crate) mod tests {
use super::{Query, Searcher}; use super::{Query, Searcher};
use diesel::Connection; use diesel::Connection;
use plume_common::utils::random_hex;
use std::env::temp_dir; use std::env::temp_dir;
use std::str::FromStr; use std::str::FromStr;
use crate::{ use blogs::tests::fill_database;
blogs::tests::fill_database, use plume_common::utils::random_hex;
post_authors::*, use post_authors::*;
posts::{NewPost, Post}, use posts::{NewPost, Post};
safe_string::SafeString, use safe_string::SafeString;
tests::db, use tests::db;
};
pub(crate) fn get_searcher() -> Searcher { pub(crate) fn get_searcher() -> Searcher {
let dir = temp_dir().join(&format!("plume-test-{}", random_hex())); let dir = temp_dir().join(&format!("plume-test-{}", random_hex()));
+1 -1
View File
@@ -1,5 +1,5 @@
use crate::search::searcher::Searcher;
use chrono::{naive::NaiveDate, offset::Utc, Datelike}; use chrono::{naive::NaiveDate, offset::Utc, Datelike};
use search::searcher::Searcher;
use std::{cmp, ops::Bound}; use std::{cmp, ops::Bound};
use tantivy::{query::*, schema::*, Term}; use tantivy::{query::*, schema::*, Term};
+11 -9
View File
@@ -1,11 +1,9 @@
use crate::{ use instance::Instance;
instance::Instance, use posts::Post;
posts::Post, use schema::posts;
schema::posts, use tags::Tag;
search::{query::PlumeQuery, tokenizer}, use Connection;
tags::Tag,
Connection, Result,
};
use chrono::Datelike; use chrono::Datelike;
use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl};
use itertools::Itertools; use itertools::Itertools;
@@ -16,6 +14,10 @@ use tantivy::{
}; };
use whatlang::{detect as detect_lang, Lang}; use whatlang::{detect as detect_lang, Lang};
use super::tokenizer;
use search::query::PlumeQuery;
use Result;
#[derive(Debug)] #[derive(Debug)]
pub enum SearcherError { pub enum SearcherError {
IndexCreationError, IndexCreationError,
@@ -173,7 +175,7 @@ impl Searcher {
post_id => i64::from(post.id), post_id => i64::from(post.id),
author => post.get_authors(conn)?.into_iter().map(|u| u.fqn).join(" "), author => post.get_authors(conn)?.into_iter().map(|u| u.fqn).join(" "),
creation_date => i64::from(post.creation_date.num_days_from_ce()), creation_date => i64::from(post.creation_date.num_days_from_ce()),
instance => Instance::get(conn, post.get_blog(conn)?.instance_id)?.public_domain, instance => Instance::get(conn, post.get_blog(conn)?.instance_id)?.public_domain.clone(),
tag => Tag::for_post(conn, post.id)?.into_iter().map(|t| t.tag).join(" "), tag => Tag::for_post(conn, post.id)?.into_iter().map(|t| t.tag).join(" "),
blog_name => post.get_blog(conn)?.title, blog_name => post.get_blog(conn)?.title,
content => post.content.get().clone(), content => post.content.get().clone(),
+4 -1
View File
@@ -1,6 +1,9 @@
use crate::{ap_url, instance::Instance, schema::tags, Connection, Error, Result};
use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl};
use instance::Instance;
use plume_common::activity_pub::Hashtag; use plume_common::activity_pub::Hashtag;
use schema::tags;
use {ap_url, Connection, Error, Result};
#[derive(Clone, Identifiable, Queryable)] #[derive(Clone, Identifiable, Queryable)]
pub struct Tag { pub struct Tag {
+20 -22
View File
@@ -1,17 +1,17 @@
use crate::{
lists::List,
posts::Post,
schema::{posts, timeline, timeline_definition},
Connection, Error, PlumeRocket, Result,
};
use diesel::{self, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl}; use diesel::{self, BoolExpressionMethods, ExpressionMethods, QueryDsl, RunQueryDsl};
use lists::List;
use posts::Post;
use schema::{posts, timeline, timeline_definition};
use std::ops::Deref; use std::ops::Deref;
use {Connection, Error, PlumeRocket, Result};
pub(crate) mod query; pub(crate) mod query;
pub use self::query::Kind;
use self::query::{QueryError, TimelineQuery}; use self::query::{QueryError, TimelineQuery};
pub use self::query::Kind;
#[derive(Clone, Debug, PartialEq, Queryable, Identifiable, AsChangeset)] #[derive(Clone, Debug, PartialEq, Queryable, Identifiable, AsChangeset)]
#[table_name = "timeline_definition"] #[table_name = "timeline_definition"]
pub struct Timeline { pub struct Timeline {
@@ -119,7 +119,7 @@ impl Timeline {
} }
}) })
{ {
return Err(err); Err(err)?;
} }
} }
Self::insert( Self::insert(
@@ -157,7 +157,7 @@ impl Timeline {
} }
}) })
{ {
return Err(err); Err(err)?;
} }
} }
Self::insert( Self::insert(
@@ -208,7 +208,7 @@ impl Timeline {
.map_err(Error::from) .map_err(Error::from)
} }
pub fn add_to_all_timelines(rocket: &PlumeRocket, post: &Post, kind: Kind<'_>) -> Result<()> { pub fn add_to_all_timelines(rocket: &PlumeRocket, post: &Post, kind: Kind) -> Result<()> {
let timelines = timeline_definition::table let timelines = timeline_definition::table
.load::<Self>(rocket.conn.deref()) .load::<Self>(rocket.conn.deref())
.map_err(Error::from)?; .map_err(Error::from)?;
@@ -231,7 +231,7 @@ impl Timeline {
Ok(()) Ok(())
} }
pub fn matches(&self, rocket: &PlumeRocket, post: &Post, kind: Kind<'_>) -> Result<bool> { pub fn matches(&self, rocket: &PlumeRocket, post: &Post, kind: Kind) -> Result<bool> {
let query = TimelineQuery::parse(&self.query)?; let query = TimelineQuery::parse(&self.query)?;
query.matches(rocket, self, post, kind) query.matches(rocket, self, post, kind)
} }
@@ -240,18 +240,16 @@ impl Timeline {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use crate::{ use blogs::tests as blogTests;
blogs::tests as blogTests,
follows::*,
lists::ListType,
post_authors::{NewPostAuthor, PostAuthor},
posts::NewPost,
safe_string::SafeString,
tags::Tag,
tests::{db, rockets},
users::tests as userTests,
};
use diesel::Connection; use diesel::Connection;
use follows::*;
use lists::ListType;
use post_authors::{NewPostAuthor, PostAuthor};
use posts::NewPost;
use safe_string::SafeString;
use tags::Tag;
use tests::{db, rockets};
use users::tests as userTests;
#[test] #[test]
fn test_timeline() { fn test_timeline() {
+28 -49
View File
@@ -1,17 +1,15 @@
use crate::{ use blogs::Blog;
blogs::Blog, use lists::{self, ListType};
lists::{self, ListType},
posts::Post,
tags::Tag,
timeline::Timeline,
users::User,
PlumeRocket, Result,
};
use futures::stream::{self, StreamExt};
use plume_common::activity_pub::inbox::AsActor; use plume_common::activity_pub::inbox::AsActor;
use tokio::runtime::Runtime; use posts::Post;
use tags::Tag;
use users::User;
use whatlang::{self, Lang}; use whatlang::{self, Lang};
use {PlumeRocket, Result};
use super::Timeline;
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub enum QueryError { pub enum QueryError {
SyntaxError(usize, usize, String), SyntaxError(usize, usize, String),
@@ -67,7 +65,7 @@ impl<'a> Token<'a> {
} }
} }
fn get_error<T>(&self, token: Token<'_>) -> QueryResult<T> { fn get_error<T>(&self, token: Token) -> QueryResult<T> {
let (b, e) = self.get_pos(); let (b, e) = self.get_pos();
let message = format!( let message = format!(
"Syntax Error: Expected {}, got {}", "Syntax Error: Expected {}, got {}",
@@ -81,7 +79,7 @@ impl<'a> Token<'a> {
impl<'a> ToString for Token<'a> { impl<'a> ToString for Token<'a> {
fn to_string(&self) -> String { fn to_string(&self) -> String {
if let Token::Word(0, 0, v) = self { if let Token::Word(0, 0, v) = self {
return (*v).to_string(); return v.to_string();
} }
format!( format!(
"'{}'", "'{}'",
@@ -129,7 +127,7 @@ macro_rules! gen_tokenizer {
} }
} }
fn lex(stream: &str) -> Vec<Token<'_>> { fn lex(stream: &str) -> Vec<Token> {
stream stream
.chars() .chars()
.chain(" ".chars()) // force a last whitespace to empty scan's state .chain(" ".chars()) // force a last whitespace to empty scan's state
@@ -165,7 +163,7 @@ impl<'a> TQ<'a> {
rocket: &PlumeRocket, rocket: &PlumeRocket,
timeline: &Timeline, timeline: &Timeline,
post: &Post, post: &Post,
kind: Kind<'_>, kind: Kind,
) -> Result<bool> { ) -> Result<bool> {
match self { match self {
TQ::Or(inner) => inner.iter().try_fold(false, |s, e| { TQ::Or(inner) => inner.iter().try_fold(false, |s, e| {
@@ -183,7 +181,7 @@ impl<'a> TQ<'a> {
TQ::Or(inner) => inner.iter().flat_map(TQ::list_used_lists).collect(), TQ::Or(inner) => inner.iter().flat_map(TQ::list_used_lists).collect(),
TQ::And(inner) => inner.iter().flat_map(TQ::list_used_lists).collect(), TQ::And(inner) => inner.iter().flat_map(TQ::list_used_lists).collect(),
TQ::Arg(Arg::In(typ, List::List(name)), _) => vec![( TQ::Arg(Arg::In(typ, List::List(name)), _) => vec![(
(*name).to_string(), name.to_string(),
match typ { match typ {
WithList::Blog => ListType::Blog, WithList::Blog => ListType::Blog,
WithList::Author { .. } => ListType::User, WithList::Author { .. } => ListType::User,
@@ -210,7 +208,7 @@ impl<'a> Arg<'a> {
rocket: &PlumeRocket, rocket: &PlumeRocket,
timeline: &Timeline, timeline: &Timeline,
post: &Post, post: &Post,
kind: Kind<'_>, kind: Kind,
) -> Result<bool> { ) -> Result<bool> {
match self { match self {
Arg::In(t, l) => t.matches(rocket, timeline, post, l, kind), Arg::In(t, l) => t.matches(rocket, timeline, post, l, kind),
@@ -235,8 +233,8 @@ impl WithList {
rocket: &PlumeRocket, rocket: &PlumeRocket,
timeline: &Timeline, timeline: &Timeline,
post: &Post, post: &Post,
list: &List<'_>, list: &List,
kind: Kind<'_>, kind: Kind,
) -> Result<bool> { ) -> Result<bool> {
match list { match list {
List::List(name) => { List::List(name) => {
@@ -292,38 +290,19 @@ impl WithList {
(_, _) => Err(QueryError::RuntimeError(format!( (_, _) => Err(QueryError::RuntimeError(format!(
"The list '{}' is of the wrong type for this usage", "The list '{}' is of the wrong type for this usage",
name name
)) )))?,
.into()),
} }
} }
List::Array(list) => match self { List::Array(list) => match self {
WithList::Blog => { WithList::Blog => Ok(list
let mut rt = Runtime::new().unwrap(); .iter()
rt.block_on(async move { .filter_map(|b| Blog::find_by_fqn(rocket, b).ok())
Ok(stream::iter(list) .any(|b| b.id == post.blog_id)),
.filter_map(|b| async move {
Some(Blog::find_by_fqn(rocket, b).await.ok().unwrap())
})
.collect::<Vec<_>>()
.await
.into_iter()
.any(|b| b.id == post.blog_id))
})
}
WithList::Author { boosts, likes } => match kind { WithList::Author { boosts, likes } => match kind {
Kind::Original => { Kind::Original => Ok(list
let mut rt = Runtime::new().unwrap(); .iter()
rt.block_on(async move { .filter_map(|a| User::find_by_fqn(rocket, a).ok())
Ok(stream::iter(list) .any(|a| post.is_author(&rocket.conn, a.id).unwrap_or(false))),
.filter_map(|a| async move {
Some(User::find_by_fqn(rocket, a).await.ok().unwrap())
})
.collect::<Vec<_>>()
.await
.into_iter()
.any(|a| post.is_author(&rocket.conn, a.id).unwrap_or(false)))
})
}
Kind::Reshare(u) => { Kind::Reshare(u) => {
if *boosts { if *boosts {
Ok(list.iter().any(|user| &u.fqn == user)) Ok(list.iter().any(|user| &u.fqn == user))
@@ -394,7 +373,7 @@ impl Bool {
rocket: &PlumeRocket, rocket: &PlumeRocket,
timeline: &Timeline, timeline: &Timeline,
post: &Post, post: &Post,
kind: Kind<'_>, kind: Kind,
) -> Result<bool> { ) -> Result<bool> {
match self { match self {
Bool::Followed { boosts, likes } => { Bool::Followed { boosts, likes } => {
@@ -665,7 +644,7 @@ impl<'a> TimelineQuery<'a> {
rocket: &PlumeRocket, rocket: &PlumeRocket,
timeline: &Timeline, timeline: &Timeline,
post: &Post, post: &Post,
kind: Kind<'_>, kind: Kind,
) -> Result<bool> { ) -> Result<bool> {
self.0.matches(rocket, timeline, post, kind) self.0.matches(rocket, timeline, post, kind)
} }
+112 -119
View File
@@ -1,9 +1,3 @@
use crate::{
ap_url, blocklisted_emails::BlocklistedEmail, blogs::Blog, db_conn::DbConn, follows::Follow,
instance::*, medias::Media, notifications::Notification, post_authors::PostAuthor, posts::Post,
safe_string::SafeString, schema::users, search::Searcher, timeline::Timeline, Connection,
Error, PlumeRocket, Result, ITEMS_PER_PAGE,
};
use activitypub::{ use activitypub::{
activity::Delete, activity::Delete,
actor::Person, actor::Person,
@@ -11,6 +5,7 @@ use activitypub::{
object::{Image, Tombstone}, object::{Image, Tombstone},
Activity, CustomObject, Endpoint, Activity, CustomObject, Endpoint,
}; };
use bcrypt;
use chrono::{NaiveDateTime, Utc}; use chrono::{NaiveDateTime, Utc};
use diesel::{self, BelongingToDsl, ExpressionMethods, OptionalExtension, QueryDsl, RunQueryDsl}; use diesel::{self, BelongingToDsl, ExpressionMethods, OptionalExtension, QueryDsl, RunQueryDsl};
use openssl::{ use openssl::{
@@ -19,15 +14,13 @@ use openssl::{
rsa::Rsa, rsa::Rsa,
sign, sign,
}; };
use plume_common::{ use plume_common::activity_pub::{
activity_pub::{ ap_accept_header,
ap_accept_header, inbox::{AsActor, AsObject, FromId},
inbox::{AsActor, AsObject, FromId}, sign::{gen_keypair, Signer},
sign::{gen_keypair, Signer}, ActivityStream, ApSignature, Id, IntoId, PublicKey, PUBLIC_VISIBILITY,
ActivityStream, ApSignature, Id, IntoId, PublicKey, PUBLIC_VISIBILITY,
},
utils,
}; };
use plume_common::utils;
use reqwest::{ use reqwest::{
header::{HeaderValue, ACCEPT}, header::{HeaderValue, ACCEPT},
ClientBuilder, ClientBuilder,
@@ -36,6 +29,7 @@ use rocket::{
outcome::IntoOutcome, outcome::IntoOutcome,
request::{self, FromRequest, Request}, request::{self, FromRequest, Request},
}; };
use serde_json;
use std::{ use std::{
cmp::PartialEq, cmp::PartialEq,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
@@ -43,6 +37,20 @@ use std::{
use url::Url; use url::Url;
use webfinger::*; use webfinger::*;
use blogs::Blog;
use db_conn::DbConn;
use follows::Follow;
use instance::*;
use medias::Media;
use notifications::Notification;
use post_authors::PostAuthor;
use posts::Post;
use safe_string::SafeString;
use schema::users;
use search::Searcher;
use timeline::Timeline;
use {ap_url, Connection, Error, PlumeRocket, Result, ITEMS_PER_PAGE};
pub type CustomPerson = CustomObject<ApSignature, Person>; pub type CustomPerson = CustomObject<ApSignature, Person>;
pub enum Role { pub enum Role {
@@ -52,7 +60,6 @@ pub enum Role {
} }
#[derive(Queryable, Identifiable, Clone, Debug, AsChangeset)] #[derive(Queryable, Identifiable, Clone, Debug, AsChangeset)]
#[changeset_options(treat_none_as_null = "true")]
pub struct User { pub struct User {
pub id: i32, pub id: i32,
pub username: String, pub username: String,
@@ -129,7 +136,7 @@ impl User {
} }
pub fn delete(&self, conn: &Connection, searcher: &Searcher) -> Result<()> { pub fn delete(&self, conn: &Connection, searcher: &Searcher) -> Result<()> {
use crate::schema::post_authors; use schema::post_authors;
for blog in Blog::find_for_author(conn, self)? for blog in Blog::find_for_author(conn, self)?
.iter() .iter()
@@ -189,7 +196,7 @@ impl User {
.map_err(Error::from) .map_err(Error::from)
} }
pub async fn find_by_fqn(c: &PlumeRocket, fqn: &str) -> Result<User> { pub fn find_by_fqn(c: &PlumeRocket, fqn: &str) -> Result<User> {
let from_db = users::table let from_db = users::table
.filter(users::fqn.eq(fqn)) .filter(users::fqn.eq(fqn))
.first(&*c.conn) .first(&*c.conn)
@@ -197,13 +204,12 @@ impl User {
if let Some(from_db) = from_db { if let Some(from_db) = from_db {
Ok(from_db) Ok(from_db)
} else { } else {
User::fetch_from_webfinger(c, fqn).await User::fetch_from_webfinger(c, fqn)
} }
} }
async fn fetch_from_webfinger(c: &PlumeRocket, acct: &str) -> Result<User> { fn fetch_from_webfinger(c: &PlumeRocket, acct: &str) -> Result<User> {
let link = resolve(acct.to_owned(), true) let link = resolve(acct.to_owned(), true)?
.await?
.links .links
.into_iter() .into_iter()
.find(|l| l.mime_type == Some(String::from("application/activity+json"))) .find(|l| l.mime_type == Some(String::from("application/activity+json")))
@@ -211,9 +217,8 @@ impl User {
User::from_id(c, link.href.as_ref()?, None).map_err(|(_, e)| e) User::from_id(c, link.href.as_ref()?, None).map_err(|(_, e)| e)
} }
pub async fn fetch_remote_interact_uri(acct: &str) -> Result<String> { pub fn fetch_remote_interact_uri(acct: &str) -> Result<String> {
resolve(acct.to_owned(), true) resolve(acct.to_owned(), true)?
.await?
.links .links
.into_iter() .into_iter()
.find(|l| l.rel == "http://ostatus.org/schema/1.0/subscribe") .find(|l| l.rel == "http://ostatus.org/schema/1.0/subscribe")
@@ -221,9 +226,9 @@ impl User {
.ok_or(Error::Webfinger) .ok_or(Error::Webfinger)
} }
async fn fetch(url: &str) -> Result<CustomPerson> { fn fetch(url: &str) -> Result<CustomPerson> {
let res = ClientBuilder::new() let mut res = ClientBuilder::new()
.connect_timeout(std::time::Duration::from_secs(5)) .connect_timeout(Some(std::time::Duration::from_secs(5)))
.build()? .build()?
.get(url) .get(url)
.header( .header(
@@ -235,9 +240,8 @@ impl User {
.join(", "), .join(", "),
)?, )?,
) )
.send() .send()?;
.await?; let text = &res.text()?;
let text = &res.text().await?;
// without this workaround, publicKey is not correctly deserialized // without this workaround, publicKey is not correctly deserialized
let ap_sign = serde_json::from_str::<ApSignature>(text)?; let ap_sign = serde_json::from_str::<ApSignature>(text)?;
let mut json = serde_json::from_str::<CustomPerson>(text)?; let mut json = serde_json::from_str::<CustomPerson>(text)?;
@@ -245,48 +249,48 @@ impl User {
Ok(json) Ok(json)
} }
pub async fn fetch_from_url(c: &PlumeRocket, url: &str) -> Result<User> { pub fn fetch_from_url(c: &PlumeRocket, url: &str) -> Result<User> {
let json = User::fetch(url).await?; User::fetch(url).and_then(|json| User::from_activity(c, json))
User::from_activity(c, json)
} }
pub async fn refetch(&self, conn: &Connection) -> Result<()> { pub fn refetch(&self, conn: &Connection) -> Result<()> {
let json = User::fetch(&self.ap_url.clone()).await?; User::fetch(&self.ap_url.clone()).and_then(|json| {
let avatar = Media::save_remote( let avatar = Media::save_remote(
conn, conn,
json.object json.object
.object_props .object_props
.icon_image()? .icon_image()?
.object_props .object_props
.url_string()?, .url_string()?,
&self, &self,
) )
.ok(); .ok();
diesel::update(self) diesel::update(self)
.set(( .set((
users::username.eq(json.object.ap_actor_props.preferred_username_string()?), users::username.eq(json.object.ap_actor_props.preferred_username_string()?),
users::display_name.eq(json.object.object_props.name_string()?), users::display_name.eq(json.object.object_props.name_string()?),
users::outbox_url.eq(json.object.ap_actor_props.outbox_string()?), users::outbox_url.eq(json.object.ap_actor_props.outbox_string()?),
users::inbox_url.eq(json.object.ap_actor_props.inbox_string()?), users::inbox_url.eq(json.object.ap_actor_props.inbox_string()?),
users::summary.eq(SafeString::new( users::summary.eq(SafeString::new(
&json &json
.object .object
.object_props .object_props
.summary_string() .summary_string()
.unwrap_or_default(), .unwrap_or_default(),
)), )),
users::followers_endpoint.eq(json.object.ap_actor_props.followers_string()?), users::followers_endpoint.eq(json.object.ap_actor_props.followers_string()?),
users::avatar_id.eq(avatar.map(|a| a.id)), users::avatar_id.eq(avatar.map(|a| a.id)),
users::last_fetched_date.eq(Utc::now().naive_utc()), users::last_fetched_date.eq(Utc::now().naive_utc()),
users::public_key.eq(json users::public_key.eq(json
.custom_props .custom_props
.public_key_publickey()? .public_key_publickey()?
.public_key_pem_string()?), .public_key_pem_string()?),
)) ))
.execute(conn) .execute(conn)
.map(|_| ()) .map(|_| ())
.map_err(Error::from) .map_err(Error::from)
})
} }
pub fn hash_pass(pass: &str) -> Result<String> { pub fn hash_pass(pass: &str) -> Result<String> {
@@ -357,10 +361,9 @@ impl User {
.set_part_of_link(Id::new(&self.outbox_url))?; .set_part_of_link(Id::new(&self.outbox_url))?;
Ok(ActivityStream::new(coll)) Ok(ActivityStream::new(coll))
} }
fn fetch_outbox_page<T: Activity>(&self, url: &str) -> Result<(Vec<T>, Option<String>)> {
async fn fetch_outbox_page<T: Activity>(&self, url: &str) -> Result<(Vec<T>, Option<String>)> { let mut res = ClientBuilder::new()
let res = ClientBuilder::new() .connect_timeout(Some(std::time::Duration::from_secs(5)))
.connect_timeout(std::time::Duration::from_secs(5))
.build()? .build()?
.get(url) .get(url)
.header( .header(
@@ -372,9 +375,8 @@ impl User {
.join(", "), .join(", "),
)?, )?,
) )
.send() .send()?;
.await?; let text = &res.text()?;
let text = &res.text().await?;
let json: serde_json::Value = serde_json::from_str(text)?; let json: serde_json::Value = serde_json::from_str(text)?;
let items = json["items"] let items = json["items"]
.as_array() .as_array()
@@ -389,9 +391,9 @@ impl User {
}; };
Ok((items, next)) Ok((items, next))
} }
pub async fn fetch_outbox<T: Activity>(&self) -> Result<Vec<T>> { pub fn fetch_outbox<T: Activity>(&self) -> Result<Vec<T>> {
let res = ClientBuilder::new() let mut res = ClientBuilder::new()
.connect_timeout(std::time::Duration::from_secs(5)) .connect_timeout(Some(std::time::Duration::from_secs(5)))
.build()? .build()?
.get(&self.outbox_url[..]) .get(&self.outbox_url[..])
.header( .header(
@@ -403,14 +405,13 @@ impl User {
.join(", "), .join(", "),
)?, )?,
) )
.send() .send()?;
.await?; let text = &res.text()?;
let text = &res.text().await?;
let json: serde_json::Value = serde_json::from_str(text)?; let json: serde_json::Value = serde_json::from_str(text)?;
if let Some(first) = json.get("first") { if let Some(first) = json.get("first") {
let mut items: Vec<T> = Vec::new(); let mut items: Vec<T> = Vec::new();
let mut next = first.as_str().unwrap().to_owned(); let mut next = first.as_str().unwrap().to_owned();
while let Ok((mut page, nxt)) = self.fetch_outbox_page(&next).await { while let Ok((mut page, nxt)) = self.fetch_outbox_page(&next) {
if page.is_empty() { if page.is_empty() {
break; break;
} }
@@ -435,9 +436,9 @@ impl User {
} }
} }
pub async fn fetch_followers_ids(&self) -> Result<Vec<String>> { pub fn fetch_followers_ids(&self) -> Result<Vec<String>> {
let res = ClientBuilder::new() let mut res = ClientBuilder::new()
.connect_timeout(std::time::Duration::from_secs(5)) .connect_timeout(Some(std::time::Duration::from_secs(5)))
.build()? .build()?
.get(&self.followers_endpoint[..]) .get(&self.followers_endpoint[..])
.header( .header(
@@ -449,9 +450,8 @@ impl User {
.join(", "), .join(", "),
)?, )?,
) )
.send() .send()?;
.await?; let text = &res.text()?;
let text = &res.text().await?;
let json: serde_json::Value = serde_json::from_str(text)?; let json: serde_json::Value = serde_json::from_str(text)?;
Ok(json["items"] Ok(json["items"]
.as_array() .as_array()
@@ -461,8 +461,8 @@ impl User {
.collect::<Vec<String>>()) .collect::<Vec<String>>())
} }
fn get_activities_count(&self, conn: &Connection) -> i64 { fn get_activities_count(&self, conn: &Connection) -> i64 {
use crate::schema::post_authors; use schema::post_authors;
use crate::schema::posts; use schema::posts;
let posts_by_self = PostAuthor::belonging_to(self).select(post_authors::post_id); let posts_by_self = PostAuthor::belonging_to(self).select(post_authors::post_id);
posts::table posts::table
.filter(posts::published.eq(true)) .filter(posts::published.eq(true))
@@ -476,8 +476,8 @@ impl User {
conn: &Connection, conn: &Connection,
(min, max): (i32, i32), (min, max): (i32, i32),
) -> Result<Vec<serde_json::Value>> { ) -> Result<Vec<serde_json::Value>> {
use crate::schema::post_authors; use schema::post_authors;
use crate::schema::posts; use schema::posts;
let posts_by_self = PostAuthor::belonging_to(self).select(post_authors::post_id); let posts_by_self = PostAuthor::belonging_to(self).select(post_authors::post_id);
let posts = posts::table let posts = posts::table
.filter(posts::published.eq(true)) .filter(posts::published.eq(true))
@@ -497,7 +497,7 @@ impl User {
} }
pub fn get_followers(&self, conn: &Connection) -> Result<Vec<User>> { pub fn get_followers(&self, conn: &Connection) -> Result<Vec<User>> {
use crate::schema::follows; use schema::follows;
let follows = Follow::belonging_to(self).select(follows::follower_id); let follows = Follow::belonging_to(self).select(follows::follower_id);
users::table users::table
.filter(users::id.eq_any(follows)) .filter(users::id.eq_any(follows))
@@ -506,7 +506,7 @@ impl User {
} }
pub fn count_followers(&self, conn: &Connection) -> Result<i64> { pub fn count_followers(&self, conn: &Connection) -> Result<i64> {
use crate::schema::follows; use schema::follows;
let follows = Follow::belonging_to(self).select(follows::follower_id); let follows = Follow::belonging_to(self).select(follows::follower_id);
users::table users::table
.filter(users::id.eq_any(follows)) .filter(users::id.eq_any(follows))
@@ -520,7 +520,7 @@ impl User {
conn: &Connection, conn: &Connection,
(min, max): (i32, i32), (min, max): (i32, i32),
) -> Result<Vec<User>> { ) -> Result<Vec<User>> {
use crate::schema::follows; use schema::follows;
let follows = Follow::belonging_to(self).select(follows::follower_id); let follows = Follow::belonging_to(self).select(follows::follower_id);
users::table users::table
.filter(users::id.eq_any(follows)) .filter(users::id.eq_any(follows))
@@ -531,7 +531,7 @@ impl User {
} }
pub fn get_followed(&self, conn: &Connection) -> Result<Vec<User>> { pub fn get_followed(&self, conn: &Connection) -> Result<Vec<User>> {
use crate::schema::follows::dsl::*; use schema::follows::dsl::*;
let f = follows.filter(follower_id.eq(self.id)).select(following_id); let f = follows.filter(follower_id.eq(self.id)).select(following_id);
users::table users::table
.filter(users::id.eq_any(f)) .filter(users::id.eq_any(f))
@@ -540,7 +540,7 @@ impl User {
} }
pub fn count_followed(&self, conn: &Connection) -> Result<i64> { pub fn count_followed(&self, conn: &Connection) -> Result<i64> {
use crate::schema::follows; use schema::follows;
follows::table follows::table
.filter(follows::follower_id.eq(self.id)) .filter(follows::follower_id.eq(self.id))
.count() .count()
@@ -553,7 +553,7 @@ impl User {
conn: &Connection, conn: &Connection,
(min, max): (i32, i32), (min, max): (i32, i32),
) -> Result<Vec<User>> { ) -> Result<Vec<User>> {
use crate::schema::follows; use schema::follows;
let follows = follows::table let follows = follows::table
.filter(follows::follower_id.eq(self.id)) .filter(follows::follower_id.eq(self.id))
.select(follows::following_id) .select(follows::following_id)
@@ -566,7 +566,7 @@ impl User {
} }
pub fn is_followed_by(&self, conn: &Connection, other_id: i32) -> Result<bool> { pub fn is_followed_by(&self, conn: &Connection, other_id: i32) -> Result<bool> {
use crate::schema::follows; use schema::follows;
follows::table follows::table
.filter(follows::follower_id.eq(other_id)) .filter(follows::follower_id.eq(other_id))
.filter(follows::following_id.eq(self.id)) .filter(follows::following_id.eq(self.id))
@@ -577,7 +577,7 @@ impl User {
} }
pub fn is_following(&self, conn: &Connection, other_id: i32) -> Result<bool> { pub fn is_following(&self, conn: &Connection, other_id: i32) -> Result<bool> {
use crate::schema::follows; use schema::follows;
follows::table follows::table
.filter(follows::follower_id.eq(self.id)) .filter(follows::follower_id.eq(self.id))
.filter(follows::following_id.eq(other_id)) .filter(follows::following_id.eq(other_id))
@@ -588,7 +588,7 @@ impl User {
} }
pub fn has_liked(&self, conn: &Connection, post: &Post) -> Result<bool> { pub fn has_liked(&self, conn: &Connection, post: &Post) -> Result<bool> {
use crate::schema::likes; use schema::likes;
likes::table likes::table
.filter(likes::post_id.eq(post.id)) .filter(likes::post_id.eq(post.id))
.filter(likes::user_id.eq(self.id)) .filter(likes::user_id.eq(self.id))
@@ -599,7 +599,7 @@ impl User {
} }
pub fn has_reshared(&self, conn: &Connection, post: &Post) -> Result<bool> { pub fn has_reshared(&self, conn: &Connection, post: &Post) -> Result<bool> {
use crate::schema::reshares; use schema::reshares;
reshares::table reshares::table
.filter(reshares::post_id.eq(post.id)) .filter(reshares::post_id.eq(post.id))
.filter(reshares::user_id.eq(self.id)) .filter(reshares::user_id.eq(self.id))
@@ -610,7 +610,7 @@ impl User {
} }
pub fn is_author_in(&self, conn: &Connection, blog: &Blog) -> Result<bool> { pub fn is_author_in(&self, conn: &Connection, blog: &Blog) -> Result<bool> {
use crate::schema::blog_authors; use schema::blog_authors;
blog_authors::table blog_authors::table
.filter(blog_authors::author_id.eq(self.id)) .filter(blog_authors::author_id.eq(self.id))
.filter(blog_authors::blog_id.eq(blog.id)) .filter(blog_authors::blog_id.eq(blog.id))
@@ -765,7 +765,7 @@ impl User {
mime_type: None, mime_type: None,
href: None, href: None,
template: Some(format!( template: Some(format!(
"https://{}/remote_interact?target={{uri}}", "https://{}/remote_interact?{{uri}}",
self.get_instance(conn)?.public_domain self.get_instance(conn)?.public_domain
)), )),
}, },
@@ -794,12 +794,11 @@ impl User {
} }
} }
#[rocket::async_trait]
impl<'a, 'r> FromRequest<'a, 'r> for User { impl<'a, 'r> FromRequest<'a, 'r> for User {
type Error = (); type Error = ();
async fn from_request(request: &'a Request<'r>) -> request::Outcome<Self, Self::Error> { fn from_request(request: &'a Request<'r>) -> request::Outcome<User, ()> {
let conn = try_outcome!(DbConn::from_request(request).await); let conn = request.guard::<DbConn>()?;
request request
.cookies() .cookies()
.get_private(AUTH_COOKIE) .get_private(AUTH_COOKIE)
@@ -811,7 +810,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for User {
impl IntoId for User { impl IntoId for User {
fn into_id(self) -> Id { fn into_id(self) -> Id {
Id::new(self.ap_url) Id::new(self.ap_url.clone())
} }
} }
@@ -993,10 +992,6 @@ impl NewUser {
) -> Result<User> { ) -> Result<User> {
let (pub_key, priv_key) = gen_keypair(); let (pub_key, priv_key) = gen_keypair();
let instance = Instance::get_local()?; let instance = Instance::get_local()?;
let blocklisted = BlocklistedEmail::matches_blocklist(conn, &email)?;
if let Some(x) = blocklisted {
return Err(Error::Blocklisted(x.notify_user, x.notification_text));
}
let res = User::insert( let res = User::insert(
conn, conn,
@@ -1031,13 +1026,11 @@ impl NewUser {
#[cfg(test)] #[cfg(test)]
pub(crate) mod tests { pub(crate) mod tests {
use super::*; use super::*;
use crate::{
instance::{tests as instance_tests, Instance},
search::tests::get_searcher,
tests::{db, rockets},
Connection as Conn,
};
use diesel::Connection; use diesel::Connection;
use instance::{tests as instance_tests, Instance};
use search::tests::get_searcher;
use tests::{db, rockets};
use Connection as Conn;
pub(crate) fn fill_database(conn: &Conn) -> Vec<User> { pub(crate) fn fill_database(conn: &Conn) -> Vec<User> {
instance_tests::fill_database(conn); instance_tests::fill_database(conn);
+4
View File
@@ -1,3 +1,7 @@
extern crate diesel;
extern crate plume_common;
extern crate plume_models;
use diesel::Connection; use diesel::Connection;
use plume_common::utils::random_hex; use plume_common::utils::random_hex;
use plume_models::migrations::IMPORTED_MIGRATIONS; use plume_models::migrations::IMPORTED_MIGRATIONS;
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 19:54\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Afrikaans\n" "Language-Team: Afrikaans\n"
"Language: af_ZA\n" "Language: af_ZA\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: af\n" "X-Crowdin-Language: af\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+20 -18
View File
@@ -3,55 +3,57 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 19:54\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Arabic\n" "Language-Team: Arabic\n"
"Language: ar_SA\n" "Language: ar_SA\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n" "Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ar\n" "X-Crowdin-Language: ar\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "فتح محرر النصوص الغني" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "العنوان" msgstr "العنوان"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "العنوان الثانوي أو الملخص" msgstr "العنوان الثانوي أو الملخص"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "اكتب مقالك هنا. ماركداون مُدَعَّم." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "يتبقا {} حرفا تقريبا" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "الوسوم" msgstr "الوسوم"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "الرخصة" msgstr "الرخصة"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "الغلاف" msgstr "الغلاف"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "هذه مسودة" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "نشر كتابا" msgstr "نشر كتابا"
+22 -22
View File
@@ -3,55 +3,55 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Bulgarian\n" "Language-Team: Bulgarian\n"
"Language: bg_BG\n" "Language: bg_BG\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: bg\n" "X-Crowdin-Language: bg\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Отворете редактора с богат текст" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Заглавие" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:149
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Подзаглавие или резюме" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Напишете статията си тук. Поддържа се Markdown." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Остават {} знака вляво" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Етикети" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Лиценз" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Основно изображение" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Това е проект" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Публикувай" msgstr ""
+22 -22
View File
@@ -3,55 +3,55 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Catalan\n" "Language-Team: Catalan\n"
"Language: ca_ES\n" "Language: ca_ES\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ca\n" "X-Crowdin-Language: ca\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Obre leditor de text enriquit" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Títol" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:149
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Subtítol o resum" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Escriviu el vostre article ací. Podeu fer servir el Markdown." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Queden uns {} caràcters" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Llicència" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Coberta" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Açò és un esborrany" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publica" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Czech\n" "Language-Team: Czech\n"
"Language: cs_CZ\n" "Language: cs_CZ\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: cs\n" "X-Crowdin-Language: cs\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Otevřít editor formátovaného textu" msgstr "Otevřít editor formátovaného textu"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Nadpis" msgstr "Nadpis"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Podnadpis, nebo shrnutí" msgstr "Podnadpis, nebo shrnutí"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Sem napište svůj článek. Markdown je podporován." msgstr "Napište sem svůj článek. Markdown je podporován."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Zbývá kolem {} znaků" msgstr "Zbývá kolem {} znaků"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Tagy" msgstr "Tagy"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licence" msgstr "Licence"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Titulka" msgstr "Titulka"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Tohle je koncept" msgstr "Tohle je koncept"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Zveřejnit" msgstr "Zveřejnit"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Danish\n" "Language-Team: Danish\n"
"Language: da_DK\n" "Language: da_DK\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: da\n" "X-Crowdin-Language: da\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+18 -17
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: German\n" "Language-Team: German\n"
"Language: de_DE\n" "Language: de_DE\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: de\n" "X-Crowdin-Language: de\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr " Rich Text Editor (RTE) öffnen" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Untertitel oder Zusammenfassung" msgstr "Untertitel oder Übersicht"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Schreiben deinen Artikel hier. Markdown wird unterstützt." msgstr "Schreibe deinen Artikel hier. Markdown ist unterstützt."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Ungefähr {} Zeichen übrig" msgstr "Ungefähr {} Zeichen übrig"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Schlagwörter" msgstr "Tags"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Lizenz" msgstr "Lizenz"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Einband" msgstr "Einband"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Dies ist ein Entwurf" msgstr "Dies ist ein Entwurf"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Veröffentlichen" msgstr "Veröffentlichen"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Greek\n" "Language-Team: Greek\n"
"Language: el_GR\n" "Language: el_GR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: el\n" "X-Crowdin-Language: el\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+12 -12
View File
@@ -3,23 +3,24 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: English\n" "Language-Team: English\n"
"Language: en_US\n" "Language: en_US\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: en\n" "X-Crowdin-Language: en\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
@@ -27,31 +28,30 @@ msgstr ""
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Esperanto\n" "Language-Team: Esperanto\n"
"Language: eo_UY\n" "Language: eo_UY\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: eo\n" "X-Crowdin-Language: eo\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Malfermi la riĉan redaktilon" msgstr "Malfermi la riĉan redaktilon"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titolo" msgstr "Titolo"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "Subtitolo aŭ resumo"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Verku vian artikolon ĉi tie. Markdown estas subtenita." msgstr "Verku vian artikolon ĉi tie. Markdown estas subtenita."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Proksimume {} signoj restantaj" msgstr "Proksimume {} signoj restantaj"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etikedoj" msgstr "Etikedoj"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Permesilo" msgstr "Permesilo"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Kovro" msgstr "Kovro"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Malfinias" msgstr "Malfinias"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Eldoni" msgstr "Eldoni"
+16 -15
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
"Language: es_ES\n" "Language: es_ES\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: es-ES\n" "X-Crowdin-Language: es-ES\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Abrir el editor de texto enriquecido" msgstr "Abrir el editor de texto enriquecido"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Título" msgstr "Título"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "Subtítulo o resumen"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Escriba su artículo aquí. Puede utilizar Markdown." msgstr "Escriba su artículo aquí. Puede utilizar Markdown."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Quedan unos {} caracteres" msgstr "Quedan unos {} caracteres"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etiquetas" msgstr "Etiquetas"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licencia" msgstr "Licencia"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Cubierta" msgstr "Cobertura"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Esto es un borrador" msgstr "Esto es un borrador"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publicar" msgstr "Publicar"
+23 -22
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Persian\n" "Language-Team: Persian\n"
"Language: fa_IR\n" "Language: fa_IR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: fa\n" "X-Crowdin-Language: fa\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "باز کردن ویرایش‌گر غنی" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "عنوان" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "زیرعنوان، یا چکیده" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "مقاله را اینجا بنویسید. از مارک‌داون پشتیبانی می‌شود." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "نزدیک به {} نویسه باقی مانده است" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "برچسب‌ها" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "پروانه" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "این، یک پیش‌نویس است" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "انتشار" msgstr ""
+24 -23
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Finnish\n" "Language-Team: Finnish\n"
"Language: fi_FI\n" "Language: fi_FI\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: fi\n" "X-Crowdin-Language: fi\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Avaa edistynyt tekstieditori" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Otsikko" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "Alaotsikko tai tiivistelmä" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Kirjoita artikkelisi tähän. Markdown -kuvauskieli on tuettu." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "%{count} merkkiä jäljellä" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Tagit" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Lisenssi" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Kansi" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Tämä on luonnos" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Julkaise" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: French\n" "Language-Team: French\n"
"Language: fr_FR\n" "Language: fr_FR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: fr\n" "X-Crowdin-Language: fr\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Ouvrir l'éditeur de texte avancé" msgstr "Ouvrir l'éditeur de texte avancé"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titre" msgstr "Titre"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Sous-titre ou résumé" msgstr "Sous-titre ou résumé"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Écrivez votre article ici. Vous pouvez utiliser du Markdown." msgstr "Écrivez votre article ici. Vous pouvez utiliser du Markdown."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Environ {} caractères restant" msgstr "Environ {} caractères restant"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Étiquettes" msgstr "Étiquettes"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licence" msgstr "Licence"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Illustration" msgstr "Illustration"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Ceci est un brouillon" msgstr "Ceci est un brouillon"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publier" msgstr "Publier"
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Galician\n" "Language-Team: Galician\n"
"Language: gl_ES\n" "Language: gl_ES\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: gl\n" "X-Crowdin-Language: gl\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Abra o editor de texto enriquecido" msgstr "Abra o editor de texto enriquecido"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Título" msgstr "Título"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Subtítulo, ou resumo" msgstr "Subtítulo ou resumo"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Escriba aquí o seu artigo: pode utilizar Markdown." msgstr "Escriba aquí o seu artigo: pode utilizar Markdown."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Dispón de {} caracteres restantes" msgstr "Dispón de {} caracteres restantes"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etiquetas" msgstr "Etiquetas"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenza" msgstr "Licenza"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Portada" msgstr "Portada"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Este é un borrador" msgstr "Este é un borrador"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publicar" msgstr "Publicar"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Hebrew\n" "Language-Team: Hebrew\n"
"Language: he_IL\n" "Language: he_IL\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n" "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: he\n" "X-Crowdin-Language: he\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:14\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Hindi\n" "Language-Team: Hindi\n"
"Language: hi_IN\n" "Language: hi_IN\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: hi\n" "X-Crowdin-Language: hi\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "शीर्षक" msgstr "शीर्षक"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "उपशीर्षक या सारांश"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "अपना आर्टिकल या लेख यहाँ लिखें. Markdown उपलब्ध है." msgstr "अपना आर्टिकल या लेख यहाँ लिखें. Markdown उपलब्ध है."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "लगभग {} अक्षर बाकी हैं" msgstr "लगभग {} अक्षर बाकी हैं"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "टैग्स" msgstr "टैग्स"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "लाइसेंस" msgstr "लाइसेंस"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "पब्लिश करें" msgstr "पब्लिश करें"
+17 -15
View File
@@ -3,55 +3,57 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Croatian\n" "Language-Team: Croatian\n"
"Language: hr_HR\n" "Language: hr_HR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: hr\n" "X-Crowdin-Language: hr\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Naslov" msgstr "Naslov"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "Podnaslov ili sažetak"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Tagovi" msgstr "Tagovi"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenca" msgstr "Licenca"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Objavi" msgstr "Objavi"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Hungarian\n" "Language-Team: Hungarian\n"
"Language: hu_HU\n" "Language: hu_HU\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: hu\n" "X-Crowdin-Language: hu\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"Language: it_IT\n" "Language: it_IT\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: it\n" "X-Crowdin-Language: it\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Apri il compositore di testo avanzato" msgstr "Apri il compositore di testo avanzato"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titolo" msgstr "Titolo"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Sottotitolo, o sommario" msgstr "Sottotitolo o sommario"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Scrivi qui il tuo articolo. È supportato il Markdown." msgstr "Scrivi qui il tuo articolo. È supportato il Markdown."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Circa {} caratteri rimasti" msgstr "Circa {} caratteri rimasti"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etichette" msgstr "Etichette"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenza" msgstr "Licenza"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Copertina" msgstr "Copertina"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Questa è una bozza" msgstr "Questa è una bozza"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Pubblica" msgstr "Pubblica"
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Japanese\n" "Language-Team: Japanese\n"
"Language: ja_JP\n" "Language: ja_JP\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ja\n" "X-Crowdin-Language: ja\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "リッチテキストエディターを開く" msgstr "リッチテキストエディターを開く"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "タイトル" msgstr "タイトル"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "サブタイトルまたは概要" msgstr "サブタイトルまたは概要"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "投稿をここに書きます。Markdown がサポートされています。" msgstr "投稿をここに書きます。Markdown がサポートされています。"
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "残り約 {} 文字" msgstr "残り約 {} 文字"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "タグ" msgstr "タグ"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "ライセンス" msgstr "ライセンス"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "カバー" msgstr "カバー"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "これは下書きです" msgstr "これは下書きです"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "公開" msgstr "公開"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Korean\n" "Language-Team: Korean\n"
"Language: ko_KR\n" "Language: ko_KR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ko\n" "X-Crowdin-Language: ko\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:06\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Dutch\n" "Language-Team: Dutch\n"
"Language: nl_NL\n" "Language: nl_NL\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: nl\n" "X-Crowdin-Language: nl\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Norwegian\n" "Language-Team: Norwegian\n"
"Language: no_NO\n" "Language: no_NO\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: no\n" "X-Crowdin-Language: no\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+17 -15
View File
@@ -3,55 +3,57 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Polish\n" "Language-Team: Polish\n"
"Language: pl_PL\n" "Language: pl_PL\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n"
"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n"
"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: pl\n" "X-Crowdin-Language: pl\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Otwórz edytor tekstu sformatowanego" msgstr "Otwórz edytor tekstu sformatowanego"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Tytuł" msgstr "Tytuł"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:149
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Podtytuł, lub podsumowanie" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Napisz swój artykuł tutaj. Markdown jest obsługiwany." msgstr "Napisz swój artykuł tutaj. Markdown jest obsługiwany."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Pozostało w okolicy {} znaków" msgstr "Pozostało w okolicy {} znaków"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Tagi" msgstr "Tagi"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licencja" msgstr "Licencja"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Okładka" msgstr "Okładka"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "To jest szkic" msgstr "To jest szkic"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publikuj" msgstr "Opublikuj"
+20 -19
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-18 07:05\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Portuguese, Brazilian\n" "Language-Team: Portuguese\n"
"Language: pt_BR\n" "Language: pt_PT\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: pt-BR\n" "X-Crowdin-Language: pt-PT\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Abrir o editor de rich text" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Título" msgstr "Título"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Subtítulo ou resumo" msgstr "Legenda ou resumo"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Escreva seu artigo aqui. Markdown é suportado." msgstr "Escreva seu artigo aqui. Markdown pode ser usado."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Cerca de {} caracteres restantes" msgstr "Cerca de {} caracteres restantes"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Tags" msgstr "Tags"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licença" msgstr "Licença"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Capa" msgstr "Capa"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Isso é um rascunho" msgstr "Isso é um rascunho"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publicar" msgstr "Publicar"
+17 -15
View File
@@ -3,55 +3,57 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Romanian\n" "Language-Team: Romanian\n"
"Language: ro_RO\n" "Language: ro_RO\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100>0 && n%100<20)) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100>0 && n"
"%100<20)) ? 1 : 2);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ro\n" "X-Crowdin-Language: ro\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Deschide editorul de text" msgstr "Deschide editorul de text"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titlu" msgstr "Titlu"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "Subtitlu sau rezumat"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Scrie articolul tău aici. Markdown este acceptat." msgstr "Scrie articolul tău aici. Markdown este acceptat."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "În apropiere de {} caractere rămase" msgstr "În apropiere de {} caractere rămase"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Etichete" msgstr "Etichete"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenţă" msgstr "Licenţă"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Coperta" msgstr "Coperta"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Aceasta este o ciornă" msgstr "Aceasta este o ciornă"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publică" msgstr "Publică"
+15 -13
View File
@@ -3,23 +3,26 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Russian\n" "Language-Team: Russian\n"
"Language: ru_RU\n" "Language: ru_RU\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n" "Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 "
"&& n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 "
"&& n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: ru\n" "X-Crowdin-Language: ru\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "" msgstr ""
@@ -27,31 +30,30 @@ msgstr ""
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "" msgstr ""
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Slovak\n" "Language-Team: Slovak\n"
"Language: sk_SK\n" "Language: sk_SK\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n" "Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: sk\n" "X-Crowdin-Language: sk\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Otvor editor formátovaného textu" msgstr "Otvor editor formátovaného textu"
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Nadpis" msgstr "Nadpis"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Zhrnutie, alebo podnadpis" msgstr "Zhrnutie, alebo podnadpis"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Tu napíš svoj článok. Markdown je podporovaný." msgstr "Tu napíš svoj článok. Markdown je podporovaný."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Zostáva asi {} znakov" msgstr "Zostáva asi {} znakov"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Štítky" msgstr "Štítky"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licencia" msgstr "Licencia"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Obálka" msgstr "Obálka"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Toto je koncept" msgstr "Toto je koncept"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Zverejniť" msgstr "Zverejniť"
+14 -13
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 19:55\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Slovenian\n" "Language-Team: Slovenian\n"
"Language: sl_SI\n" "Language: sl_SI\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: sl\n" "X-Crowdin-Language: sl\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Naslov" msgstr "Naslov"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
msgid "Subtitle, or summary" msgid "Subtitle or summary"
msgstr "" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "" msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Oznake" msgstr "Oznake"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenca" msgstr "Licenca"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "To je osnutek" msgstr "To je osnutek"
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Objavi" msgstr "Objavi"
+23 -22
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 20:49\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Serbian (Latin)\n" "Language-Team: Serbian (Latin)\n"
"Language: sr_CS\n" "Language: sr_CS\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: sr-CS\n" "X-Crowdin-Language: sr-CS\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "Otvori uređivač sa stilizacijom" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Naslov" msgstr "Naslov"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:149
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "Podnaslov, ili sažetak" msgstr ""
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Napišite vaš članak ovde. Na raspolaganju vam je Markdown." msgstr ""
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Preostalo oko {} znakova" msgstr ""
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Markeri" msgstr ""
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licenca" msgstr ""
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Naslovna strana" msgstr ""
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "Ovo je nacrt" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Objavi" msgstr ""
+15 -14
View File
@@ -3,55 +3,56 @@ msgstr ""
"Project-Id-Version: plume\n" "Project-Id-Version: plume\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-15 16:33-0700\n" "POT-Creation-Date: 2018-06-15 16:33-0700\n"
"PO-Revision-Date: 2019-12-16 21:07\n" "PO-Revision-Date: 2019-04-17 18:15\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: Ana Gelez (AnaGelez)\n"
"Language-Team: Swedish\n" "Language-Team: Swedish\n"
"Language: sv_SE\n" "Language: sv_SE\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: crowdin.com\n"
"X-Crowdin-Project: plume\n" "X-Crowdin-Project: plume\n"
"X-Crowdin-Language: sv-SE\n" "X-Crowdin-Language: sv-SE\n"
"X-Crowdin-File: /master/po/plume-front/plume-front.pot\n" "X-Crowdin-File: /master/po/plume-front/plume-front.pot\n"
# plume-front/src/editor.rs:115 # plume-front/src/editor.rs:114
msgid "Open the rich text editor" msgid "Open the rich text editor"
msgstr "" msgstr ""
# plume-front/src/editor.rs:145 # plume-front/src/editor.rs:143
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
# plume-front/src/editor.rs:149 # plume-front/src/editor.rs:147
#, fuzzy
msgid "Subtitle, or summary" msgid "Subtitle, or summary"
msgstr "" msgstr "Undertitel eller sammanfattning"
# plume-front/src/editor.rs:156 # plume-front/src/editor.rs:154
msgid "Write your article here. Markdown is supported." msgid "Write your article here. Markdown is supported."
msgstr "Skriv din artikel här. Markdown stöds." msgstr "Skriv din artikel här. Markdown stöds."
# plume-front/src/editor.rs:167 # plume-front/src/editor.rs:165
msgid "Around {} characters left" msgid "Around {} characters left"
msgstr "Ungefär {} karaktärer kvar" msgstr "Ungefär {} karaktärer kvar"
# plume-front/src/editor.rs:243 # plume-front/src/editor.rs:228
msgid "Tags" msgid "Tags"
msgstr "Taggar" msgstr "Taggar"
# plume-front/src/editor.rs:244 # plume-front/src/editor.rs:229
msgid "License" msgid "License"
msgstr "Licens" msgstr "Licens"
# plume-front/src/editor.rs:247 # plume-front/src/editor.rs:232
msgid "Cover" msgid "Cover"
msgstr "Omslag" msgstr "Omslag"
# plume-front/src/editor.rs:267 # plume-front/src/editor.rs:252
msgid "This is a draft" msgid "This is a draft"
msgstr "" msgstr ""
# plume-front/src/editor.rs:274 # plume-front/src/editor.rs:259
msgid "Publish" msgid "Publish"
msgstr "Publicera" msgstr "Publicera"

Some files were not shown because too many files have changed in this diff Show More