forked from MirrorHub/mautrix-whatsapp
Check prev_content for all leave events
This commit is contained in:
parent
d24a8821c1
commit
c85b003fe8
1 changed files with 7 additions and 7 deletions
|
@ -274,7 +274,6 @@ func (mx *MatrixHandler) HandleMembership(evt *event.Event) {
|
||||||
isSelf := id.UserID(evt.GetStateKey()) == evt.Sender
|
isSelf := id.UserID(evt.GetStateKey()) == evt.Sender
|
||||||
|
|
||||||
if content.Membership == event.MembershipLeave {
|
if content.Membership == event.MembershipLeave {
|
||||||
if isSelf {
|
|
||||||
if evt.Unsigned.PrevContent != nil {
|
if evt.Unsigned.PrevContent != nil {
|
||||||
_ = evt.Unsigned.PrevContent.ParseRaw(evt.Type)
|
_ = evt.Unsigned.PrevContent.ParseRaw(evt.Type)
|
||||||
prevContent, ok := evt.Unsigned.PrevContent.Parsed.(*event.MemberEventContent)
|
prevContent, ok := evt.Unsigned.PrevContent.Parsed.(*event.MemberEventContent)
|
||||||
|
@ -282,6 +281,7 @@ func (mx *MatrixHandler) HandleMembership(evt *event.Event) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if isSelf {
|
||||||
portal.HandleMatrixLeave(user)
|
portal.HandleMatrixLeave(user)
|
||||||
} else {
|
} else {
|
||||||
portal.HandleMatrixKick(user, evt)
|
portal.HandleMatrixKick(user, evt)
|
||||||
|
|
Loading…
Reference in a new issue