Closed CarlAmbroselli closed 2 years ago
I thought barcelona is supposed to send the message before responding :thinking:
@tulir would this here not wipe it directly after telling Barcelona to do the send job? https://github.com/mautrix/imessage/blob/7bf7c23dbfd58408280e3b8e0bdecf3a022cfda6/portal.go#L883-L885
would this here not wipe it directly after telling Barcelona to do the send job?
No, SendFile
waits for reply. The Mac connector has that sleep because there's no way to wait for the send with AppleScript, but Barcelona can wait.
Barcelona waits asynchronously for the send to complete and "returns" before that's done already (and doesn't do anything with the information that it's done other than logging errors, so definitely not telling the bridge): https://github.com/open-imcore/barcelona/blob/2875ea24a673028f49282154164842643410ed67/Beeper/BarcelonaMautrixIPC/IPCHandlers/CommandHandlers/SendMediaMessageCommand%2BHandler.swift#L40-L68
The Mac code does this because it has no choice (it does not have the luxury of using IMCore). This is a bug in Barcelona for iOS, so the appropriate fix should be made there.
The async handler you linked only pipes failures. There a specific spot in BLEventHandler that handles successfully sent messages of all types and informs mautrix-imessage
Fixes https://github.com/open-imcore/barcelona/issues/39. This is how it's done on the MacOS version here.