-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sharedInbox to Actor #176
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
/// </remarks> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-collection" /> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection" /> | ||
public class ASOrderedCollection : ASObject, IASModel<ASOrderedCollection, ASOrderedCollectionEntity, ASObject>, IEnumerable<Linkable<ASObject>> | ||
public class ASOrderedCollection : ASCollection, IASModel<ASOrderedCollection, ASOrderedCollectionEntity, ASCollection>, IEnumerable<Linkable<ASObject>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it also breaks for ASOrderedCollectionPage, which should logically be assignable to both ASOrderedCollection and ASCollectionPage |
||
{ | ||
/// <summary> | ||
/// ActivityStreams type name for "OrderedCollection" types. | ||
|
@@ -46,13 +46,13 @@ | |
static ASOrderedCollection IASModel<ASOrderedCollection>.FromGraph(TypeMap typeMap) => new(typeMap, null); | ||
|
||
private ASOrderedCollectionEntity Entity { get; } | ||
|
||
|
||
/// <summary> | ||
/// In a paged Collection, indicates the page that contains the most recently updated member items. | ||
/// </summary> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-current" /> | ||
public Linkable<ASOrderedCollectionPage>? Current | ||
Check warning on line 55 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 55 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 55 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
Check warning on line 55 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
Check warning on line 55 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, macos-latest)
|
||
{ | ||
get => Entity.Current; | ||
set => Entity.Current = value; | ||
|
@@ -62,7 +62,7 @@ | |
/// In a paged Collection, indicates the furthest preceding page of items in the collection. | ||
/// </summary> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-first" /> | ||
public Linkable<ASOrderedCollectionPage>? First | ||
Check warning on line 65 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 65 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
{ | ||
get => Entity.First; | ||
set => Entity.First = value; | ||
|
@@ -72,7 +72,7 @@ | |
/// In a paged Collection, indicates the furthest proceeding page of the collection. | ||
/// </summary> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-last" /> | ||
public Linkable<ASOrderedCollectionPage>? Last | ||
Check warning on line 75 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 75 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
{ | ||
get => Entity.Last; | ||
set => Entity.Last = value; | ||
|
@@ -88,7 +88,7 @@ | |
/// If neither is set, returns zero. | ||
/// This cannot be set to less than zero. | ||
/// </remarks> | ||
public int TotalItems | ||
Check warning on line 91 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 91 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
{ | ||
get => Entity.TotalItems; | ||
set => Entity.TotalItems = value; | ||
|
@@ -104,7 +104,7 @@ | |
/// In a paged collection, this MAY be null | ||
/// </remarks> | ||
/// <seealso href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-items" /> | ||
public LinkableList<ASObject>? Items | ||
Check warning on line 107 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 107 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
{ | ||
get => Entity.Items; | ||
set => Entity.Items = value; | ||
|
@@ -114,18 +114,18 @@ | |
/// True if this is a paged collection, false otherwise. | ||
/// </summary> | ||
[MemberNotNullWhen(true, nameof(FirstPopulated))] | ||
public bool IsPaged => Current != null || First != null || Last != null; | ||
Check warning on line 117 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 117 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
|
||
/// <summary> | ||
/// In a paged Collection, gets the first populated entity. | ||
/// </summary> | ||
public Linkable<ASOrderedCollectionPage>? FirstPopulated => Current ?? First ?? Last; | ||
Check warning on line 122 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 122 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
Check warning on line 122 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, macos-latest)
|
||
|
||
/// <summary> | ||
/// True if this collection instance contains items, false otherwise. | ||
/// </summary> | ||
[MemberNotNullWhen(true, nameof(Items))] | ||
public bool HasItems => Items?.Any() == true; | ||
Check warning on line 128 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 128 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
|
||
|
||
/// <summary> | ||
/// Converts a list of items into an ordered collection. | ||
|
@@ -136,7 +136,7 @@ | |
}; | ||
|
||
/// <inheritdoc /> | ||
public IEnumerator<Linkable<ASObject>> GetEnumerator() => Items?.GetEnumerator() ?? Enumerable.Empty<Linkable<ASObject>>().GetEnumerator(); | ||
Check warning on line 139 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, ubuntu-latest)
Check warning on line 139 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, windows-latest)
Check warning on line 139 in Source/ActivityPub.Types/AS/Collection/ASOrderedCollection.cs GitHub Actions / build (8.0.x, macos-latest)
|
||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this, unfortunately, won't work because ASCollection has a separate entity with a separate copy of the collection. It may be possible to support this by loading the same entity into both classes - I'll take a look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that big of a deal, honestly. I'll split out the shared inbox. The rest is workable as-is. The AS2 inheritance tree is nonsensical.