message-chat-update
This commit is contained in:
parent
3fff0f77ee
commit
77420289be
|
@ -122,7 +122,10 @@ pub async fn is_fitting(
|
||||||
// TODO: check all authors subscribers
|
// TODO: check all authors subscribers
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else if message_data.entity == "chat" {
|
} else if message_data.entity == "chat" {
|
||||||
// payload is Message or Chat
|
// payload is Chat
|
||||||
|
Ok(true)
|
||||||
|
} else if message_data.entity == "message" {
|
||||||
|
// payload is Message
|
||||||
Ok(true)
|
Ok(true)
|
||||||
} else if message_data.entity == "follower" {
|
} else if message_data.entity == "follower" {
|
||||||
// payload is Author
|
// payload is Author
|
||||||
|
|
|
@ -86,8 +86,13 @@ async fn connect_handler(
|
||||||
pubsub.subscribe("reaction").await.unwrap();
|
pubsub.subscribe("reaction").await.unwrap();
|
||||||
println!("'reaction' pubsub subscribed");
|
println!("'reaction' pubsub subscribed");
|
||||||
|
|
||||||
|
// chats by member_id
|
||||||
|
pubsub.subscribe(format!("chat:{}", listener_id)).await.unwrap();
|
||||||
|
println!("'chat:{}' pubsub subscribed", listener_id);
|
||||||
|
|
||||||
|
// messages by chat_id
|
||||||
for chat_id in &chats {
|
for chat_id in &chats {
|
||||||
let channel_name = format!("chat:{}", chat_id);
|
let channel_name = format!("message:{}", chat_id);
|
||||||
pubsub.subscribe(&channel_name).await.unwrap();
|
pubsub.subscribe(&channel_name).await.unwrap();
|
||||||
println!("'{}' subscribed", channel_name);
|
println!("'{}' subscribed", channel_name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user