Browse Source

Add user pronouns to message body, fixup changelog

main
Erin Nova 3 months ago
parent
commit
da51a37b49
Signed by: erin GPG Key ID: DA70E064A8C70F44
  1. 18
      CHANGELOG.md
  2. 38
      Cargo.lock
  3. 2
      Cargo.toml
  4. 1
      src/chat.rs
  5. 1
      src/message.rs

18
CHANGELOG.md

@ -3,6 +3,17 @@
- `/api/register` & `/api/login` now use JSON data
- Changing user info now uses Enum (Name, Pin, or Pronouns)
### 0.6.1
- Add basic support for different user roles & moderator commands
- Any user names "admin" will be made into an Admin user
- User pronouns are stored in message body now
## 0.5.0
- Most actions should now fail on a NULL token
- Cookie should now expire after a week
- Use sled database instead of json file to store users
- Now use `GET /api/token/<name>` to validate a users session token
### 0.5.2
- When changing a username, it now deletes the previous user instead of creating a new one
- Database functions should now use some error handling
@ -13,13 +24,6 @@
- Add basic support for different message types
- Messages now use unix timestamps
- Backend finds timestamp
## 0.5.0
- Most actions should now fail on a NULL token
- Cookie should now expire after a week
- Use sled database instead of json file to store users
- Now use `GET /api/token/<name>` to validate a users session token
## 0.4.0
- Serve frontend code
- Set cookie for token

38
Cargo.lock

@ -576,6 +576,25 @@ version = "0.2.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
[[package]]
name = "lila-chat"
version = "0.6.0"
dependencies = [
"bincode",
"chrono",
"env_logger",
"log 0.4.14",
"once_cell",
"random-string",
"rocket",
"rocket_contrib",
"serde",
"serde_json",
"sha1",
"sled",
"uuid",
]
[[package]]
name = "lock_api"
version = "0.4.4"
@ -805,25 +824,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "pogchat"
version = "0.6.0"
dependencies = [
"bincode",
"chrono",
"env_logger",
"log 0.4.14",
"once_cell",
"random-string",
"rocket",
"rocket_contrib",
"serde",
"serde_json",
"sha1",
"sled",
"uuid",
]
[[package]]
name = "polyval"
version = "0.4.5"

2
Cargo.toml

@ -1,7 +1,7 @@
[package]
name = "lila-chat"
description = "A basic chat server written in rust"
version = "0.6.0"
version = "0.6.1"
documentation = "https://git.lavender.software/erin/lila-chat/wiki"
repository = "https://git.lavender.software/erin/lila-chat/"
license = "CNPLv6+"

1
src/chat.rs

@ -42,6 +42,7 @@ fn create_message(message: Json<MessageInput>, user: &User) -> JsonValue {
id: Uuid::new_v4(),
event_type,
user: user.name.to_lowercase().to_owned(),
pronouns: user.pronouns.to_lowercase().to_owned(),
body: message.body.to_string(),
created_at: Utc::now(),
};

1
src/message.rs

@ -21,6 +21,7 @@ pub struct Message {
pub id: Uuid,
pub event_type: MessageType,
pub user: String,
pub pronouns: String,
pub body: String,
pub created_at: DateTime<Utc>,
}
Loading…
Cancel
Save