fix joining a normal mailto:-qr-code

This commit is contained in:
B. Petersen 2018-12-24 02:00:08 +01:00
parent 8fa32cc4f7
commit 28ace84c32
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC

View file

@ -118,12 +118,10 @@ public class QrScanHandler implements DcEventCenter.DcEventDelegate {
@StringRes int resId = qrParsed.getState() == DcContext.DC_QR_ADDR ? R.string.ask_start_chat_with : R.string.qrscan_ask_chatting_fingerprint_ok; @StringRes int resId = qrParsed.getState() == DcContext.DC_QR_ADDR ? R.string.ask_start_chat_with : R.string.qrscan_ask_chatting_fingerprint_ok;
builder.setMessage(Html.fromHtml(String.format(activity.getString(resId, nameAndAddress)))); builder.setMessage(Html.fromHtml(String.format(activity.getString(resId, nameAndAddress))));
builder.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> { builder.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {
Bundle bundle = new Bundle(); int chatId = dcContext.createChatByContactId(qrParsed.getId());
bundle.putInt(ConversationActivity.THREAD_ID_EXTRA, dcContext.createChatByContactId(qrParsed.getId()));
Intent intent = new Intent(activity, ConversationActivity.class); Intent intent = new Intent(activity, ConversationActivity.class);
//TODO how to we get the contact ID here? We need it to avoid crashing when starting the ConversationActivity intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, chatId);
// probably solved by changing the type of the Thread_id_extra from long to int everywhere. activity.startActivity(intent);
activity.startActivity(intent, bundle);
}); });
builder.setNegativeButton(android.R.string.cancel, null); builder.setNegativeButton(android.R.string.cancel, null);
} }