Skip to content

Commit c2649cc

Browse files
committed
予約投稿の再編集時に添付メディアを引き継げる。ただしサーバが mastodon/mastodon#9894 を適用済であること。
1 parent 760f072 commit c2649cc

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

  • app/src/main/java/jp/juggler/subwaytooter

app/src/main/java/jp/juggler/subwaytooter/ActPost.kt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ class ActPost : AppCompatActivity(),
594594
// 自己レス以外なら元レスへのメンションを追加
595595
// 最初に追加する https://github.com/tateisu/SubwayTooter/issues/94
596596
if(! account.isMe(reply_status.account)) {
597-
mention_list.add( "@${account.getFullAcct(reply_status.account)}")
597+
mention_list.add("@${account.getFullAcct(reply_status.account)}")
598598
}
599599

600600
// 元レスに含まれていたメンションを複製
@@ -610,7 +610,7 @@ class ActPost : AppCompatActivity(),
610610
mention_list.add(strMention)
611611
}
612612

613-
if(mention_list.isNotEmpty()){
613+
if(mention_list.isNotEmpty()) {
614614
appendContentText(
615615
StringBuilder().apply {
616616
for(acct in mention_list) {
@@ -767,24 +767,24 @@ class ActPost : AppCompatActivity(),
767767
visibility = item.visibility
768768

769769
// 2019/1/7 どうも添付データを古い投稿から引き継げないようだ…。
770-
// バグ臭い
771-
// val src_attachments = item.media_attachments
772-
// if(src_attachments?.isNotEmpty() == true) {
773-
// app_state.attachment_list = this.attachment_list
774-
// this.attachment_list.clear()
775-
// try {
776-
// for(src in src_attachments) {
777-
// if(src is TootAttachment) {
778-
// src.redraft = true
779-
// val pa = PostAttachment(src)
780-
// pa.status = PostAttachment.STATUS_UPLOADED
781-
// this.attachment_list.add(pa)
782-
// }
783-
// }
784-
// } catch(ex : Throwable) {
785-
// log.trace(ex)
786-
// }
787-
// }
770+
// 2019/1/22 https://github.com/tootsuite/mastodon/pull/9894 で直った。
771+
val src_attachments = item.media_attachments
772+
if(src_attachments?.isNotEmpty() == true) {
773+
app_state.attachment_list = this.attachment_list
774+
this.attachment_list.clear()
775+
try {
776+
for(src in src_attachments) {
777+
if(src is TootAttachment) {
778+
src.redraft = true
779+
val pa = PostAttachment(src)
780+
pa.status = PostAttachment.STATUS_UPLOADED
781+
this.attachment_list.add(pa)
782+
}
783+
}
784+
} catch(ex : Throwable) {
785+
log.trace(ex)
786+
}
787+
}
788788
}
789789
} catch(ex : Throwable) {
790790
log.trace(ex)
@@ -1173,9 +1173,9 @@ class ActPost : AppCompatActivity(),
11731173
} else {
11741174
btnAccount.setBackgroundResource(R.drawable.btn_bg_transparent)
11751175
}
1176-
1177-
btnAccount.textColor = ac.color_fg .notZero()
1178-
?: getAttributeColor(this,android.R.attr.textColorPrimary)
1176+
1177+
btnAccount.textColor = ac.color_fg.notZero()
1178+
?: getAttributeColor(this, android.R.attr.textColorPrimary)
11791179
}
11801180
updateTextCount()
11811181
}

0 commit comments

Comments
 (0)