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

iMessages sent via AppleScript cannot be received in "Business Chats" – consider implementing conditional Private API send #184

Closed rollingonchrome closed 4 months ago

rollingonchrome commented 4 months ago

iMessages sent using the BlueBubbles connector appear to send via AppleScript. This causes those messages to fail to send in Business Chats and generates the following example error in the BlueBubbles server.

Potentially add a conditional to send via Private API under certain circumstances.

Error message:

Command failed: osascript -e "tell application \"Messages\"" -e "set targetService to 1st account whose service type = iMessage" -e "set targetBuddy to participant \"urn:biz:b15ed773-9eed-11e7-baa2-7b88b04daa8e\" of targetService" -e "send \"[MESSAGE CONTENTS]\" to targetBuddy" -e "end tell" 186:225: execution error: Messages got an error: Can’t get participant id "20CCA093-0FE3-45E2-803E-4FF471175B25:urn:biz:b15ed773-9eed-11e7-baa2-7b88b04daa8e". (-1728)

trek-boldly-go commented 4 months ago

Several other send methods are already using this conditional, like the SendFile: https://github.com/mautrix/imessage/blob/25aaae37d11db8c77ef77693e84ae6ecc847e1f8/imessage/bluebubbles/api.go#L979C1-L985C3

The conditional in the SendMessage just needs updated to match the others: https://github.com/mautrix/imessage/blob/25aaae37d11db8c77ef77693e84ae6ecc847e1f8/imessage/bluebubbles/api.go#L918C1-L924C3

trek-boldly-go commented 4 months ago

Closed with #189

dltacube commented 4 months ago

Fixed by this https://github.com/mautrix/imessage/commit/590dcb04864248a2fab79d0285f8fb50dfe78b16#diff-add0e027970853876947ede515fd2419541057010ed0cfb334f30219fcd9979fR976