Most of auth checking done

TODO: reddit voting, get_messages_since, typing indicators, reddit algorithims for threads, thread fetching
This commit is contained in:
2024-07-30 23:42:04 -04:00
Unverified
parent 7fb6dd1715
commit 38ca7cb26b
4 changed files with 202 additions and 99 deletions

View File

@@ -12,16 +12,16 @@ pub trait RealmChat {
async fn test(name: String) -> String;
//TODO: Any user authorized as themselves
async fn send_message(auth_token: String, message: Message) -> Result<Message, ErrorCode>;
async fn start_typing(auth_token: String) -> ErrorCode;
async fn stop_typing(auth_token: String) -> ErrorCode;
async fn keep_typing(auth_token: String) -> ErrorCode; //NOTE: If a keep alive hasn't been received in 5 seconds, stop typing
async fn send_message(stoken: String, message: Message) -> Result<Message, ErrorCode>;
async fn start_typing(stoken: String, userid: String, roomid: String) -> ErrorCode;
async fn stop_typing(stoken: String, userid: String, roomid: String) -> ErrorCode;
async fn keep_typing(stoken: String, userid: String, roomid: 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: 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>;
async fn get_message_from_id(stoken: String, id: i64) -> Result<Message, ErrorCode>;
async fn get_messages_since(stoken: String, time: DateTime<Utc>) -> Result<Vec<Message>, ErrorCode>;
async fn get_rooms(stoken: String) -> Result<Vec<Room>, ErrorCode>;
async fn get_room(stoken: String, roomid: String) -> Result<Room, ErrorCode>;
async fn get_user(userid: String) -> Result<User, ErrorCode>;
async fn get_users() -> Result<Vec<User>, ErrorCode>;
async fn get_online_users() -> Result<Vec<User>, ErrorCode>;