For more context see mautrix/whatsapp#717 where I explained why this is a good idea.
After some digging in the source code I think this should go just before this line:
|
if content.Membership == event.MembershipJoin && intent != nil && intent.GetMXID() == extraUserID { |
Probably something like
if !portal.Bridge.Config.BridgeRemoteLeave && member.Membership == event.MembershipLeave {
log.Debug().Msg("Dropping remote leave event")
return EventHandlingResultIgnored
}
including the changes in the config file (in the config.go, upgrade.go and example-config.yaml file) should do the trick.
I am hesitating to create a pull request because I haven't setup a test environment yet and don't know when I will have time to do this. So if you have the time to make the changes yourself that would of course also be appreciated.
One should probably also either make the bridge bot leave the matrix room so it does not try to bridge further messages in the room (dirty hack), or a lot better: set the power level of the user to 0 and set the required power level to send messages in the room to something higher. This would mimic the state of at least whatsapp and signal groups after leaving, and one could use the bot to change everything (for example if one gets readded to the group).
I'd gladly take feedback on if this is correct (and maybe a pointer on how to do the power level stuff, but I'm guessing I would be able to figure it out myself if you don't have time).
For more context see mautrix/whatsapp#717 where I explained why this is a good idea.
After some digging in the source code I think this should go just before this line:
go/bridgev2/portal.go
Line 4522 in d63a008
Probably something like
including the changes in the config file (in the config.go, upgrade.go and example-config.yaml file) should do the trick.
I am hesitating to create a pull request because I haven't setup a test environment yet and don't know when I will have time to do this. So if you have the time to make the changes yourself that would of course also be appreciated.
One should probably also either make the bridge bot leave the matrix room so it does not try to bridge further messages in the room (dirty hack), or a lot better: set the power level of the user to 0 and set the required power level to send messages in the room to something higher. This would mimic the state of at least whatsapp and signal groups after leaving, and one could use the bot to change everything (for example if one gets readded to the group).
I'd gladly take feedback on if this is correct (and maybe a pointer on how to do the power level stuff, but I'm guessing I would be able to figure it out myself if you don't have time).