chiark / gitweb /
Fix display of pending follow requests.
authorSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 10:27:58 +0000 (10:27 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Feb 2024 10:27:58 +0000 (10:27 +0000)
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.

src/text.rs
src/types.rs

index b978c8003432702c97bdf88f7f0ba3acadf4ff42..bf6824f81aa870ee67a61733422b9b5e048d2a1f 100644 (file)
@@ -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!",
index e3b653a1138a1b77ecd987dba2e735c34ac4f9c8..d11e5b70c837c327b7919f5bfd31feba4b86c2ba 100644 (file)
@@ -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,