Rewild Your Web
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: apply some clippy suggestions

Signed-off-by: webbeef <me@webbeef.org>

webbeef 50995206 99ff4c93

+53 -64
+6 -12
crates/beaver_p2p/src/lib.rs
··· 337 337 } 338 338 339 339 info!("Send failed on cached connection to {to}, retrying with fresh connection"); 340 - inner 341 - .state 342 - .lock() 343 - .await 344 - .by_id_mut(to) 345 - .map(|r| r.clear_connection()); 340 + if let Some(r) = inner.state.lock().await.by_id_mut(to) { 341 + r.clear_connection() 342 + } 346 343 347 344 let connection = self.get_or_connect(inner, to, &addr).await?; 348 345 Self::try_send(&connection, message).await ··· 367 364 .connect(addr.clone(), MESSAGE_ALPN) 368 365 .await?; 369 366 370 - inner 371 - .state 372 - .lock() 373 - .await 374 - .by_id_mut(to) 375 - .map(|r| r.set_connection(conn.clone())); 367 + if let Some(r) = inner.state.lock().await.by_id_mut(to) { 368 + r.set_connection(conn.clone()) 369 + } 376 370 377 371 Ok(conn) 378 372 }
+16 -19
crates/beaver_p2p/src/message_protocol.rs
··· 32 32 ); 33 33 34 34 // Accept uni streams — each incoming message arrives on its own stream. 35 - loop { 36 - match connection.accept_uni().await { 37 - Ok(mut receiver) => match BasePacket::recv(&mut receiver).await { 38 - Ok(payload) => { 39 - debug!( 40 - "[P2P MSG] received {} bytes from {:?}", 41 - payload.len(), 42 - remote_id 43 - ); 44 - self.state 45 - .lock() 46 - .await 47 - .notify(PeerEvent::Message(remote_id, payload)); 48 - }, 49 - Err(err) => { 50 - error!("Error reading message packet: {err}"); 51 - break; 52 - }, 35 + while let Ok(mut receiver) = connection.accept_uni().await { 36 + match BasePacket::recv(&mut receiver).await { 37 + Ok(payload) => { 38 + debug!( 39 + "[P2P MSG] received {} bytes from {:?}", 40 + payload.len(), 41 + remote_id 42 + ); 43 + self.state 44 + .lock() 45 + .await 46 + .notify(PeerEvent::Message(remote_id, payload)); 47 + }, 48 + Err(err) => { 49 + error!("Error reading message packet: {err}"); 50 + break; 53 51 }, 54 - Err(_) => break, 55 52 } 56 53 } 57 54
+9 -9
crates/beaver_p2p/src/state.rs
··· 241 241 let addr = endpoint_info.to_endpoint_addr(); 242 242 243 243 // If this peer was previously paired and disconnected, reconnect it. 244 - if let Some(existing) = self.endpoints.get_mut(&endpoint_info.endpoint_id) { 245 - if existing.status == EndpointStatus::PairedDisconnected { 246 - existing.status = EndpointStatus::PairedConnected; 247 - existing.addr = addr; 248 - existing.name = name.to_owned(); 249 - // Fire PairingAccepted so JS gets "peerjoined" (not "peerdiscovered"). 250 - self.notify(PeerEvent::PairingAccepted(endpoint_info.endpoint_id)); 251 - return; 252 - } 244 + if let Some(existing) = self.endpoints.get_mut(&endpoint_info.endpoint_id) && 245 + existing.status == EndpointStatus::PairedDisconnected 246 + { 247 + existing.status = EndpointStatus::PairedConnected; 248 + existing.addr = addr; 249 + existing.name = name.to_owned(); 250 + // Fire PairingAccepted so JS gets "peerjoined" (not "peerdiscovered"). 251 + self.notify(PeerEvent::PairingAccepted(endpoint_info.endpoint_id)); 252 + return; 253 253 } 254 254 255 255 // Add it as Discovered and notify the listener.
+1 -1
forkme.lock
··· 1 - 399c8ebe312b8775517663dbecff43789918ab86 1 + efe01668ea16b9ec4fe361dcf8029c06a1a45da5
+1 -1
patches/Cargo.lock.patch
··· 78 78 + 79 79 +[[package]] 80 80 name = "cc" 81 - version = "1.2.57" 81 + version = "1.2.58" 82 82 source = "registry+https://github.com/rust-lang/crates.io-index" 83 83 @@ -1269,6 +1321,20 @@ 84 84 ]
+1 -1
patches/components/constellation/constellation.rs.patch
··· 984 984 + webview_id: new_webview_id, 985 985 + opener: None, 986 986 + load_data, 987 - + viewport_details: viewport_details, 987 + + viewport_details, 988 988 + user_content_manager_id, 989 989 + theme, 990 990 + is_embedded_webview: true,
+1 -1
patches/components/net/http_loader.rs.patch
··· 86 86 + pub fn register_webtile(&self, subject: &str, rkey: &str, json: &[u8]) { 87 87 + if let Some(tile) = WebTile::from_tile_manifest(subject, rkey, json) { 88 88 + if let Some(config_dir) = &self.config_dir { 89 - + tile.write_to(&config_dir); 89 + + tile.write_to(config_dir); 90 90 + } 91 91 + println!( 92 92 + "Registered tile, url will be tile://{}.{}/",
+9 -11
patches/components/net/protocols/atproto/protocol.rs.patch
··· 1 1 --- original 2 2 +++ modified 3 - @@ -0,0 +1,235 @@ 3 + @@ -0,0 +1,233 @@ 4 4 +// SPDX-License-Identifier: AGPL-3.0-or-later 5 5 + 6 6 +use std::future::{self, Future}; ··· 158 158 + }, 159 159 + }; 160 160 + let response = maybe_bad_request(&url, reason, response); 161 - + if is_web_tile { 162 - + if response.status == StatusCode::OK { 163 - + let body = response.body.lock(); 164 - + if let ResponseBody::Done(ref json) = *body { 165 - + context2 166 - + .state 167 - + .register_webtile(&subject, &rkey.unwrap(), &json); 168 - + } else { 169 - + error!("Unable to get webtile manifest!"); 170 - + } 161 + + if is_web_tile && response.status == StatusCode::OK { 162 + + let body = response.body.lock(); 163 + + if let ResponseBody::Done(ref json) = *body { 164 + + context2 165 + + .state 166 + + .register_webtile(&subject, rkey.unwrap(), json); 167 + + } else { 168 + + error!("Unable to get webtile manifest!"); 171 169 + } 172 170 + } 173 171 + response
+9 -9
patches/components/script/dom/window.rs.patch
··· 9 9 }; 10 10 use euclid::default::Rect as UntypedRect; 11 11 use euclid::{Point2D, Rect, Scale, Size2D, Vector2D}; 12 - @@ -1148,12 +1148,22 @@ 12 + @@ -1145,12 +1145,22 @@ 13 13 14 14 let (sender, receiver) = 15 15 ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); ··· 33 33 receiver.recv().unwrap_or_else(|_| { 34 34 // If the receiver is closed, we assume the dialog was cancelled. 35 35 debug!("Alert dialog was cancelled or failed to show."); 36 - @@ -1181,13 +1191,22 @@ 36 + @@ -1178,13 +1188,22 @@ 37 37 // the user to respond with a positive or negative response. 38 38 let (sender, receiver) = 39 39 ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); ··· 57 57 // Step 5: Let userPromptHandler be WebDriver BiDi user prompt opened with this, 58 58 // "confirm", and message. 59 59 // 60 - @@ -1232,6 +1251,7 @@ 60 + @@ -1229,6 +1248,7 @@ 61 61 // defaulted to the value given by default. 62 62 let (sender, receiver) = 63 63 ProfiledGenericChannel::channel(self.global().time_profiler_chan().clone()).unwrap(); ··· 65 65 let dialog = SimpleDialogRequest::Prompt { 66 66 id: self.Document().embedder_controls().next_control_id(), 67 67 message: message.to_string(), 68 - @@ -1238,8 +1258,16 @@ 68 + @@ -1235,8 +1255,16 @@ 69 69 default: default.to_string(), 70 70 response_sender: sender, 71 71 }; ··· 83 83 // Step 6: Let userPromptHandler be WebDriver BiDi user prompt opened with this, 84 84 // "prompt", and message. 85 85 // TODO: Add support for WebDriver BiDi. 86 - @@ -1672,6 +1700,9 @@ 86 + @@ -1669,6 +1697,9 @@ 87 87 // https://html.spec.whatwg.org/multipage/#windoweventhandlers 88 88 window_event_handlers!(); 89 89 ··· 93 93 /// <https://developer.mozilla.org/en-US/docs/Web/API/Window/screen> 94 94 fn Screen(&self, can_gc: CanGc) -> DomRoot<Screen> { 95 95 self.screen.or_init(|| Screen::new(self, can_gc)) 96 - @@ -3043,9 +3074,33 @@ 96 + @@ -3040,9 +3071,33 @@ 97 97 &self, 98 98 input_event: &ConstellationInputEvent, 99 99 ) -> Option<HitTestResult> { ··· 130 130 } 131 131 132 132 #[expect(unsafe_code)] 133 - @@ -3064,8 +3119,25 @@ 133 + @@ -3061,8 +3116,25 @@ 134 134 // SAFETY: This is safe because `Window::query_elements_from_point` has ensured that 135 135 // layout has run and any OpaqueNodes that no longer refer to real nodes are gone. 136 136 let address = UntrustedNodeAddress(result.node.0 as *const c_void); ··· 157 157 cursor: result.cursor, 158 158 point_in_node: result.point_in_target, 159 159 point_in_frame, 160 - @@ -3612,6 +3684,8 @@ 160 + @@ -3605,6 +3677,8 @@ 161 161 player_context: WindowGLContext, 162 162 #[cfg(feature = "webgpu")] gpu_id_hub: Arc<IdentityHub>, 163 163 inherited_secure_context: Option<bool>, ··· 166 166 theme: Theme, 167 167 weak_script_thread: Weak<ScriptThread>, 168 168 ) -> DomRoot<Self> { 169 - @@ -3638,6 +3712,8 @@ 169 + @@ -3631,6 +3705,8 @@ 170 170 gpu_id_hub, 171 171 inherited_secure_context, 172 172 unminify_js,