diff options
| author | Austin Hellyer <[email protected]> | 2016-11-21 19:17:57 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-21 19:17:57 -0800 |
| commit | 6b1a83111d4d9cc2ef2f4eed1ee8f58d45525078 (patch) | |
| tree | a6f0303ebcf4a474f603aaa5c8fff67409d42a17 /src/ext/voice/handler.rs | |
| parent | Add support for creating embed images (diff) | |
| download | serenity-6b1a83111d4d9cc2ef2f4eed1ee8f58d45525078.tar.xz serenity-6b1a83111d4d9cc2ef2f4eed1ee8f58d45525078.zip | |
Re-organize the client module
Re-organize the client module, creating a `gateway` submodule, and
splitting the connection into separate files in it.
The connection was a conglomeration of a number of purposes, most of
which are actually used elsewhere in the library and/or exposed to the
user. Thus, it makes sense to separate each item in a gateway-specific
module.
By splitting the client module further, this is a re-organization for
preliminary RPC support WRT the Client.
Additionally, rename the Connection struct to a Shard. The Connection
itself was not the actual connection, and was a higher-level interface
to the real connection logic. A Shard is a more accurate representation
of what it actually is.
Diffstat (limited to 'src/ext/voice/handler.rs')
| -rw-r--r-- | src/ext/voice/handler.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ext/voice/handler.rs b/src/ext/voice/handler.rs index 8dc0ab1..1f2a5d2 100644 --- a/src/ext/voice/handler.rs +++ b/src/ext/voice/handler.rs @@ -2,7 +2,7 @@ use serde_json::builder::ObjectBuilder; use std::sync::mpsc::{self, Sender}; use super::connection_info::ConnectionInfo; use super::{Status as VoiceStatus, Target}; -use ::client::ConnectionStatus; +use ::client::gateway::GatewayStatus; use ::constants::VoiceOpCode; use ::model::{ChannelId, GuildId, VoiceState}; use super::threading; @@ -39,7 +39,7 @@ pub struct Handler { sender: Sender<VoiceStatus>, session_id: Option<String>, user_id: u64, - ws: Sender<ConnectionStatus>, + ws: Sender<GatewayStatus>, } impl Handler { @@ -52,7 +52,7 @@ impl Handler { /// /// [`Manager::join`]: struct.Manager.html#method.join #[doc(hidden)] - pub fn new(target: Target, ws: Sender<ConnectionStatus>, user_id: u64) + pub fn new(target: Target, ws: Sender<GatewayStatus>, user_id: u64) -> Self { let (tx, rx) = mpsc::channel(); @@ -260,7 +260,7 @@ impl Handler { .insert("self_mute", self.self_mute)) .build(); - let _ = self.ws.send(ConnectionStatus::SendMessage(map)); + let _ = self.ws.send(GatewayStatus::SendMessage(map)); } fn send(&mut self, status: VoiceStatus) { |