Skip to content

Commit

Permalink
Fix a payload decode
Browse files Browse the repository at this point in the history
Resume doesn't have a heartbeat_interval, so don't try to decode it.
  • Loading branch information
Austin Hellyer committed Jan 9, 2017
1 parent 26f5c1a commit c2e8b69
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 1 addition & 6 deletions src/client/gateway/shard.rs
Expand Up @@ -494,13 +494,8 @@ impl Shard {
let _ = self.keepalive_channel.send(GatewayStatus::SendMessage(msg));
}

#[allow(unused_variables)]
fn handle_dispatch(&mut self, event: &Event) {
if let Event::Resumed(ref ev) = *event {
let status = GatewayStatus::Interval(ev.heartbeat_interval);

let _ = self.keepalive_channel.send(status);
}

#[cfg(feature="voice")]
{
if let Event::VoiceStateUpdate(ref update) = *event {
Expand Down
2 changes: 0 additions & 2 deletions src/model/event.rs
Expand Up @@ -720,7 +720,6 @@ impl RelationshipRemoveEvent {

#[derive(Clone, Debug)]
pub struct ResumedEvent {
pub heartbeat_interval: u64,
pub trace: Vec<Option<String>>,
}

Expand All @@ -729,7 +728,6 @@ impl ResumedEvent {
#[inline]
pub fn decode(mut map: Map) -> Result<Self> {
Ok(ResumedEvent {
heartbeat_interval: req!(remove(&mut map, "heartbeat_interval")?.as_u64()),
trace: remove(&mut map, "_trace").and_then(|v| decode_array(v, |v| Ok(into_string(v).ok())))?,
})
}
Expand Down

0 comments on commit c2e8b69

Please sign in to comment.