.
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m40s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m50s
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m40s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m50s
This commit is contained in:
@@ -138,16 +138,36 @@ impl RelayAuth {
|
||||
let mut notifications = client.notifications();
|
||||
|
||||
while let Some(notification) = notifications.next().await {
|
||||
if let ClientNotification::Message {
|
||||
message: RelayMessage::Auth { challenge },
|
||||
relay_url,
|
||||
} = notification
|
||||
{
|
||||
let request = AuthRequest::new(challenge, relay_url);
|
||||
match notification {
|
||||
ClientNotification::Message { relay_url, message } => {
|
||||
match message {
|
||||
RelayMessage::Auth { challenge } => {
|
||||
let request = AuthRequest::new(challenge, relay_url);
|
||||
|
||||
if let Err(e) = tx.send_async(request).await {
|
||||
log::error!("Failed to send auth request: {}", e);
|
||||
if let Err(e) = tx.send_async(request).await {
|
||||
log::error!("Failed to send auth request: {}", e);
|
||||
}
|
||||
}
|
||||
RelayMessage::Ok {
|
||||
event_id, message, ..
|
||||
} => {
|
||||
let msg = MachineReadablePrefix::parse(&message);
|
||||
let mut tracker = tracker().write().await;
|
||||
|
||||
// Handle authentication messages
|
||||
if let Some(MachineReadablePrefix::AuthRequired) = msg {
|
||||
// Keep track of events that need to be resent after authentication
|
||||
tracker.add_to_pending(event_id, relay_url);
|
||||
} else {
|
||||
// Keep track of events sent by Coop
|
||||
tracker.sent(event_id)
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
ClientNotification::Shutdown => break,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user