Update tag in enums.

This commit is contained in:
Paul Makles
2021-01-19 21:27:18 +00:00
parent 1d390d483d
commit 9d251f794b
4 changed files with 10 additions and 10 deletions

View File

@@ -65,16 +65,16 @@ pub async fn generate_ready(mut user: User) -> Result<ClientboundNotification> {
doc! { doc! {
"$or": [ "$or": [
{ {
"type": "SavedMessages", "channel_type": "SavedMessages",
"user": &user.id "user": &user.id
}, },
{ {
"type": "DirectMessage", "channel_type": "DirectMessage",
"recipients": &user.id, "recipients": &user.id,
"active": true "active": true
}, },
{ {
"type": "Group", "channel_type": "Group",
"recipients": &user.id "recipients": &user.id
} }
] ]

View File

@@ -21,16 +21,16 @@ pub async fn generate_subscriptions(user: &User) -> Result<(), String> {
doc! { doc! {
"$or": [ "$or": [
{ {
"type": "SavedMessages", "channel_type": "SavedMessages",
"user": &user.id "user": &user.id
}, },
{ {
"type": "DirectMessage", "channel_type": "DirectMessage",
"recipients": &user.id, "recipients": &user.id,
"active": true "active": true
}, },
{ {
"type": "Group", "channel_type": "Group",
"recipients": &user.id "recipients": &user.id
} }
] ]

View File

@@ -12,11 +12,11 @@ pub async fn req(user: User) -> Result<JsonValue> {
doc! { doc! {
"$or": [ "$or": [
{ {
"type": "DirectMessage", "channel_type": "DirectMessage",
"active": true "active": true
}, },
{ {
"type": "Group" "channel_type": "Group"
} }
], ],
"recipients": user.id "recipients": user.id

View File

@@ -9,12 +9,12 @@ use ulid::Ulid;
pub async fn req(user: User, target: Ref) -> Result<JsonValue> { pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
let query = if user.id == target.id { let query = if user.id == target.id {
doc! { doc! {
"type": "SavedMessages", "channel_type": "SavedMessages",
"user": &user.id "user": &user.id
} }
} else { } else {
doc! { doc! {
"type": "DirectMessage", "channel_type": "DirectMessage",
"recipients": { "recipients": {
"$all": [ &user.id, &target.id ] "$all": [ &user.id, &target.id ]
} }