mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-08-04 10:12:37 +02:00
Merge remote-tracking branch 'origin/HEAD'
This commit is contained in:
@@ -636,6 +636,18 @@ fun NoteDropDownMenu(note: Note, popupExpanded: Boolean, onDismiss: () -> Unit,
|
|||||||
expanded = popupExpanded,
|
expanded = popupExpanded,
|
||||||
onDismissRequest = onDismiss
|
onDismissRequest = onDismiss
|
||||||
) {
|
) {
|
||||||
|
if (note.author != accountViewModel.accountLiveData.value?.account?.userProfile() && !accountViewModel.accountLiveData.value?.account?.userProfile()
|
||||||
|
!!.isFollowing(note.author!!)) {
|
||||||
|
|
||||||
|
DropdownMenuItem(onClick = {
|
||||||
|
accountViewModel.follow(
|
||||||
|
note.author ?: return@DropdownMenuItem
|
||||||
|
); onDismiss()
|
||||||
|
}) {
|
||||||
|
Text(stringResource(R.string.follow))
|
||||||
|
}
|
||||||
|
Divider()
|
||||||
|
}
|
||||||
DropdownMenuItem(onClick = { clipboardManager.setText(AnnotatedString(accountViewModel.decrypt(note) ?: "")); onDismiss() }) {
|
DropdownMenuItem(onClick = { clipboardManager.setText(AnnotatedString(accountViewModel.decrypt(note) ?: "")); onDismiss() }) {
|
||||||
Text(stringResource(R.string.copy_text))
|
Text(stringResource(R.string.copy_text))
|
||||||
}
|
}
|
||||||
|
@@ -113,7 +113,9 @@ class AccountViewModel(private val account: Account): ViewModel() {
|
|||||||
account.prefer(source, target, preference)
|
account.prefer(source, target, preference)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun follow(user: User) {
|
||||||
|
account.follow(user)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user