Skip to content
Snippets Groups Projects
Commit 9d251f79 authored by insert's avatar insert
Browse files

Update tag in enums.

parent 1d390d48
No related merge requests found
Pipeline #494 failed with stage
...@@ -65,16 +65,16 @@ pub async fn generate_ready(mut user: User) -> Result<ClientboundNotification> { ...@@ -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
} }
] ]
......
...@@ -21,16 +21,16 @@ pub async fn generate_subscriptions(user: &User) -> Result<(), String> { ...@@ -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
} }
] ]
......
...@@ -12,11 +12,11 @@ pub async fn req(user: User) -> Result<JsonValue> { ...@@ -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
......
...@@ -9,12 +9,12 @@ use ulid::Ulid; ...@@ -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 ]
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment