mirror of
https://git.alemi.dev/mumble-stats-api.git
synced 2024-11-22 16:04:49 +01:00
fix: don't overwrite name with empty str
This commit is contained in:
parent
332f9a5809
commit
45bddfe067
1 changed files with 3 additions and 3 deletions
|
@ -67,9 +67,9 @@ impl User {
|
||||||
pub fn update(&mut self, state: crate::tcp::proto::UserState) {
|
pub fn update(&mut self, state: crate::tcp::proto::UserState) {
|
||||||
if state.session() != self.session { tracing::warn!("updating with different session??") }
|
if state.session() != self.session { tracing::warn!("updating with different session??") }
|
||||||
if let Some(actor) = state.actor { self.actor = actor }
|
if let Some(actor) = state.actor { self.actor = actor }
|
||||||
if let Some(name) = state.name { self.name = name }
|
if let Some(name) = state.name { if !name.is_empty() { self.name = name } }
|
||||||
if let Some(user_id) = state.user_id { self.user_id = Some(user_id) }
|
if let Some(user_id) = state.user_id { if user_id != 0 { self.user_id = Some(user_id) } }
|
||||||
if let Some(comment) = state.comment { self.comment = Some(comment) }
|
if let Some(comment) = state.comment { if !comment.is_empty() { self.comment = Some(comment) } }
|
||||||
if let Some(mute) = state.mute { self.properties.mute = mute }
|
if let Some(mute) = state.mute { self.properties.mute = mute }
|
||||||
if let Some(deaf) = state.deaf { self.properties.deaf = deaf }
|
if let Some(deaf) = state.deaf { self.properties.deaf = deaf }
|
||||||
if let Some(suppress) = state.suppress { self.properties.suppress = suppress }
|
if let Some(suppress) = state.suppress { self.properties.suppress = suppress }
|
||||||
|
|
Loading…
Reference in a new issue