diff options
Diffstat (limited to 'client-native-lib')
-rw-r--r-- | client-native-lib/Cargo.toml | 2 | ||||
-rw-r--r-- | client-native-lib/src/peer.rs | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/client-native-lib/Cargo.toml b/client-native-lib/Cargo.toml index 617bdb7..70ad7b8 100644 --- a/client-native-lib/Cargo.toml +++ b/client-native-lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "client-native-lib" +name = "libkeks" version = "0.2.3" edition = "2021" diff --git a/client-native-lib/src/peer.rs b/client-native-lib/src/peer.rs index f3b6586..353de20 100644 --- a/client-native-lib/src/peer.rs +++ b/client-native-lib/src/peer.rs @@ -27,6 +27,7 @@ pub struct Peer { pub inst: Arc<Instance>, pub peer_connection: RTCPeerConnection, pub remote_provided: RwLock<HashMap<String, ProvideInfo>>, + pub username: RwLock<Option<String>>, pub id: usize, } @@ -63,6 +64,7 @@ impl Peer { remote_provided: Default::default(), inst: inst.clone(), peer_connection, + username: Default::default(), id, }); peer.peer_connection @@ -199,7 +201,8 @@ impl Peer { } RelayMessage::Chat(_) => (), RelayMessage::Identify { username } => { - info!("peer {} is known as {username:?}", self.id) + info!("peer {} is known as {username:?}", self.id); + *self.username.write().await = Some(username); } RelayMessage::Request { id } => { if let Some(res) = self.inst.local_resources.read().await.get(&id) { |