Rename FromId07 -> FromId
This commit is contained in:
		
							parent
							
								
									2804f44a06
								
							
						
					
					
						commit
						d8a2e1925f
					
				| @ -199,9 +199,9 @@ where | ||||
|     /// Registers an handler on this Inbox.
 | ||||
|     pub fn with07<A, V, M>(self, proxy: Option<&reqwest::Proxy>) -> Self | ||||
|     where | ||||
|         A: AsActor<&'a C> + FromId07<C, Error = E>, | ||||
|         A: AsActor<&'a C> + FromId<C, Error = E>, | ||||
|         V: activitystreams::markers::Activity + serde::de::DeserializeOwned, | ||||
|         M: AsObject07<A, V, &'a C, Error = E> + FromId07<C, Error = E>, | ||||
|         M: AsObject07<A, V, &'a C, Error = E> + FromId<C, Error = E>, | ||||
|         M::Output: Into<R>, | ||||
|     { | ||||
|         if let Self::NotHandled(ctx, mut act, e) = self { | ||||
| @ -328,7 +328,7 @@ fn get_id(json: serde_json::Value) -> Option<String> { | ||||
| /// a full object, and if so, save it with `from_activity`. If it is only an ID, it will try to find
 | ||||
| /// it in the database with `from_db`, and otherwise dereference (fetch) the full object and parse it
 | ||||
| /// with `from_activity`.
 | ||||
| pub trait FromId07<C>: Sized { | ||||
| pub trait FromId<C>: Sized { | ||||
|     /// The type representing a failure
 | ||||
|     type Error: From<InboxError<Self::Error>> + Debug; | ||||
| 
 | ||||
| @ -742,7 +742,7 @@ mod tests { | ||||
|     } | ||||
| 
 | ||||
|     struct MyActor; | ||||
|     impl FromId07<()> for MyActor { | ||||
|     impl FromId<()> for MyActor { | ||||
|         type Error = (); | ||||
|         type Object = Person07; | ||||
| 
 | ||||
| @ -811,7 +811,7 @@ mod tests { | ||||
|     } | ||||
| 
 | ||||
|     struct MyObject07; | ||||
|     impl FromId07<()> for MyObject07 { | ||||
|     impl FromId<()> for MyObject07 { | ||||
|         type Error = (); | ||||
|         type Object = Note07; | ||||
| 
 | ||||
| @ -977,7 +977,7 @@ mod tests { | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     impl FromId07<()> for FailingActor { | ||||
|     impl FromId<()> for FailingActor { | ||||
|         type Error = (); | ||||
|         type Object = Person07; | ||||
| 
 | ||||
|  | ||||
| @ -27,7 +27,7 @@ use openssl::{ | ||||
|     sign::{Signer, Verifier}, | ||||
| }; | ||||
| use plume_common::activity_pub::{ | ||||
|     inbox::{AsActor, FromId07}, | ||||
|     inbox::{AsActor, FromId}, | ||||
|     sign, ActivityStream, ApSignature, ApSignature07, CustomGroup as CustomGroup07, Id, IntoId, | ||||
|     PublicKey, PublicKey07, Source, SourceProperty, ToAsString, ToAsUri, | ||||
| }; | ||||
| @ -470,7 +470,7 @@ impl IntoId for Blog { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Blog { | ||||
| impl FromId<DbConn> for Blog { | ||||
|     type Error = Error; | ||||
|     type Object = CustomGroup07; | ||||
| 
 | ||||
|  | ||||
| @ -30,7 +30,7 @@ use chrono::{self, NaiveDateTime, TimeZone, Utc}; | ||||
| use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; | ||||
| use plume_common::{ | ||||
|     activity_pub::{ | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|         sign::Signer, | ||||
|         Id, IntoId, ToAsString, ToAsUri, PUBLIC_VISIBILITY, | ||||
|     }, | ||||
| @ -294,7 +294,7 @@ impl Comment { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Comment { | ||||
| impl FromId<DbConn> for Comment { | ||||
|     type Error = Error; | ||||
|     type Object = Note07; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,7 @@ use activitystreams::{ | ||||
| use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl, SaveChangesDsl}; | ||||
| use plume_common::activity_pub::{ | ||||
|     broadcast, broadcast07, | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|     sign::Signer, | ||||
|     Id, IntoId, PUBLIC_VISIBILITY, | ||||
| }; | ||||
| @ -272,7 +272,7 @@ impl AsObject07<User, FollowAct07, &DbConn> for User { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Follow { | ||||
| impl FromId<DbConn> for Follow { | ||||
|     type Error = Error; | ||||
|     type Object = FollowAct07; | ||||
| 
 | ||||
|  | ||||
| @ -12,7 +12,7 @@ use activitystreams::{ | ||||
| use chrono::NaiveDateTime; | ||||
| use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; | ||||
| use plume_common::activity_pub::{ | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|     sign::Signer, | ||||
|     Id, IntoId, PUBLIC_VISIBILITY, | ||||
| }; | ||||
| @ -158,7 +158,7 @@ impl AsObject07<User, Like07, &DbConn> for Post { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Like { | ||||
| impl FromId<DbConn> for Like { | ||||
|     type Error = Error; | ||||
|     type Object = Like07; | ||||
| 
 | ||||
|  | ||||
| @ -7,7 +7,7 @@ use activitystreams::{object::Image as Image07, prelude::*}; | ||||
| use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; | ||||
| use guid_create::GUID; | ||||
| use plume_common::{ | ||||
|     activity_pub::{inbox::FromId07, request, Id, ToAsString, ToAsUri}, | ||||
|     activity_pub::{inbox::FromId, request, Id, ToAsString, ToAsUri}, | ||||
|     utils::{escape, MediaProcessor}, | ||||
| }; | ||||
| use std::{ | ||||
|  | ||||
| @ -26,7 +26,7 @@ use diesel::{self, BelongingToDsl, ExpressionMethods, QueryDsl, RunQueryDsl}; | ||||
| use once_cell::sync::Lazy; | ||||
| use plume_common::{ | ||||
|     activity_pub::{ | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|         sign::Signer, | ||||
|         Hashtag, Hashtag07, HashtagType07, Id, IntoId, Licensed, Licensed07, | ||||
|         LicensedArticle as LicensedArticle07, Source, SourceProperty, ToAsString, ToAsUri, | ||||
| @ -863,7 +863,7 @@ impl Post { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Post { | ||||
| impl FromId<DbConn> for Post { | ||||
|     type Error = Error; | ||||
|     type Object = LicensedArticle07; | ||||
| 
 | ||||
| @ -1119,7 +1119,7 @@ pub struct PostUpdate { | ||||
|     pub tags: Option<serde_json::Value>, | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for PostUpdate { | ||||
| impl FromId<DbConn> for PostUpdate { | ||||
|     type Error = Error; | ||||
|     type Object = LicensedArticle07; | ||||
| 
 | ||||
|  | ||||
| @ -10,7 +10,7 @@ use activitystreams::{ | ||||
|     base::AnyBase, | ||||
|     object::kind::ArticleType, | ||||
| }; | ||||
| use plume_common::activity_pub::{inbox::FromId07, LicensedArticle as LicensedArticle07}; | ||||
| use plume_common::activity_pub::{inbox::FromId, LicensedArticle as LicensedArticle07}; | ||||
| use riker::actors::{Actor, ActorFactoryArgs, ActorRefFactory, Context, Sender, Subscribe, Tell}; | ||||
| use std::sync::Arc; | ||||
| use tracing::{error, info, warn}; | ||||
|  | ||||
| @ -12,7 +12,7 @@ use activitystreams::{ | ||||
| use chrono::NaiveDateTime; | ||||
| use diesel::{self, ExpressionMethods, QueryDsl, RunQueryDsl}; | ||||
| use plume_common::activity_pub::{ | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|     inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|     sign::Signer, | ||||
|     Id, IntoId, PUBLIC_VISIBILITY, | ||||
| }; | ||||
| @ -186,7 +186,7 @@ impl AsObject07<User, Announce07, &DbConn> for Post { | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| impl FromId07<DbConn> for Reshare { | ||||
| impl FromId<DbConn> for Reshare { | ||||
|     type Error = Error; | ||||
|     type Object = Announce07; | ||||
| 
 | ||||
|  | ||||
| @ -35,7 +35,7 @@ use openssl::{ | ||||
| }; | ||||
| use plume_common::{ | ||||
|     activity_pub::{ | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId07}, | ||||
|         inbox::{AsActor, AsObject, AsObject07, FromId}, | ||||
|         request::get, | ||||
|         sign::{gen_keypair, Error as SignError, Result as SignResult, Signer}, | ||||
|         ActivityStream, ApSignature, ApSignature07, CustomPerson as CustomPerson07, Id, IntoId, | ||||
| @ -1127,7 +1127,7 @@ impl IntoId for User { | ||||
| 
 | ||||
| impl Eq for User {} | ||||
| 
 | ||||
| impl FromId07<DbConn> for User { | ||||
| impl FromId<DbConn> for User { | ||||
|     type Error = Error; | ||||
|     type Object = CustomPerson07; | ||||
| 
 | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| use plume_common::activity_pub::{ | ||||
|     inbox::FromId07, | ||||
|     inbox::FromId, | ||||
|     request::Digest, | ||||
|     sign::{verify_http_headers, Signable}, | ||||
| }; | ||||
|  | ||||
| @ -11,7 +11,7 @@ use validator::{Validate, ValidationErrors}; | ||||
| use crate::inbox; | ||||
| use crate::routes::{errors::ErrorPage, rocket_uri_macro_static_files, Page, RespondOrRedirect}; | ||||
| use crate::template_utils::{IntoContext, Ructe}; | ||||
| use plume_common::activity_pub::{broadcast, inbox::FromId07}; | ||||
| use plume_common::activity_pub::{broadcast, inbox::FromId}; | ||||
| use plume_models::{ | ||||
|     admin::*, | ||||
|     blocklisted_emails::*, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user