diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 65d97113e..1d7e5ecdd 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -29,6 +29,7 @@ Micro-blogging service: - [ ] Twitter - [ ] Fanfou - [ ] GNU Social / StatusNet +- [ ] Mastodon App settings: diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/IntentConstants.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/IntentConstants.java index 690dbf5d9..fa023a7fd 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/IntentConstants.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/constant/IntentConstants.java @@ -126,6 +126,7 @@ public interface IntentConstants { String EXTRA_IS_PUBLIC = "is_public"; String EXTRA_USER = "user"; String EXTRA_USERS = "users"; + String EXTRA_OPEN_CONVERSATION = "open_conversation"; String EXTRA_ITEMS = "items"; String EXTRA_USER_LIST = "user_list"; String EXTRA_USER_LISTS = "user_lists"; diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt index 1cc484926..73b7a27a5 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/UserFragment.kt @@ -924,6 +924,7 @@ class UserFragment : BaseFragment(), OnClickListener, OnLinkClickListener, intent.putExtra(EXTRA_ACCOUNT, AccountUtils.getAccountDetails(am, user.account_key, true)) intent.putExtra(EXTRA_USERS, arrayOf(user)) + intent.putExtra(EXTRA_OPEN_CONVERSATION, true) startActivity(intent) } R.id.set_color -> { diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/message/MessageNewConversationFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/message/MessageNewConversationFragment.kt index 10429e99f..0e03fc76d 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/message/MessageNewConversationFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/message/MessageNewConversationFragment.kt @@ -189,9 +189,12 @@ class MessageNewConversationFragment : BaseFragment(), LoaderCallbacks(EXTRA_USERS) - if (users != null) { + if (users != null && users.isNotEmpty()) { selectedRecipients = users.toList() editParticipants.setSelection(editParticipants.length()) + if (arguments.getBoolean(EXTRA_OPEN_CONVERSATION)) { + createOrOpenConversation() + } } } } @@ -227,14 +230,14 @@ class MessageNewConversationFragment : BaseFragment(), LoaderCallbacks { - createConversation() + createOrOpenConversation() return true } } return super.onOptionsItemSelected(item) } - private fun createConversation() { + private fun createOrOpenConversation() { val account = this.account ?: return val selected = this.selectedRecipients if (selected.isEmpty()) return