A cheap attempt at a native Bluesky client for Android

Models: refactor to select reply to not following the right way

+15 -17
+15 -17
app/src/main/java/industries/geesawra/monarch/datalayer/Models.kt
··· 117 117 follower = post.post.author.viewer?.followedBy != null, 118 118 ) 119 119 120 - sd.replyToNotFollowing = { 121 - when (sd.reason) { 122 - is FeedViewPostReasonUnion.ReasonPin -> false 123 - is FeedViewPostReasonUnion.ReasonRepost -> false 124 - is FeedViewPostReasonUnion.Unknown -> false 125 - else -> { 126 - val (parent, _) = sd.parent() 127 - val root = sd.root() 128 - 129 - parent?.let { 130 - val parentFollowing = parent.following 131 - val rootFollowing = root?.following ?: false 120 + sd.replyToNotFollowing = when (sd.reason) { 121 + is FeedViewPostReasonUnion.ReasonPin -> false 122 + is FeedViewPostReasonUnion.ReasonRepost -> false 123 + is FeedViewPostReasonUnion.Unknown -> false 124 + else -> { 125 + val (parent, _) = sd.parent() 126 + val root = sd.root() 132 127 133 - val res = parentFollowing || rootFollowing 134 - !res 135 - } 128 + parent?.let { 129 + val parentFollowing = parent.following 130 + val rootFollowing = root?.following ?: false 136 131 137 - false 132 + val res = parentFollowing || rootFollowing 133 + !res 138 134 } 135 + 136 + false 139 137 } 140 - }() 138 + } 141 139 142 140 return sd 143 141 }