mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Ignore missing prev_content in matrix leave handler
This commit is contained in:
parent
06a3346d28
commit
d24a8821c1
1 changed files with 3 additions and 4 deletions
|
@ -278,12 +278,11 @@ func (mx *MatrixHandler) HandleMembership(evt *event.Event) {
|
|||
if evt.Unsigned.PrevContent != nil {
|
||||
_ = evt.Unsigned.PrevContent.ParseRaw(evt.Type)
|
||||
prevContent, ok := evt.Unsigned.PrevContent.Parsed.(*event.MemberEventContent)
|
||||
if ok {
|
||||
if portal.IsPrivateChat() || prevContent.Membership == "join" {
|
||||
portal.HandleMatrixLeave(user)
|
||||
}
|
||||
if ok && prevContent.Membership != "join" {
|
||||
return
|
||||
}
|
||||
}
|
||||
portal.HandleMatrixLeave(user)
|
||||
} else {
|
||||
portal.HandleMatrixKick(user, evt)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue