post_count: Paragraph,
followers_count: Paragraph,
following_count: Paragraph,
+ flags: Vec<Paragraph>,
relationships: Vec<Paragraph>,
blank: BlankLine,
}
.add(&ColouredString::plain(
&format!("Number of users followed: {}", ac.following_count)));
+ let mut flags = Vec::new();
+ if ac.locked {
+ flags.push(Paragraph::new()
+ .add(&ColouredString::plain("This account is "))
+ .add(&ColouredString::uniform("locked", 'r'))
+ .add(&ColouredString::plain(
+ " (you can't follow it without its permission).")));
+ }
+ if ac.suspended.unwrap_or(false) {
+ flags.push(Paragraph::new().add(
+ &ColouredString::uniform(
+ "This account is suspended.", 'r')));
+ }
+ if ac.limited.unwrap_or(false) {
+ flags.push(Paragraph::new().add(
+ &ColouredString::uniform(
+ "This account is silenced.", 'r')));
+ }
+ if ac.bot {
+ flags.push(Paragraph::new().add(
+ &ColouredString::plain(
+ "This account identifies as a bot.")));
+ }
+ if ac.group {
+ flags.push(Paragraph::new().add(
+ &ColouredString::plain(
+ "This account identifies as a group.")));
+ }
+ if let Some(moved_to) = ac.moved {
+ flags.push(Paragraph::new()
+ .add(&ColouredString::uniform(
+ "This account has moved to:", 'r'))
+ .add(&ColouredString::plain(
+ &format!(" {}", client.fq(&moved_to.acct)))));
+ }
+
let mut relationships = Vec::new();
if ac.id == client.our_account_id() {
relationships.push(Paragraph::new().set_indent(2, 2).add(
post_count,
followers_count,
following_count,
+ flags,
relationships,
blank: BlankLine::new(),
})
push_fragment(&mut lines, self.blank.render(width));
}
- // FIXME: flags
+ if !self.flags.is_empty() {
+ for para in &self.flags {
+ push_fragment(&mut lines, para.render(width));
+ }
+ push_fragment(&mut lines, self.blank.render(width));
+ }
if !self.relationships.is_empty() {
for para in &self.relationships {