|
@@ -62,6 +62,10 @@ const EVGRDB_PATH: &str = "~/.local/darkfi/darkwallet/evgr/";
|
|
|
const ENDPOINT: &str = "tcp://agorism.dev:5588";
|
|
const ENDPOINT: &str = "tcp://agorism.dev:5588";
|
|
|
const CHANNEL: &str = "#random";
|
|
const CHANNEL: &str = "#random";
|
|
|
|
|
|
|
|
|
|
+/// Due to drift between different machine's clocks, if the message timestamp is recent
|
|
|
|
|
+/// then we will just correct it to the current time so messages appear sequential in the UI.
|
|
|
|
|
+const RECENT_TIME_DIST: u64 = 10;
|
|
|
|
|
+
|
|
|
#[derive(Clone, Debug, SerialEncodable, SerialDecodable)]
|
|
#[derive(Clone, Debug, SerialEncodable, SerialDecodable)]
|
|
|
pub struct Privmsg {
|
|
pub struct Privmsg {
|
|
|
pub channel: String,
|
|
pub channel: String,
|
|
@@ -320,6 +324,12 @@ impl LocalDarkIRC {
|
|
|
return Ok(())
|
|
return Ok(())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // This is a hack to make messages appear sequentially in the UI
|
|
|
|
|
+ let now_timest = UNIX_EPOCH.elapsed().unwrap().as_millis() as u64;
|
|
|
|
|
+ if timest.abs_diff(now_timest) < RECENT_TIME_DIST {
|
|
|
|
|
+ timest = now_timest;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
let mut arg_data = vec![];
|
|
let mut arg_data = vec![];
|
|
|
timest.encode_async(&mut arg_data).await.unwrap();
|
|
timest.encode_async(&mut arg_data).await.unwrap();
|
|
|
ev.id().as_bytes().encode_async(&mut arg_data).await.unwrap();
|
|
ev.id().as_bytes().encode_async(&mut arg_data).await.unwrap();
|