Removal of unused code or things that were trivial to switch to the library like db types

This commit is contained in:
shockrah
2020-11-02 00:11:15 -08:00
parent 4cb8f578ed
commit 06c81ce2f2
3 changed files with 0 additions and 61 deletions

View File

@@ -9,11 +9,6 @@ use crate::{UBigInt, BigInt, VarChar};
use crate::common::{FromDB};
macro_rules! msg_channel {
$(value:expr) => {
format!("messages_{}", value)
}
}
#[allow(dead_code)]
pub struct Message {
pub id: UBigInt,
@@ -84,20 +79,3 @@ impl FromDB<Message> for Message {
return Response::Other(no_conn!("Message::FromDB::update"))
}
}
impl Message {
async fn add(p: &Pool, author_id: UBigInt, content: VarChar, channel_id: UBigInt) -> Response<Self> {
//! Adds a user message to the given channel via channel_id
let conn = p.get_conn().await;
if conn.is_err() {
return Response::Other(no_conn!("Message::add"));
}
// generate the channel name
let fq_channel_id = msg_channel!(channel_id);
conn.prep_exec(
"INSERT INTO :table (id, time, content, author_id)",
params!{"cid" => fq_channel_id}
);
return Response::Success;
}
}