♻️ Refactor activitypub content storage

This commit is contained in:
2025-12-30 23:37:57 +08:00
parent 8dc01c8a85
commit 6aa6833163
26 changed files with 3339 additions and 919 deletions

View File

@@ -45,6 +45,15 @@ message CloudFile {
// When the file was uploaded
google.protobuf.Timestamp uploaded_at = 11;
// Image/Video width (optional, for media files)
optional int32 width = 13;
// Image/Video height (optional, for media files)
optional int32 height = 14;
// Blurhash for placeholder (optional, for images)
optional string blurhash = 15;
}
// Service for file operations

View File

@@ -61,8 +61,33 @@ enum PostEmbedViewRenderer {
WEBVIEW = 1;
}
enum PostContentType {
POST_CONTENT_TYPE_UNSPECIFIED = 0;
MARKDOWN = 1;
HTML = 2;
}
enum FediverseContentType {
FEDIVERSE_CONTENT_TYPE_UNSPECIFIED = 0;
FEDIVERSE_NOTE = 1;
FEDIVERSE_ARTICLE = 2;
FEDIVERSE_IMAGE = 3;
FEDIVERSE_VIDEO = 4;
FEDIVERSE_AUDIO = 5;
FEDIVERSE_PAGE = 6;
FEDIVERSE_QUESTION = 7;
FEDIVERSE_EVENT = 8;
FEDIVERSE_DOCUMENT = 9;
}
// Messages
message ContentMention {
optional string username = 1;
optional string url = 2;
optional string actor_uri = 3;
}
message PostEmbedView {
string uri = 1;
optional double aspect_ratio = 2;
@@ -110,7 +135,16 @@ message Post {
repeated CloudFile attachments = 30; // List<SnCloudFileReferenceObject>
string publisher_id = 31;
Publisher publisher = 32;
optional Publisher publisher = 32;
optional string fediverse_uri = 41;
optional FediverseContentType fediverse_type = 42;
optional string language = 43;
optional PostContentType content_type = 44;
repeated ContentMention mentions = 48;
int32 boost_count = 50;
int32 like_count = 51;
optional string actor_id = 53;
repeated PostAward awards = 33;
repeated PostReaction reactions = 34;
@@ -189,6 +223,10 @@ message PostReaction {
string account_id = 5;
optional Account account = 6; // optional full account
optional string fediverse_uri = 9;
optional string actor_id = 11;
bool is_local = 10;
google.protobuf.Timestamp created_at = 7;
google.protobuf.Timestamp updated_at = 8;
}