add: user status
This commit is contained in:
parent
1724f798ca
commit
a009ef9e34
10 changed files with 259 additions and 138 deletions
|
@ -165,13 +165,13 @@ impl DataManager {
|
|||
// post event
|
||||
let mut con = self.2.get_con().await;
|
||||
|
||||
if let Err(e) = con.publish::<usize, String, ()>(
|
||||
if let Err(e) = con.publish::<String, String, ()>(
|
||||
if channel.community != 0 {
|
||||
// broadcast to community ws
|
||||
channel.community
|
||||
format!("chats/{}", channel.community)
|
||||
} else {
|
||||
// broadcast to channel ws
|
||||
channel.id
|
||||
format!("chats/{}", channel.id)
|
||||
},
|
||||
serde_json::to_string(&SocketMessage {
|
||||
method: SocketMethod::Message,
|
||||
|
@ -224,13 +224,13 @@ impl DataManager {
|
|||
// post event
|
||||
let mut con = self.2.get_con().await;
|
||||
|
||||
if let Err(e) = con.publish::<usize, String, ()>(
|
||||
if let Err(e) = con.publish::<String, String, ()>(
|
||||
if channel.community != 0 {
|
||||
// broadcast to community ws
|
||||
channel.community
|
||||
format!("chats/{}", channel.community)
|
||||
} else {
|
||||
// broadcast to channel ws
|
||||
channel.id
|
||||
format!("chats/{}", channel.id)
|
||||
},
|
||||
serde_json::to_string(&SocketMessage {
|
||||
method: SocketMethod::Delete,
|
||||
|
|
|
@ -200,6 +200,9 @@ pub struct UserSettings {
|
|||
/// If other users that you aren't following can add you to chats.
|
||||
#[serde(default)]
|
||||
pub private_chats: bool,
|
||||
/// The user's status. Shows over connection info.
|
||||
#[serde(default)]
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
impl Default for User {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue