xmpp: Replace unimplemented! and panic! with info! calls

It's great for debugging for fast-paced implementations but the codebase
has been more or less the same for years now (in a state we don't
exactly like, but it is what it is) and this is hindering things more
than helping.

Keep it at the INFO level nonetheless to make it more or less obvious
these things are not implemented.

Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
pep 2026-01-15 13:19:34 +01:00
commit 22292c86cc
No known key found for this signature in database
GPG key ID: DEDA74AEECA9D0F2
5 changed files with 13 additions and 8 deletions

View file

@ -28,6 +28,8 @@ XXXX-YY-ZZ [ RELEASER <admin@localhost> ]
Please refer to the crate docs for details. (!581)
- Allow joining an already joined room with `Agent::join_room` to enable
resyncs. Adds a parameter to `muc::room::JoinRoomSettings`.
* Changed:
- Replaced unimplemented! with info! calls.
* Added:
- Agent::send_room_message takes RoomMessageSettings argument (!483)
- Agent::send_raw_message takes RawMessageSettings for any message type (!487)

View file

@ -48,6 +48,6 @@ pub async fn handle_disco_info_result(agent: &mut Agent, disco: DiscoInfoResult,
let _ = agent.client.send_stanza(iq).await;
}
} else {
unimplemented!("Ignored disco#info response from {}", from);
info!("Ignored disco#info response from {}", from);
}
}

View file

@ -49,7 +49,7 @@ pub async fn handle_iq_result(
}
}
Err(e) => {
panic!("Wrong XEP-0048 v1.0 Bookmark format: {}", e);
info!("Wrong XEP-0048 v1.0 Bookmark format: {}", e);
}
}
} else if payload.is("query", ns::DISCO_INFO) {
@ -58,7 +58,7 @@ pub async fn handle_iq_result(
disco::handle_disco_info_result(agent, disco, from).await;
}
Err(e) => match e {
_ => panic!("Wrong disco#info format: {}", e),
_ => info!("Wrong disco#info format: {}", e),
},
}
}

View file

@ -58,7 +58,10 @@ pub async fn handle_presence(agent: &mut Agent, presence: Presence) -> Vec<Event
}
events.push(Event::RoomLeft(from.clone()));
}
_ => unimplemented!("Presence type {:?}", presence.type_), // TODO: What to do here?
_ => debug!(
"Unhandled self-presence with type {:?} from {:?}",
presence.type_, from
),
}
}
}

View file

@ -86,7 +86,7 @@ pub(crate) async fn handle_event(
error!("No published or retracted item in pubsub event!");
}
}
ref node => unimplemented!("node {}", node),
ref node => info!("Unhandled PubSub node {}", node),
}
}
Ok(pubsub::Event {
@ -95,12 +95,12 @@ pub(crate) async fn handle_event(
ref node if node == ns::BOOKMARKS2 => {
warn!("The bookmarks2 PEP node was deleted!");
}
ref node => unimplemented!("node {}", node),
ref node => info!("Unhandled PubSub node {}", node),
},
Err(e) => {
error!("Error parsing PubSub event: {}", e);
}
_ => unimplemented!("PubSub event: {:#?}", event),
_ => info!("Unhandled PubSub event: {:#?}", event),
}
events
}
@ -176,7 +176,7 @@ pub(crate) async fn handle_iq_result(
}
}
}
_ => unimplemented!(),
ref node => info!("Unhandled PubSub node: {}", node),
}
}
events