}
}
+/// The details of how you are following a user, or attempting to.
+///
+/// If the user's account is locked, then there's a third possible
+/// state, which is that you have _requested_ to follow them and they
+/// haven't yet given or refused permission. That's represented here
+/// just as 'Following', because the same API request is used to get
+/// into that state.
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Followness {
NotFollowing,
impl Followness {
pub fn from_rel(rel: &Relationship) -> Followness {
- if !rel.following {
+ if !rel.following && !rel.requested {
Followness::NotFollowing
} else {
let boosts = if rel.showing_reblogs {
let edit_status = FileStatusLine::new()
.message("Edit line and press Return")
.finalise();
+
+ let prev_follow = Followness::from_rel(&rel);
+
+ // The 'follow this user' request should be renamed 'Request
+ // to follow', if the account is locked and we're not already
+ // following it. But in both other cases (if we aren't
+ // following it but can do so unilaterally, or if we _are_ so
+ // that we can unfollow unilaterally), call it just 'follow'.
+ //
+ // The 'request' wording should therefore also show up if
+ // we've already requested to follow this user but it isn't
+ // confirmed yet.
+ let follow_wording = if ac.locked && !rel.following {
+ "Request to follow this user: "
+ } else {
+ "Follow this user: "
+ };
let cl_follow = CyclingMenuLine::new(
Pr('F'),
- ColouredString::plain("Follow this user: "),
+ ColouredString::plain(follow_wording),
&[
(false, ColouredString::plain("no")),
(true, ColouredString::uniform("yes", 'f')),
],
- rel.following,
+ prev_follow != Followness::NotFollowing,
);
+
let boosts = if rel.following {
if rel.showing_reblogs {
Boosts::Show
rel.muting,
);
- let prev_follow = Followness::from_rel(&rel);
-
let mut menu = OtherUserOptionsMenu {
title,
normal_status,