Replace event content types with ones in gomatrixserverlib (#785)

The types that are not in gomatrixserverlib are not replaced.

This also updates the gomatrixserverlib dependency.
This commit is contained in:
Alex Chen 2019-08-16 01:45:11 +08:00 committed by GitHub
parent d21a2fb152
commit d63d2a50cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 105 deletions

View file

@ -27,7 +27,6 @@ import (
"github.com/matrix-org/dendrite/clientapi/httputil"
"github.com/matrix-org/dendrite/clientapi/jsonerror"
"github.com/matrix-org/dendrite/clientapi/producers"
"github.com/matrix-org/dendrite/common"
"github.com/matrix-org/dendrite/common/config"
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
@ -38,11 +37,11 @@ import (
)
type invite struct {
MXID string `json:"mxid"`
RoomID string `json:"room_id"`
Sender string `json:"sender"`
Token string `json:"token"`
Signed common.TPInviteSigned `json:"signed"`
MXID string `json:"mxid"`
RoomID string `json:"room_id"`
Sender string `json:"sender"`
Token string `json:"token"`
Signed gomatrixserverlib.MemberThirdPartyInviteSigned `json:"signed"`
}
type invites struct {
@ -199,11 +198,11 @@ func createInviteFrom3PIDInvite(
return nil, err
}
content := common.MemberContent{
content := gomatrixserverlib.MemberContent{
AvatarURL: profile.AvatarURL,
DisplayName: profile.DisplayName,
Membership: gomatrixserverlib.Invite,
ThirdPartyInvite: &common.TPInvite{
ThirdPartyInvite: &gomatrixserverlib.MemberThirdPartyInvite{
Signed: inv.Signed,
},
}
@ -330,7 +329,7 @@ func sendToRemoteServer(
func fillDisplayName(
builder *gomatrixserverlib.EventBuilder, authEvents gomatrixserverlib.AuthEvents,
) error {
var content common.MemberContent
var content gomatrixserverlib.MemberContent
if err := json.Unmarshal(builder.Content, &content); err != nil {
return err
}
@ -343,7 +342,7 @@ func fillDisplayName(
return nil
}
var thirdPartyInviteContent common.ThirdPartyInviteContent
var thirdPartyInviteContent gomatrixserverlib.ThirdPartyInviteContent
if err := json.Unmarshal(thirdPartyInviteEvent.Content(), &thirdPartyInviteContent); err != nil {
return err
}