only send chat clear after a msg
This commit is contained in:
parent
ff48288ae2
commit
d1866a4fda
@ -1,4 +1,6 @@
|
|||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
use std::thread::{spawn, sleep};
|
||||||
|
use std::time;
|
||||||
|
|
||||||
// Db Commons
|
// Db Commons
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
@ -314,6 +316,12 @@ impl Events {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.chat = Some((instance, msg));
|
c.chat = Some((instance, msg));
|
||||||
|
|
||||||
|
let events_tx = self.tx.clone();
|
||||||
|
spawn(move || {
|
||||||
|
sleep(time::Duration::from_secs(3));
|
||||||
|
events_tx.send(Event::ChatClear(id, instance)).unwrap();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// now collect all listeners of this instance
|
// now collect all listeners of this instance
|
||||||
|
|||||||
@ -179,13 +179,6 @@ impl Connection {
|
|||||||
return Err(err_msg("invalid chat index"));
|
return Err(err_msg("invalid chat index"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let events_tx = self.events.clone();
|
|
||||||
let id = self.id;
|
|
||||||
spawn(move || {
|
|
||||||
sleep(time::Duration::from_secs(3));
|
|
||||||
events_tx.send(Event::ChatClear(id, instance_id)).unwrap();
|
|
||||||
});
|
|
||||||
|
|
||||||
Ok(RpcMessage::Processing(()))
|
Ok(RpcMessage::Processing(()))
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user