Some fixes to AP types
This commit is contained in:
parent
586fa40113
commit
e261de7060
6 changed files with 24 additions and 6 deletions
|
@ -10,5 +10,5 @@ type AnnounceAction struct {
|
|||
Actor url.URL `json:"actor"` // Who is announcing something
|
||||
To []url.URL `json:"to"` // Targets to share to
|
||||
Cc []url.URL `json:"cc"` // More targets to send to
|
||||
Object url.URL `json:"object"` // Url to announced object
|
||||
Object any `json:"object"` // Url to announced object. Url or embedded object, usually a note or survey
|
||||
}
|
||||
|
|
|
@ -15,4 +15,5 @@ type CreateAction struct {
|
|||
Object any `json:"object"` // Content of the action, is an AP object, like notes or questions (survey)
|
||||
To []url.URL `json:"to"` // Array of url targets to deliver it to. With dms, oonly includes target accounts. Followers only goes to followers url of posting account
|
||||
Cc []url.URL `json:"cc"` // More targets to deliver to?
|
||||
Signature Signature `json:"signature"` // Signature of the message
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package ap
|
|||
|
||||
import (
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
// When a message is deleted
|
||||
|
@ -11,6 +10,6 @@ type DeleteAction struct {
|
|||
Id url.URL `json:"id"` // Location of this resource
|
||||
Type string `json:"type"` // Should always be "Delete"
|
||||
Actor url.URL `json:"actor"` // Account deleting something
|
||||
Target url.URL `json:"object"` // Account that the actor wants to follow
|
||||
Published time.Time `json:"published"` // When this was done
|
||||
Target any `json:"object"` // What is being deleted, url or some object
|
||||
Signature any `json:"signature"` // Probably useless
|
||||
}
|
||||
|
|
|
@ -9,4 +9,9 @@ type LikeAction struct {
|
|||
Type string `json:"type"` // Should always be "Like"
|
||||
Actor url.URL `json:"actor"` // Who is liking something
|
||||
Object url.URL `json:"object"` // What is being liked
|
||||
|
||||
// Reaction data Misskey style
|
||||
Content *string `json:"content,omitempty"` // Raw emote name
|
||||
MkReaction *string `json:"_misskey_reaction,omitempty"` // Misskey version of content
|
||||
Tag []Emote `json:"tag,omitempty"` // Emote in use
|
||||
}
|
||||
|
|
13
ap/signature.go
Normal file
13
ap/signature.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
package ap
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Signature struct {
|
||||
Created time.Time `json:"created"` // When this signature was created
|
||||
Creator url.URL `json:"creator"` // What key was used to create it
|
||||
Value string `json:"signatureValue"` // The signature itself
|
||||
Type string `json:"type"` // What algorithm was used
|
||||
}
|
|
@ -2,11 +2,11 @@ package ap
|
|||
|
||||
import "net/url"
|
||||
|
||||
// Undo == unfollow
|
||||
// Undoes one action
|
||||
type UndoAction struct {
|
||||
Context *map[string]any `json:"@context,omitempty"` // Lots of something. Not included if action is embedded as object in another object
|
||||
Id url.URL `json:"id"` // Location of this resource
|
||||
Type string `json:"type"` // Should always be "Undo"
|
||||
Actor url.URL `json:"actor"` // Account instanciating the follow request
|
||||
Target FollowAction `json:"object"` // Follow to undo
|
||||
Target any `json:"object"` // Action to undo, usually a like or follow
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue