Switch types to match DB

This commit is contained in:
2024-07-27 13:40:49 -04:00
Unverified
parent daeb5180fa
commit 7fb6dd1715
2 changed files with 7 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ pub struct RealmChatServer {
pub server_id: String,
pub socket: SocketAddr,
pub db_pool: Pool<Sqlite>,
pub typing_users: Vec<(u32, u32)> //NOTE: userid, roomid
pub typing_users: Vec<(i64, i64)> //NOTE: userid, roomid
} //TODO: Cache for auth
impl RealmChat for RealmChatServer {
@@ -77,7 +77,7 @@ impl RealmChat for RealmChatServer {
todo!()
}
async fn get_message_from_id(self, _: Context, auth_token: String, id: u32) -> Result<Message, ErrorCode> {
async fn get_message_from_id(self, _: Context, auth_token: String, id: i64) -> Result<Message, ErrorCode> {
//TODO: Auth for admin room
let result = sqlx::query("SELECT message.*,
room.id AS 'room_id', room.roomid AS 'room_roomid', room.name AS 'room_name', room.admin_only_send AS 'room_admin_only_send', room.admin_only_view AS 'room_admin_only_view',

View File

@@ -18,7 +18,7 @@ pub trait RealmChat {
async fn keep_typing(auth_token: String) -> ErrorCode; //NOTE: If a keep alive hasn't been received in 5 seconds, stop typing
//NOTE: Any user can call, if they are in the server
async fn get_message_from_id(auth_token: String, id: u32) -> Result<Message, ErrorCode>;
async fn get_message_from_id(auth_token: String, id: i64) -> Result<Message, ErrorCode>;
async fn get_messages_since(auth_token: String, time: DateTime<Utc>) -> Result<Vec<Message>, ErrorCode>;
async fn get_rooms(auth_token: String) -> Result<Vec<Room>, ErrorCode>;
async fn get_room(auth_token: String, roomid: String) -> Result<Room, ErrorCode>;
@@ -106,25 +106,25 @@ pub struct Attachment {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Reply {
pub referencing_id: u32,
pub referencing_id: i64,
pub text: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Edit {
pub referencing_id: u32,
pub referencing_id: i64,
pub text: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Reaction {
pub referencing_id: u32,
pub referencing_id: i64,
pub emoji: String
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Redaction {
pub referencing_id: u32,
pub referencing_id: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize, FromRow)]