Rename activitypub::activity module to activitypub::types
This commit is contained in:
parent
72637fe80c
commit
41fdb8abb0
7 changed files with 13 additions and 9 deletions
|
@ -3,7 +3,6 @@ use serde::Serialize;
|
|||
use tokio_postgres::GenericClient;
|
||||
|
||||
use crate::activitypub::{
|
||||
activity::{Attachment, Tag},
|
||||
actors::types::Actor,
|
||||
constants::{AP_MEDIA_TYPE, AP_CONTEXT, AP_PUBLIC},
|
||||
deliverer::OutgoingActivity,
|
||||
|
@ -13,6 +12,7 @@ use crate::activitypub::{
|
|||
local_actor_subscribers,
|
||||
local_object_id,
|
||||
},
|
||||
types::{Attachment, Tag},
|
||||
vocabulary::{CREATE, DOCUMENT, HASHTAG, LINK, MENTION, NOTE},
|
||||
};
|
||||
use crate::config::Instance;
|
||||
|
|
|
@ -4,9 +4,11 @@ use std::time::Duration;
|
|||
use reqwest::{Client, Method, Proxy, RequestBuilder};
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::activitypub::activity::Object;
|
||||
use crate::activitypub::actors::types::Actor;
|
||||
use crate::activitypub::constants::AP_MEDIA_TYPE;
|
||||
use crate::activitypub::{
|
||||
actors::types::Actor,
|
||||
constants::AP_MEDIA_TYPE,
|
||||
types::Object,
|
||||
};
|
||||
use crate::config::Instance;
|
||||
use crate::http_signatures::create::{
|
||||
create_http_signature,
|
||||
|
|
|
@ -4,11 +4,11 @@ use std::path::Path;
|
|||
use tokio_postgres::GenericClient;
|
||||
|
||||
use crate::activitypub::{
|
||||
activity::Object,
|
||||
actors::helpers::{create_remote_profile, update_remote_profile},
|
||||
handlers::create::handle_note,
|
||||
identifiers::parse_local_object_id,
|
||||
receiver::HandlerError,
|
||||
types::Object,
|
||||
};
|
||||
use crate::config::{Config, Instance};
|
||||
use crate::database::DatabaseError;
|
||||
|
|
|
@ -7,7 +7,6 @@ use tokio_postgres::GenericClient;
|
|||
use uuid::Uuid;
|
||||
|
||||
use crate::activitypub::{
|
||||
activity::{Attachment, Link, Object, Tag},
|
||||
constants::{AP_MEDIA_TYPE, AP_PUBLIC, AS_MEDIA_TYPE},
|
||||
fetcher::fetchers::fetch_file,
|
||||
fetcher::helpers::{
|
||||
|
@ -17,6 +16,7 @@ use crate::activitypub::{
|
|||
},
|
||||
identifiers::parse_local_actor_id,
|
||||
receiver::{parse_array, parse_property_value, HandlerError},
|
||||
types::{Attachment, Link, Object, Tag},
|
||||
vocabulary::*,
|
||||
};
|
||||
use crate::config::{Config, Instance};
|
||||
|
@ -417,8 +417,8 @@ pub async fn handle_create(
|
|||
mod tests {
|
||||
use serde_json::json;
|
||||
use crate::activitypub::{
|
||||
activity::Object,
|
||||
actors::types::Actor,
|
||||
types::Object,
|
||||
vocabulary::NOTE,
|
||||
};
|
||||
use super::*;
|
||||
|
|
|
@ -4,12 +4,12 @@ use serde_json::Value;
|
|||
use tokio_postgres::GenericClient;
|
||||
|
||||
use crate::activitypub::{
|
||||
activity::Object,
|
||||
actors::{
|
||||
helpers::update_remote_profile,
|
||||
types::Actor,
|
||||
},
|
||||
handlers::create::get_note_content,
|
||||
types::Object,
|
||||
vocabulary::{NOTE, PERSON},
|
||||
};
|
||||
use crate::config::Config;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
mod activity;
|
||||
pub mod actors;
|
||||
mod authentication;
|
||||
pub mod builders;
|
||||
|
@ -10,6 +9,7 @@ mod handlers;
|
|||
pub mod identifiers;
|
||||
pub mod queues;
|
||||
mod receiver;
|
||||
mod types;
|
||||
pub mod views;
|
||||
mod vocabulary;
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ pub struct Tag {
|
|||
#[cfg_attr(test, derive(Default))]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Object {
|
||||
// https://www.w3.org/TR/activitypub/#obj-id
|
||||
// "id" and "type" are required properties
|
||||
pub id: String,
|
||||
|
||||
#[serde(rename = "type")]
|
Loading…
Reference in a new issue