WhisperSystems/TextSecure — pull request #1605 by phenx-de (2014-06-13 16:00:04+00:00)
Title: "Send SMS" in context menu still sends data message when an attachment is present

I noticed the following behaviour:

When an image (or something else) is attached, the context menu options still show
"send unencrypted SMS"
"send encrypted SMS"
but using either one still sends a TS data message including the attachment.

I think either those buttons should not be shown after an attachment was added or they should produce some kind of error message, telling the user that he should remove the attachment.

Attached is a quick implementation for the second version.

This error continues somewhere deeper, because the forceSms parameter from ConversationActivity:sendMessage:1073 was forwarded to ConversationActivity:sendMediaMessage:1097 and then to MessageSender:send:56 and then to MmsDatabase:insertMessageOutbox:575 and then to... actually I lost track there, but I don't have a good understanding of the transport mechanisms working there.

I think someone more experienced should have a look why the forceSms parameter ultimatively still doesn't prevent the message from being sent as a data message / mms, maybe @moxie0 ?

There still needs to be a user notification, so I think this pull request is fine anyways. Alternatively, fixing the bug somewhere else and just removing the buttons when an attachment is added would be fine for me as well.