[Change] User status
This commit is contained in:
parent
4d11dc3306
commit
2a5c0fd2cf
3 changed files with 9 additions and 6 deletions
|
|
@ -4,12 +4,15 @@ use strum_macros::EnumIter;
|
||||||
#[derive(Debug, Clone, PartialEq, EnumIter, Eq)]
|
#[derive(Debug, Clone, PartialEq, EnumIter, Eq)]
|
||||||
#[allow(unused, non_camel_case_types)]
|
#[allow(unused, non_camel_case_types)]
|
||||||
pub enum UserStatus {
|
pub enum UserStatus {
|
||||||
online,
|
|
||||||
phone_online,
|
|
||||||
away,
|
|
||||||
do_not_disturb,
|
|
||||||
user_offline,
|
user_offline,
|
||||||
|
user_online,
|
||||||
|
user_dnd,
|
||||||
|
user_idle,
|
||||||
|
user_wc,
|
||||||
|
user_borked,
|
||||||
iota_offline,
|
iota_offline,
|
||||||
|
iota_online,
|
||||||
|
iota_borked,
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
impl UserStatus {
|
impl UserStatus {
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,7 @@ impl ClientConnection {
|
||||||
async fn handle_client_changed(self: Arc<Self>, cv: CommunicationValue) {
|
async fn handle_client_changed(self: Arc<Self>, cv: CommunicationValue) {
|
||||||
let user_id = self.get_user_id().await;
|
let user_id = self.get_user_id().await;
|
||||||
if let Some(_status_str) = cv.get_data(DataTypes::user_state) {
|
if let Some(_status_str) = cv.get_data(DataTypes::user_state) {
|
||||||
let user_status = UserStatus::online;
|
let user_status = UserStatus::user_online;
|
||||||
if let Some(rho_conn) = self.get_rho_connection().await {
|
if let Some(rho_conn) = self.get_rho_connection().await {
|
||||||
OmegaConnection::client_changed(rho_conn.get_iota_id().await, user_id, user_status)
|
OmegaConnection::client_changed(rho_conn.get_iota_id().await, user_id, user_status)
|
||||||
.await;
|
.await;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ impl RhoConnection {
|
||||||
OmegaConnection::client_changed(
|
OmegaConnection::client_changed(
|
||||||
self.get_iota_id().await,
|
self.get_iota_id().await,
|
||||||
connection.get_user_id().await,
|
connection.get_user_id().await,
|
||||||
UserStatus::online,
|
UserStatus::user_online,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue