23 lines
432 B
Rust
23 lines
432 B
Rust
|
use lemmy_utils::settings::Settings;
|
||
|
use url::{ParseError, Url};
|
||
|
use uuid::Uuid;
|
||
|
|
||
|
pub mod comment;
|
||
|
pub mod community;
|
||
|
pub mod post;
|
||
|
pub mod private_message;
|
||
|
pub mod user;
|
||
|
|
||
|
fn generate_activity_id<T>(kind: T) -> Result<Url, ParseError>
|
||
|
where
|
||
|
T: ToString,
|
||
|
{
|
||
|
let id = format!(
|
||
|
"{}/receive/{}/{}",
|
||
|
Settings::get().get_protocol_and_hostname(),
|
||
|
kind.to_string().to_lowercase(),
|
||
|
Uuid::new_v4()
|
||
|
);
|
||
|
Url::parse(&id)
|
||
|
}
|