(Misskey)投稿画面の最大文字数を3000にする

This commit is contained in:
tateisu 2018-12-03 08:14:54 +09:00
parent 0ae936ed70
commit 788933cb11
1 changed files with 38 additions and 33 deletions

View File

@ -977,17 +977,22 @@ class ActPost : AppCompatActivity(), View.OnClickListener, PostAttachment.Callba
private var lastInstanceTask : TootTaskRunner? = null
private fun getMaxCharCount() : Int {
val account = account
if(account != null
&& ! account.isPseudo
&& ! account.isMisskey
) {
when{
account == null || account.isPseudo -> {}
account.isMisskey ->return 3000
else->{
val info = account.instance
var lastTask = lastInstanceTask
// 情報がないか古いなら再取得
if(info == null || System.currentTimeMillis() - info.time_parse >= 300000L) {
// 同時に実行するタスクは1つまで
var lastTask = lastInstanceTask
if(lastTask?.isActive != true) {
lastTask = TootTaskRunner(this, TootTaskRunner.PROGRESS_NONE)
lastInstanceTask = lastTask
@ -1008,11 +1013,11 @@ class ActPost : AppCompatActivity(), View.OnClickListener, PostAttachment.Callba
}
}
})
// fall thru
}
}
if(info != null) {
val max = info.max_toot_chars
val max = info?.max_toot_chars
if(max != null && max > 0) return max
}
}