suppress false positive warnings in getStreamStatus

This commit is contained in:
tateisu 2021-02-05 09:08:58 +09:00
parent 3fbe14fa7e
commit 78adefa9bf
1 changed files with 5 additions and 18 deletions

View File

@ -150,27 +150,14 @@ class StreamManager(val appState: AppState) {
// カラムヘッダの表示更新から、インジケータを取得するために呼ばれる // カラムヘッダの表示更新から、インジケータを取得するために呼ばれる
// UIスレッドから呼ばれる // UIスレッドから呼ばれる
// returns StreamStatus.Missing if account is NA or all columns are non-streaming.
fun getStreamStatus(column: Column) :StreamStatus= fun getStreamStatus(column: Column) :StreamStatus=
when (val acctGroup =acctGroups[column.access_info.acct]) { acctGroups[column.access_info.acct]?.getStreamStatus(column.internalId)
null -> { ?: StreamStatus.Missing
if( !column.access_info.isNA){
log.w("getStreamStatus: missing acctGroup for ${column.access_info.acct}")
}
StreamStatus.Missing
}
else -> acctGroup.getStreamStatus(column.internalId)
}
// returns null if account is NA or all columns are non-streaming.
fun getConnection(column: Column) :StreamConnection? = fun getConnection(column: Column) :StreamConnection? =
when (val acctGroup =acctGroups[column.access_info.acct]) { acctGroups[column.access_info.acct]?.getConnection(column.internalId)
null -> {
if( !column.access_info.isNA) {
log.w("getConnection: missing acctGroup for ${column.access_info.acct}")
}
null
}
else -> acctGroup.getConnection(column.internalId)
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////