Compare commits
3 Commits
9b6b5a8af0
...
d5e2527927
Author | SHA1 | Date | |
---|---|---|---|
d5e2527927 | |||
e419039481 | |||
59ead0abad |
1191
Cargo.lock
generated
1191
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -5,3 +5,4 @@ members = [
|
||||||
"http-json",
|
"http-json",
|
||||||
"collectd-stats",
|
"collectd-stats",
|
||||||
]
|
]
|
||||||
|
resolver = "2"
|
||||||
|
|
55
flake.lock
55
flake.lock
|
@ -8,11 +8,11 @@
|
||||||
"rust-analyzer-src": "rust-analyzer-src"
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678083931,
|
"lastModified": 1695363721,
|
||||||
"narHash": "sha256-RO45RWYuIAej5+0x+NHzrkGJ/9p5/gUGMKFX+lSlJ2I=",
|
"narHash": "sha256-+VRVzXpWdSsZPcR2Cg9Q5LKhUQDVvoQFfH4V8iKNAkU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "fenix",
|
"repo": "fenix",
|
||||||
"rev": "51c621ea8f64dafb9d3ce6c98718ca9fee1e05bb",
|
"rev": "cb59ad177b991978ff571388bf8df6fed32e6bc2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -28,11 +28,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671096816,
|
"lastModified": 1694081375,
|
||||||
"narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=",
|
"narHash": "sha256-vzJXOUnmkMCm3xw8yfPP5m8kypQ3BhAIRe4RRCWpzy8=",
|
||||||
"owner": "nmattia",
|
"owner": "nmattia",
|
||||||
"repo": "naersk",
|
"repo": "naersk",
|
||||||
"rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114",
|
"rev": "3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -43,12 +43,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678086707,
|
"lastModified": 1693844670,
|
||||||
"narHash": "sha256-y1uXdxzinIne4FW3TF7DCtxEB9gAbQ4qnbpYzhvkFm8=",
|
"narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=",
|
||||||
"owner": "NixOS",
|
"path": "/nix/store/z5r8imp4q5wjfl58d064rwm20cym02c0-source",
|
||||||
"repo": "nixpkgs",
|
"rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1",
|
||||||
"rev": "21eda9bc80bef824a037582b1e5a43ba74e92daa",
|
"type": "path"
|
||||||
"type": "github"
|
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
|
@ -66,11 +65,11 @@
|
||||||
"rust-analyzer-src": {
|
"rust-analyzer-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678033668,
|
"lastModified": 1695220688,
|
||||||
"narHash": "sha256-Njlus+vY3N++qWE0JXrGjwcXY2QDFuOV/7NruBBMETY=",
|
"narHash": "sha256-T54aKrnKMI7Cg2mid5h46mWAXd0xc0pYn0fju3dwXf0=",
|
||||||
"owner": "rust-lang",
|
"owner": "rust-lang",
|
||||||
"repo": "rust-analyzer",
|
"repo": "rust-analyzer",
|
||||||
"rev": "0a956ec9326eca09725d64d9f1b63896f93505d1",
|
"rev": "d6fef2c7e3be2783369b4b84e320b163b8fd291a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -80,13 +79,31 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"utils": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1676283394,
|
"lastModified": 1681028828,
|
||||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1694529238,
|
||||||
|
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -75,7 +75,7 @@ impl State {
|
||||||
}
|
}
|
||||||
|
|
||||||
let pos = entry.position()?;
|
let pos = entry.position()?;
|
||||||
let coord = geo::Coordinate { x: pos.longitude, y: pos.latitude };
|
let coord = geo::Coord { x: pos.longitude, y: pos.latitude };
|
||||||
if let Some(old_pos) = self.position.replace(pos.clone()) {
|
if let Some(old_pos) = self.position.replace(pos.clone()) {
|
||||||
if old_pos.longitude != pos.longitude || old_pos.latitude != pos.latitude {
|
if old_pos.longitude != pos.longitude || old_pos.latitude != pos.latitude {
|
||||||
let location = locations.find(&coord);
|
let location = locations.find(&coord);
|
||||||
|
|
|
@ -28,11 +28,11 @@ pub async fn run(jid: String, password: String, muc_jid: String) -> Handle {
|
||||||
};
|
};
|
||||||
let (tx, mut rx) = mpsc::channel(1);
|
let (tx, mut rx) = mpsc::channel(1);
|
||||||
let handle = Handle {
|
let handle = Handle {
|
||||||
room_jid: muc_jid.clone().into(),
|
room_jid: muc_jid.to_bare(),
|
||||||
tx: tx.clone(),
|
tx: tx.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut client = AsyncClient::new(&jid, &password).unwrap();
|
let mut client = AsyncClient::new(Jid::new(&jid).unwrap(), &password);
|
||||||
loop {
|
loop {
|
||||||
match client.next().await {
|
match client.next().await {
|
||||||
Some(Event::Online { .. }) => {
|
Some(Event::Online { .. }) => {
|
||||||
|
|
|
@ -24,7 +24,7 @@ impl Location {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn contains(&self, coord: &geo::Coordinate<f64>) -> bool {
|
pub fn contains(&self, coord: &geo::Coord<f64>) -> bool {
|
||||||
self.poly.contains(coord)
|
self.poly.contains(coord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ impl Locations {
|
||||||
.as_f64().expect("lon f64");
|
.as_f64().expect("lon f64");
|
||||||
let lat = el.get("lat").expect("lat")
|
let lat = el.get("lat").expect("lat")
|
||||||
.as_f64().expect("lat f64");
|
.as_f64().expect("lat f64");
|
||||||
let coord = geo::Coordinate { x: lon, y: lat };
|
let coord = geo::Coord { x: lon, y: lat };
|
||||||
nodes.insert(id, coord);
|
nodes.insert(id, coord);
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -168,7 +168,7 @@ impl Locations {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find(&self, coord: &geo::Coordinate<f64>) -> Option<Arc<String>> {
|
pub fn find(&self, coord: &geo::Coord<f64>) -> Option<Arc<String>> {
|
||||||
for l in &self.locations {
|
for l in &self.locations {
|
||||||
if l.contains(coord) {
|
if l.contains(coord) {
|
||||||
return Some(l.name.clone());
|
return Some(l.name.clone());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user