mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-25 09:41:00 +00:00
Fix composition mention population
This commit is contained in:
parent
ee4c7bafdb
commit
65b95e1510
2 changed files with 13 additions and 1 deletions
|
@ -65,7 +65,17 @@ public final class NewStatusViewModel: ObservableObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let inReplyTo = inReplyTo, redraft == nil {
|
if let inReplyTo = inReplyTo, redraft == nil {
|
||||||
compositionViewModel.text = inReplyTo.accountName.appending(" ")
|
var mentions = Set<String>()
|
||||||
|
|
||||||
|
if !inReplyTo.isMine {
|
||||||
|
mentions.insert(inReplyTo.accountName)
|
||||||
|
}
|
||||||
|
|
||||||
|
mentions.formUnion(inReplyTo.mentions.map(\.acct)
|
||||||
|
.filter { $0 != identityContext.identity.account?.username }
|
||||||
|
.map("@".appending))
|
||||||
|
|
||||||
|
compositionViewModel.text = mentions.joined(separator: " ").appending(" ")
|
||||||
}
|
}
|
||||||
|
|
||||||
compositionViewModels = [compositionViewModel]
|
compositionViewModels = [compositionViewModel]
|
||||||
|
|
|
@ -108,6 +108,8 @@ public extension StatusViewModel {
|
||||||
return URL(string: website)
|
return URL(string: website)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mentions: [Mention] { statusService.status.displayStatus.mentions }
|
||||||
|
|
||||||
var visibility: Status.Visibility { statusService.status.displayStatus.visibility }
|
var visibility: Status.Visibility { statusService.status.displayStatus.visibility }
|
||||||
|
|
||||||
var repliesCount: Int { statusService.status.displayStatus.repliesCount }
|
var repliesCount: Int { statusService.status.displayStatus.repliesCount }
|
||||||
|
|
Loading…
Reference in a new issue