mautrix / imessage

A Matrix-iMessage puppeting bridge
https://go.mau.fi/mautrix-imessage/
GNU Affero General Public License v3.0
332 stars 36 forks source link

[bluebubbles] Implement handleIMessageAliasRemoved #165

Open cnuss opened 5 months ago

joshuafhiggins commented 4 months ago

I'm in the middle of implementing this now but I'm unfamiliar with working in mautrix bridges. Is there a way to send a message from the bridge bot to the user in the mautrix API? I'm not sure if I'm missing something in my searching through bridge functions. It also seemed like there was confusion on what this BlueBubbles API event is for, the event tells the client that a phone number or email has been deregistered from iMessage on the Mac and returns an array of strings for the phone numbers and emails. This is useful for SIMLessPNR or Beeper Mini users who phone number hacks break at times. The reason the event never triggered was because the actual event name is "imessage-aliases-removed" and not "imessage-alias-removed"

trek-boldly-go commented 4 months ago

All the messages from users to the bot are processed and responded to in the commands.go file. Although I don't know of a way to send a message that isn't a response to a user message.

I never tried any sim swap methods or anything so I wouldn't have been able to simulate this event to see the payload it sends.

Other than trying to notify the user as it seems you are, I don't think the bridge really needs to do anything with this event. Matrix doesn't actually care what alias you send from, and neither does the bridge. Nevertheless, I understand wanting to know if your number is suddenly deregistered.

You may look at other beeper bridges to see if they send messages unprompted as you wish to do, since I just copied that commands file from another bridge anyway (with modifications of course).