Activity::Util(x) => {
self.overlay = None;
self.util = Some(x);
- },
+ }
Activity::NonUtil(x) => {
self.util = None;
self.overlay = None;
};
self.nonutil.truncate(trunc);
self.nonutil.push(y);
- },
+ }
}
- },
+ }
Activity::Overlay(x) => {
self.util = self.initial_util.clone();
self.overlay = Some(x);
- },
+ }
}
}
_ => match self.nonutil.last() {
Some(y) => Activity::NonUtil(y.clone()),
_ => Activity::NonUtil(NonUtilityActivity::MainMenu),
- },
+ }
}
}
match self {
AuthError::Nonexistent(_) => {
write!(f, "not logged in")
- },
+ }
AuthError::Bad(ref msg) => {
write!(f, "unable to read authentication: {}", msg)
- },
+ }
}
}
}
Ok(st) => Ok(st),
Err(e) => {
Err(ClientError::UrlError(url.clone(), e.to_string()))
- },
+ }
}
}?;
if st.id != id {
Ok(st) => Ok(st),
Err(e) => {
Err(ClientError::UrlError(url.clone(), e.to_string()))
- },
+ }
}
}?;
if not.id != id {
FeedId::Home => Req::get("timelines/home"),
FeedId::Local => {
Req::get("timelines/public").param("local", true)
- },
+ }
FeedId::Public => {
Req::get("timelines/public").param("local", false)
- },
+ }
FeedId::Hashtag(ref tag) => {
Req::get(&format!("timelines/tag/{}", &tag))
- },
+ }
FeedId::User(id, boosts, replies) => {
Req::get(&format!("accounts/{}/statuses", id))
.param("exclude_reblogs", *boosts == Boosts::Hide)
.param("exclude_replies", *replies == Replies::Hide)
- },
+ }
FeedId::Mentions => {
Req::get("notifications").param("types[]", "mention")
- },
+ }
FeedId::Ego => {
Req::get("notifications")
.param("types[]", "reblog")
.param("types[]", "follow")
.param("types[]", "favourite")
- },
+ }
};
let req = match ext {
Ok(sts) => Ok(sts),
Err(e) => {
Err(ClientError::UrlError(url.clone(), e.to_string()))
- },
+ }
}?;
for st in &sts {
self.cache_status(st);
}
sts.iter().rev().map(|st| st.id.clone()).collect()
- },
+ }
FeedId::Mentions | FeedId::Ego => {
let mut nots: Vec<Notification> = match serde_json::from_str(
&body) {
Ok(nots) => Ok(nots),
Err(e) => {
Err(ClientError::UrlError(url.clone(), e.to_string()))
- },
+ }
}?;
match id {
not.ntype == NotificationType::Mention &&
not.status.is_some()
});
- },
+ }
FeedId::Ego => {
nots.retain(|not| {
not.ntype == NotificationType::Reblog ||
not.ntype == NotificationType::Follow ||
not.ntype == NotificationType::Favourite
});
- },
+ }
_ => panic!("outer match passed us {:?}", id),
}
for not in ¬s {
self.cache_notification(not);
}
nots.iter().rev().map(|not| not.id.clone()).collect()
- },
+ }
};
let any_new = !ids.is_empty();
ids: ids,
origin: 0,
});
- },
+ }
FeedExtend::Future => {
let feed = self.feeds.get_mut(id).unwrap();
for id in ids.iter() {
feed.ids.push_back(id.to_string());
}
- },
+ }
FeedExtend::Past => {
let feed = self.feeds.get_mut(id).unwrap();
for id in ids.iter().rev() {
feed.ids.push_front(id.to_string());
feed.origin -= 1;
}
- },
+ }
}
Ok(any_new)
updates.insert(id.clone());
}
}
- },
+ }
// FIXME: we probably _should_ handle EOF from the
// subthread, though I'm not quite sure how yet. Stream
} else {
None
}
- },
+ }
(Some((_, tc)), Some(_)) => {
let mut tpos: usize = 0;
let mut cpos: usize = 0;
match (textit.next(), colourit.next()) {
(None, None) => {
break (textslice.len(), colourslice.len());
- },
+ }
(Some((ti, tc)), Some((ci, _))) => {
tpos = ti;
cpos = ci;
last_tc = tc;
- },
+ }
_ => panic!("length mismatch in CSSI"),
};
};
text: &textslice[..textend],
colour: &colourslice[..colourend],
})
- },
+ }
_ => panic!("length mismatch in CSSI"),
}
}
{
match self {
#[cfg(unix)]
- ConfigError::XDG(e) => { e.fmt(f) },
+ ConfigError::XDG(e) => { e.fmt(f) }
#[cfg(windows)]
ConfigError::Env(e) => {
// FIXME: how _should_ we include the information
// about what environment variable?
write!(f, "%APPDATA%: {}", e)
- },
+ }
}
}
}
end += 1;
}
Some((width, end - pos))
- },
+ }
}
}
Some((w, b)) => {
head += b;
currwidth += w;
- },
+ }
}
} else {
match self.core.char_width_and_bytes(tail) {
counted_initial_trunc_marker = true;
avail_width = avail_width.saturating_sub(1);
}
- },
+ }
}
}
}
match &mut self.contents.extender {
Some(ref mut ext) => {
ext.set_primed(at_top);
- },
+ }
_ => (),
};
if let Some(ei) = self.contents.extender_index() {
Up => {
self.move_up(1);
LogicalAction::Nothing
- },
+ }
Pr('-') | Pr('b') | Pr('B') | PgUp | Left => {
self.move_up(max(1, h - min(h, 3)));
LogicalAction::Nothing
- },
+ }
Down => {
self.move_down(1);
LogicalAction::Nothing
- },
+ }
Return => {
let oldpos = self.pos;
self.move_down(1);
} else {
LogicalAction::Nothing
}
- },
+ }
Space | PgDn | Right => {
self.move_down(max(1, h - min(h, 3)));
LogicalAction::Nothing
- },
+ }
Pr('0') | Home => {
if self.at_top() && self.contents.extender.is_some() {
let action = match self.contents.source.try_extend(client) {
self.contents.update_items(client);
LogicalAction::Nothing
- },
+ }
Err(e) => LogicalAction::Error(e),
};
self.ensure_enough_rendered();
None => ' ',
};
cs.push_str(&ColouredString::uniform(&ts.s, c).slice());
- },
+ }
_ => (),
}
}
None => break Some((ms, me)),
Some(_) => start = ms + 1,
}
- },
+ }
};
}
}
suffix = &display_pre +
ColouredString::uniform(&datestr, 'D') +
&display_post + suffix;
- },
+ }
_ => (),
}
if self.boosted {
Html::Rt(ref rt) => html::render(rt, width - min(width, 1)),
Html::Bad(e) => vec! {
ColouredString::uniform(e, '!'),
- },
+ }
}
}
}
.collect();
trim_para_list(&mut paras);
paras
- },
+ }
};
Media {
)),
};
Some(InReplyToLine::new(parent_text))
- },
+ }
};
let content = Html::new(&st.content);
Some(OurKey::Pr(' ')) => Some(OurKey::Space),
other => other,
}
- },
+ }
_ => None,
};
if let Some(main) = main {
ourkey, &mut self.client) {
PhysicalAction::Beep => {
Self::beep()?
- },
+ }
PhysicalAction::Exit => {
break 'outer Ok(());
- },
+ }
PhysicalAction::Error(err) => {
break 'outer Err(err);
- },
+ }
PhysicalAction::Nothing => (),
}
}
}
- },
+ }
_ => (),
}
- },
+ }
Ok(SubthreadEvent::StreamEv(update)) => {
match self.client.process_stream_update(update) {
Ok(feeds_updated) => {
&mut self.client) {
PhysicalAction::Beep => {
Self::beep()?
- },
+ }
PhysicalAction::Exit => {
break 'outer Ok(());
- },
+ }
PhysicalAction::Error(err) => {
break 'outer Err(err);
- },
+ }
PhysicalAction::Nothing => (),
}
- },
+ }
// FIXME: errors here should go in the Error Log
_ => (),
self.activity_stack.goto(activity);
self.changed_activity(client);
PhysicalAction::Nothing
- },
+ }
LogicalAction::Pop => {
self.activity_stack.pop();
self.changed_activity(client);
PhysicalAction::Nothing
- },
+ }
LogicalAction::PopOverlaySilent => {
self.pop_overlay_activity();
PhysicalAction::Nothing
- },
+ }
LogicalAction::PopOverlayBeep => {
self.pop_overlay_activity();
PhysicalAction::Beep
- },
+ }
LogicalAction::Error(_) => PhysicalAction::Beep, // FIXME: Error Log
}
}