mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Add EDU server wiring
This commit is contained in:
parent
dcadec88d9
commit
8683f7553f
9 changed files with 105 additions and 0 deletions
|
@ -75,6 +75,18 @@ type InputReceiptEventRequest struct {
|
|||
// InputReceiptEventResponse is a response to InputReceiptEventRequest
|
||||
type InputReceiptEventResponse struct{}
|
||||
|
||||
type SigningKeyUpdate struct {
|
||||
MasterKey gomatrixserverlib.CrossSigningKey `json:"master_key"`
|
||||
SelfSigningKey gomatrixserverlib.CrossSigningKey `json:"cross_signing_key"`
|
||||
UserID string `json:"user_id"`
|
||||
}
|
||||
|
||||
type InputSigningKeyUpdateRequest struct {
|
||||
SigningKeyUpdate
|
||||
}
|
||||
|
||||
type InputSigningKeyUpdateResponse struct{}
|
||||
|
||||
// EDUServerInputAPI is used to write events to the typing server.
|
||||
type EDUServerInputAPI interface {
|
||||
InputTypingEvent(
|
||||
|
@ -94,4 +106,10 @@ type EDUServerInputAPI interface {
|
|||
request *InputReceiptEventRequest,
|
||||
response *InputReceiptEventResponse,
|
||||
) error
|
||||
|
||||
InputSigningKeyUpdate(
|
||||
ctx context.Context,
|
||||
request *InputSigningKeyUpdateRequest,
|
||||
response *InputSigningKeyUpdateResponse,
|
||||
) error
|
||||
}
|
||||
|
|
|
@ -85,3 +85,9 @@ type FederationReceiptData struct {
|
|||
Data ReceiptTS `json:"data"`
|
||||
EventIDs []string `json:"event_ids"`
|
||||
}
|
||||
|
||||
type OutputSigningKeyUpdate struct {
|
||||
SigningKeyUpdate
|
||||
Type string `json:"type"`
|
||||
Timestamp gomatrixserverlib.Timestamp `json:"timestamp"`
|
||||
}
|
||||
|
|
|
@ -86,3 +86,20 @@ func SendReceipt(
|
|||
response := InputReceiptEventResponse{}
|
||||
return eduAPI.InputReceiptEvent(ctx, &request, &response)
|
||||
}
|
||||
|
||||
func SendSigningKeyUpdate(
|
||||
ctx context.Context,
|
||||
eduAPI EDUServerInputAPI,
|
||||
userID string,
|
||||
masterKey, selfSigningKey gomatrixserverlib.CrossSigningKey,
|
||||
) error {
|
||||
request := InputSigningKeyUpdateRequest{
|
||||
SigningKeyUpdate: SigningKeyUpdate{
|
||||
MasterKey: masterKey,
|
||||
SelfSigningKey: selfSigningKey,
|
||||
UserID: userID,
|
||||
},
|
||||
}
|
||||
response := InputSigningKeyUpdateResponse{}
|
||||
return eduAPI.InputSigningKeyUpdate(ctx, &request, &response)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue