diff --git a/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/model/NewDm.java b/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/model/NewDm.java index a8091071b..d497be385 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/model/NewDm.java +++ b/twidere.component.common/src/main/java/org/mariotaku/microblog/library/twitter/model/NewDm.java @@ -38,7 +38,7 @@ public class NewDm extends SimpleValueMap { } public void setRecipientIds(String[] recipientIds) { - put("conversation_ids", InternalArrayUtil.join(recipientIds, ",")); + put("recipient_ids", InternalArrayUtil.join(recipientIds, ",")); } public void setMediaId(String mediaId) { 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 2d6db9708..ed3568cf4 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 @@ -54,6 +54,7 @@ import org.mariotaku.twidere.provider.TwidereDataStore.Messages.Conversations import org.mariotaku.twidere.text.MarkForDeleteSpan import org.mariotaku.twidere.util.IntentUtils import org.mariotaku.twidere.util.view.SimpleTextWatcher +import java.lang.ref.WeakReference /** * Created by mariotaku on 2017/2/15. @@ -72,6 +73,7 @@ class MessageNewConversationFragment : BaseFragment(), LoaderCallbacks? = null var deleteAlways: List? = null - val response = try { + val sendResponse = try { val conversationId = message.conversation_id val tempConversation = message.is_temp_conversation @@ -116,6 +116,10 @@ class SendMessageTask( deleteOnSuccess?.forEach { it.delete(context) } } deleteAlways?.forEach { it.delete(context) } + val conversationId = sendResponse.entries?.firstOrNull { + it.message != null + }?.message?.conversationId + val response = microBlog.getDmConversation(conversationId, null).conversationTimeline response.fixMedia(microBlog) return GetMessagesTask.createDatabaseUpdateData(context, account, response) }