Invert condition

This commit is contained in:
Brendan Abolivier 2017-09-08 13:49:56 +01:00
parent 1d517e0bb9
commit eb5abbd96a
No known key found for this signature in database
GPG key ID: 8EF1500759F70623

View file

@ -177,18 +177,21 @@ func fillDisplayName(
} }
} }
if thirdPartyInviteEvent != nil { if thirdPartyInviteEvent == nil {
var thirdPartyInviteContent common.ThirdPartyInviteContent // If the third party invite event doesn't exist then we can't use it to set the display name.
if err := json.Unmarshal(thirdPartyInviteEvent.Content(), &thirdPartyInviteContent); err != nil { return nil
return err }
}
// Use the m.room.third_party_invite event to fill the "displayname" and var thirdPartyInviteContent common.ThirdPartyInviteContent
// update the m.room.member event's content with it if err := json.Unmarshal(thirdPartyInviteEvent.Content(), &thirdPartyInviteContent); err != nil {
content.ThirdPartyInvite.DisplayName = thirdPartyInviteContent.DisplayName return err
if err := builder.SetContent(content); err != nil { }
return err
} // Use the m.room.third_party_invite event to fill the "displayname" and
// update the m.room.member event's content with it
content.ThirdPartyInvite.DisplayName = thirdPartyInviteContent.DisplayName
if err := builder.SetContent(content); err != nil {
return err
} }
return nil return nil