mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-01-23 13:30:17 +01:00
make dm conversation directly when create from user profile
This commit is contained in:
parent
04254f433d
commit
e7f0008d6c
@ -29,6 +29,7 @@ Micro-blogging service:
|
||||
- [ ] Twitter
|
||||
- [ ] Fanfou
|
||||
- [ ] GNU Social / StatusNet
|
||||
- [ ] Mastodon
|
||||
|
||||
App settings:
|
||||
|
||||
|
@ -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";
|
||||
|
@ -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 -> {
|
||||
|
@ -189,9 +189,12 @@ class MessageNewConversationFragment : BaseFragment(), LoaderCallbacks<List<Parc
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
val users = arguments.getNullableTypedArray<ParcelableUser>(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<List<Parc
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.create_conversation -> {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user