SocialPub/PrivaPub/Models/ActivityPub/ActivityPubActivity.cs

45 lines
1.1 KiB
C#
Raw Normal View History

2023-02-19 00:43:43 +01:00
using PrivaPub.Models.ActivityPub.Extra;
2023-02-18 08:52:17 +01:00
using System.Text.Json.Serialization;
2023-02-19 00:43:43 +01:00
namespace PrivaPub.Models.ActivityPub
2023-02-18 08:52:17 +01:00
{
[JsonSerializable(typeof(ActivityPubActivity))]
public class ActivityPubActivity : ActivityPubObject
{
[JsonPropertyName("actor")]
public ActivityPubActor Actor { get; set; }
[JsonPropertyName("object")]
public ActivityPubObject Object { get; set; }
[JsonPropertyName("target")]
public ActivityPubObject Target { get; set; }
[JsonPropertyName("result")]
public ActivityPubResult Result { get; set; }
[JsonPropertyName("origin")]
public ActivityPubOrigin Origin { get; set; }
[JsonPropertyName("instrument")]
public ActivityPubInstrument Instrument { get; set; }
[JsonIgnore]
public bool NeedsObjectForInbox => Type is
ObjectType.Create or
ObjectType.Update or
ObjectType.Delete or
ObjectType.Follow or
ObjectType.Add or
ObjectType.Remove or
ObjectType.Like or
ObjectType.Block or
ObjectType.Undo;
[JsonIgnore]
public bool NeedsTargetForInbox => Type is
ObjectType.Add or
ObjectType.Remove;
}
}