(ctx context.Context, e gomatrixserverlib.EDU)
| 432 | } |
| 433 | |
| 434 | func (t *txnReq) processSigningKeyUpdate(ctx context.Context, e gomatrixserverlib.EDU) error { |
| 435 | var updatePayload keyapi.CrossSigningKeyUpdate |
| 436 | if err := json.Unmarshal(e.Content, &updatePayload); err != nil { |
| 437 | util.GetLogger(ctx).WithError(err).WithFields(logrus.Fields{ |
| 438 | "user_id": updatePayload.UserID, |
| 439 | }).Debug("Failed to unmarshal signing key update") |
| 440 | return err |
| 441 | } |
| 442 | if _, serverName, err := gomatrixserverlib.SplitID('@', updatePayload.UserID); err != nil { |
| 443 | return nil |
| 444 | } else if serverName == t.ourServerName { |
| 445 | return nil |
| 446 | } else if serverName != t.Origin { |
| 447 | return nil |
| 448 | } |
| 449 | keys := gomatrixserverlib.CrossSigningKeys{} |
| 450 | if updatePayload.MasterKey != nil { |
| 451 | keys.MasterKey = *updatePayload.MasterKey |
| 452 | } |
| 453 | if updatePayload.SelfSigningKey != nil { |
| 454 | keys.SelfSigningKey = *updatePayload.SelfSigningKey |
| 455 | } |
| 456 | uploadReq := &keyapi.PerformUploadDeviceKeysRequest{ |
| 457 | CrossSigningKeys: keys, |
| 458 | UserID: updatePayload.UserID, |
| 459 | } |
| 460 | uploadRes := &keyapi.PerformUploadDeviceKeysResponse{} |
| 461 | t.keyAPI.PerformUploadDeviceKeys(ctx, uploadReq, uploadRes) |
| 462 | if uploadRes.Error != nil { |
| 463 | return uploadRes.Error |
| 464 | } |
| 465 | return nil |
| 466 | } |
| 467 | |
| 468 | // processReceiptEvent sends receipt events to JetStream |
| 469 | func (t *txnReq) processReceiptEvent(ctx context.Context, |
no test coverage detected