mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-08 07:48:45 +01:00
improved twitter reply exclude reply ids
This commit is contained in:
parent
b728d8744e
commit
97fb5708f2
@ -147,11 +147,18 @@ class UpdateStatusTask(
|
|||||||
if (update.draft_action != Draft.Action.REPLY) return
|
if (update.draft_action != Draft.Action.REPLY) return
|
||||||
val inReplyTo = update.in_reply_to_status ?: return
|
val inReplyTo = update.in_reply_to_status ?: return
|
||||||
for (i in 0 until pending.length) {
|
for (i in 0 until pending.length) {
|
||||||
if (update.accounts[i].type != AccountType.TWITTER) continue
|
val details = update.accounts[i]
|
||||||
val (_, replyText, _, excludedMentions, replyToOriginalUser) =
|
if (details.type != AccountType.TWITTER) continue
|
||||||
|
val (_, replyText, extraMentions, excludedMentions, replyToOriginalUser) =
|
||||||
extractor.extractReplyTextAndMentions(pending.overrideTexts[i], inReplyTo)
|
extractor.extractReplyTextAndMentions(pending.overrideTexts[i], inReplyTo)
|
||||||
pending.overrideTexts[i] = replyText
|
pending.overrideTexts[i] = replyText
|
||||||
pending.excludeReplyUserIds[i] = excludedMentions.map { it.key.id }.toTypedArray()
|
pending.excludeReplyUserIds[i] = excludedMentions.mapNotNull { mention ->
|
||||||
|
// Remove account mention that is not appeared in `extraMentions`
|
||||||
|
if (details.key == mention.key && extraMentions.none {
|
||||||
|
it.value.equals(mention.screen_name, ignoreCase = true)
|
||||||
|
}) return@mapNotNull null
|
||||||
|
return@mapNotNull mention.key.id
|
||||||
|
}.toTypedArray()
|
||||||
pending.replyToOriginalUser[i] = replyToOriginalUser
|
pending.replyToOriginalUser[i] = replyToOriginalUser
|
||||||
// Fix status to at least make mentioned user know what status it is
|
// Fix status to at least make mentioned user know what status it is
|
||||||
if (!replyToOriginalUser && update.attachment_url == null) {
|
if (!replyToOriginalUser && update.attachment_url == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user