Chore: Adapt #60, #64 in line with other breaking changes.

This commit undoes #64 (and bumps the library MSRV accordingly), and modifies #60 to match the new `Call` connection handling.

This was tested using `cargo make ready`, and rustc v1.49.0 on `examples/serenity/voice`.
This commit is contained in:
Kyle Simpson
2021-04-11 10:32:45 +01:00
parent af2347c128
commit 0bb2572deb
3 changed files with 8 additions and 15 deletions

View File

@@ -279,15 +279,15 @@ impl Call {
}
}
/// Returns `id` of the channel, if connected to any.
/// Returns `id` of the channel, if connected or connecting to any.
///
/// **Note:**: Returned `id` is of the channel, to which bot performed connection.
/// It is possible that it is different from actual channel due to ability of server's admin to
/// move bot from channel to channel. This is to be fixed with next breaking change release.
/// This remains set after a connection failure, to allow for reconnection
/// as needed. This will change if moved into another voice channel by an
/// admin, and will be unset if kicked from a voice channel.
#[instrument(skip(self))]
pub fn current_channel(&self) -> Option<ChannelId> {
match &self.connection {
Some((id, _, _)) => Some(*id),
Some((progress, _)) => Some(progress.channel_id()),
_ => None,
}
}