From: Simon Tatham Date: Sat, 3 Feb 2024 10:27:58 +0000 (+0000) Subject: Fix display of pending follow requests. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=1e9355bcb2a5baef8ab993e696dd98833651892f;p=mastodonochrome.git Fix display of pending follow requests. I had misunderstood the Mastodon docs' description of Relationship::requested, which said "Do you have a pending follow request for this user?". It turns out that means _you_ have requested to follow _them_, not the other way round. The other way round is also represented in this record, as the 'requested_by' field (mirroring followed and followed_by). Apparently it's been in the server code for over a year, but accidentally left out of the documentation until last month. --- diff --git a/src/text.rs b/src/text.rs index b978c80..bf6824f 100644 --- a/src/text.rs +++ b/src/text.rs @@ -3113,6 +3113,14 @@ impl ExamineUserDisplay { )); } if rs.requested { + relationships.push(Paragraph::new().set_indent(2, 2).add( + &ColouredString::uniform( + "You have requested to follow this user", + 'r', + ), + )); + } + if rs.requested_by { relationships.push(Paragraph::new().set_indent(2, 2).add( &ColouredString::uniform( "This user has requested to follow you!", diff --git a/src/types.rs b/src/types.rs index e3b653a..d11e5b7 100644 --- a/src/types.rs +++ b/src/types.rs @@ -416,6 +416,7 @@ pub struct Relationship { pub muting: bool, pub muting_notifications: bool, pub requested: bool, + pub requested_by: bool, pub domain_blocking: bool, pub endorsed: bool, pub note: String,