Cleanup warnings

Lots of code paths that dont exist right now. This suppresses the
warnings til I come back and finish implementing everything
This commit is contained in:
2026-05-31 14:22:42 -07:00
parent 205309eaa3
commit f1de605d19
3 changed files with 39 additions and 35 deletions
+33 -33
View File
@@ -210,7 +210,7 @@ impl Client {
// This opens up a quic connection to the remote server, serializes our message, and // This opens up a quic connection to the remote server, serializes our message, and
// processes the response. Should use a long-lived connection but for the prototype its // processes the response. Should use a long-lived connection but for the prototype its
// going to open a new one each time. // going to open a new one each time.
async fn forward(&self, server: &fedichat::ServerAddr, message: TaggedMessage) -> Result<ServerMessage,ServerError>{ async fn forward(&self, _server: &fedichat::ServerAddr, _message: TaggedMessage) -> Result<ServerMessage,ServerError>{
unimplemented!() unimplemented!()
} }
@@ -225,7 +225,7 @@ impl Client {
// NOTE: This leaks passwords. Should anonymize it for sure // NOTE: This leaks passwords. Should anonymize it for sure
trace!("Handling message: {:?}",&message); trace!("Handling message: {:?}",&message);
if let Some((ref challenge,ref saved_msg)) = self.in_challenge { if let Some((ref challenge,ref _saved_msg)) = self.in_challenge {
if let ClientMessage::ChallengeAnswer {response} = message.message { if let ClientMessage::ChallengeAnswer {response} = message.message {
// If we successfully complete the challenge then perform the given action // If we successfully complete the challenge then perform the given action
if response == *challenge { if response == *challenge {
@@ -354,13 +354,13 @@ impl Client {
}, },
// Replace the body of the message with a new one // Replace the body of the message with a new one
MessageEdit { MessageEdit {
body, body: _,
id, id: _,
room_id, room_id: _,
} => {unimplemented!()}, } => {unimplemented!()},
MessageDelete { MessageDelete {
id, id: _,
room_id, room_id: _,
} => {unimplemented!()}, } => {unimplemented!()},
// State Actions // State Actions
// These don't use the DB at all // These don't use the DB at all
@@ -404,9 +404,9 @@ impl Client {
self.run_operation(config,&room_id.into(),user,operation).await self.run_operation(config,&room_id.into(),user,operation).await
}, },
StateMove { StateMove {
room_id, room_id: _,
path, path: _,
target, target: _,
} => { } => {
// This could be a read and a write maybe? // This could be a read and a write maybe?
unimplemented!() unimplemented!()
@@ -458,54 +458,54 @@ impl Client {
// //
// Could always do this through a bot that owns a group?? // Could always do this through a bot that owns a group??
GroupCreate { GroupCreate {
group, group: _,
users, users: _,
} => {unimplemented!()}, } => {unimplemented!()},
// Only the creator of a group or a server admin can delete groups // Only the creator of a group or a server admin can delete groups
GroupDelete { GroupDelete {
group, group: _,
} => {unimplemented!()}, } => {unimplemented!()},
// Only the creator of a group or a server admin can delete groups // Only the creator of a group or a server admin can delete groups
// same with adding, though there should be a way to add group officers // same with adding, though there should be a way to add group officers
// at some point // at some point
GroupUserAdd { GroupUserAdd {
group, group: _,
users, users: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupUserRemove { GroupUserRemove {
group, group: _,
users, users: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupRoleCreate { GroupRoleCreate {
group, group: _,
role, role: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupRoleDelete { GroupRoleDelete {
group, group: _,
role, role: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupRoleUserAdd { GroupRoleUserAdd {
group, group: _,
role, role: _,
users, users: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupRoleUserRemove { GroupRoleUserRemove {
group, group: _,
role, role: _,
users, users: _,
} => {unimplemented!()}, } => {unimplemented!()},
// Should work like discord roles // Should work like discord roles
// Can control who can invite to the group // Can control who can invite to the group
// Can be used with permissions to make rooms that are private for individual roles // Can be used with permissions to make rooms that are private for individual roles
GroupRolePowerAdd { GroupRolePowerAdd {
group, group: _,
role, role: _,
power, power: _,
} => {unimplemented!()}, } => {unimplemented!()},
GroupRolePowerRemove { GroupRolePowerRemove {
group, group: _,
role, role: _,
power, power: _,
} => {unimplemented!()}, } => {unimplemented!()},
// Returns an ID to use for message sending // Returns an ID to use for message sending
// The server can potentially use the current username to associate media uploads // The server can potentially use the current username to associate media uploads
+1 -1
View File
@@ -5,7 +5,7 @@ use std::sync::Arc;
use fedichat::message::{Relevance,TaggedMessage}; use fedichat::message::{Relevance,TaggedMessage};
use diesel_async::pooled_connection::deadpool::Pool; use diesel_async::pooled_connection::deadpool::Pool;
use diesel_async::{AsyncPgConnection}; use diesel_async::{AsyncPgConnection};
use tracing::{instrument,warn,trace,debug}; use tracing::{instrument,warn,debug};
#[instrument(skip_all)] #[instrument(skip_all)]
pub async fn client_handler( pub async fn client_handler(
+5 -1
View File
@@ -1,3 +1,7 @@
// suppress warnings from unimplemented paths
// remove once actually done
#![allow(dead_code)]
mod client; mod client;
mod config; mod config;
mod connection; mod connection;
@@ -178,7 +182,7 @@ async fn main() -> ExitCode {
// Global connections // Global connections
let (close_send,close_recv) = broadcast::channel(1); let (close_send,close_recv) = broadcast::channel(1);
let (message_send,message_recv) = broadcast::channel(128); let (message_send,message_recv) = broadcast::channel(128);
let (message_ack_send,message_ack_recv) = mpsc::channel(128); let (message_ack_send,_message_ack_recv) = mpsc::channel(128);
debug!("Setting ctrl-c handler"); debug!("Setting ctrl-c handler");
match ctrlc_async::set_async_handler( match ctrlc_async::set_async_handler(