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:
+33
-33
@@ -210,7 +210,7 @@ impl Client {
|
||||
// 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
|
||||
// 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!()
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ impl Client {
|
||||
// NOTE: This leaks passwords. Should anonymize it for sure
|
||||
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 we successfully complete the challenge then perform the given action
|
||||
if response == *challenge {
|
||||
@@ -354,13 +354,13 @@ impl Client {
|
||||
},
|
||||
// Replace the body of the message with a new one
|
||||
MessageEdit {
|
||||
body,
|
||||
id,
|
||||
room_id,
|
||||
body: _,
|
||||
id: _,
|
||||
room_id: _,
|
||||
} => {unimplemented!()},
|
||||
MessageDelete {
|
||||
id,
|
||||
room_id,
|
||||
id: _,
|
||||
room_id: _,
|
||||
} => {unimplemented!()},
|
||||
// State Actions
|
||||
// These don't use the DB at all
|
||||
@@ -404,9 +404,9 @@ impl Client {
|
||||
self.run_operation(config,&room_id.into(),user,operation).await
|
||||
},
|
||||
StateMove {
|
||||
room_id,
|
||||
path,
|
||||
target,
|
||||
room_id: _,
|
||||
path: _,
|
||||
target: _,
|
||||
} => {
|
||||
// This could be a read and a write maybe?
|
||||
unimplemented!()
|
||||
@@ -458,54 +458,54 @@ impl Client {
|
||||
//
|
||||
// Could always do this through a bot that owns a group??
|
||||
GroupCreate {
|
||||
group,
|
||||
users,
|
||||
group: _,
|
||||
users: _,
|
||||
} => {unimplemented!()},
|
||||
// Only the creator of a group or a server admin can delete groups
|
||||
GroupDelete {
|
||||
group,
|
||||
group: _,
|
||||
} => {unimplemented!()},
|
||||
// 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
|
||||
// at some point
|
||||
GroupUserAdd {
|
||||
group,
|
||||
users,
|
||||
group: _,
|
||||
users: _,
|
||||
} => {unimplemented!()},
|
||||
GroupUserRemove {
|
||||
group,
|
||||
users,
|
||||
group: _,
|
||||
users: _,
|
||||
} => {unimplemented!()},
|
||||
GroupRoleCreate {
|
||||
group,
|
||||
role,
|
||||
group: _,
|
||||
role: _,
|
||||
} => {unimplemented!()},
|
||||
GroupRoleDelete {
|
||||
group,
|
||||
role,
|
||||
group: _,
|
||||
role: _,
|
||||
} => {unimplemented!()},
|
||||
GroupRoleUserAdd {
|
||||
group,
|
||||
role,
|
||||
users,
|
||||
group: _,
|
||||
role: _,
|
||||
users: _,
|
||||
} => {unimplemented!()},
|
||||
GroupRoleUserRemove {
|
||||
group,
|
||||
role,
|
||||
users,
|
||||
group: _,
|
||||
role: _,
|
||||
users: _,
|
||||
} => {unimplemented!()},
|
||||
// Should work like discord roles
|
||||
// Can control who can invite to the group
|
||||
// Can be used with permissions to make rooms that are private for individual roles
|
||||
GroupRolePowerAdd {
|
||||
group,
|
||||
role,
|
||||
power,
|
||||
group: _,
|
||||
role: _,
|
||||
power: _,
|
||||
} => {unimplemented!()},
|
||||
GroupRolePowerRemove {
|
||||
group,
|
||||
role,
|
||||
power,
|
||||
group: _,
|
||||
role: _,
|
||||
power: _,
|
||||
} => {unimplemented!()},
|
||||
// Returns an ID to use for message sending
|
||||
// The server can potentially use the current username to associate media uploads
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ use std::sync::Arc;
|
||||
use fedichat::message::{Relevance,TaggedMessage};
|
||||
use diesel_async::pooled_connection::deadpool::Pool;
|
||||
use diesel_async::{AsyncPgConnection};
|
||||
use tracing::{instrument,warn,trace,debug};
|
||||
use tracing::{instrument,warn,debug};
|
||||
|
||||
#[instrument(skip_all)]
|
||||
pub async fn client_handler(
|
||||
|
||||
+5
-1
@@ -1,3 +1,7 @@
|
||||
// suppress warnings from unimplemented paths
|
||||
// remove once actually done
|
||||
#![allow(dead_code)]
|
||||
|
||||
mod client;
|
||||
mod config;
|
||||
mod connection;
|
||||
@@ -178,7 +182,7 @@ async fn main() -> ExitCode {
|
||||
// Global connections
|
||||
let (close_send,close_recv) = broadcast::channel(1);
|
||||
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");
|
||||
match ctrlc_async::set_async_handler(
|
||||
|
||||
Reference in New Issue
Block a user