From 53277cb2354f8316f9a82077ffc487166248c3e4 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 20 Nov 2021 12:49:57 +0000 Subject: [PATCH] feat(push): include URL for each notification --- src/database/entities/message.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/database/entities/message.rs b/src/database/entities/message.rs index 27a9229d..3097230f 100644 --- a/src/database/entities/message.rs +++ b/src/database/entities/message.rs @@ -1,4 +1,4 @@ -use crate::util::variables::{USE_JANUARY, PUBLIC_URL}; +use crate::util::variables::{USE_JANUARY, PUBLIC_URL, APP_URL}; use crate::{ database::*, notifications::{events::ClientboundNotification, websocket::is_online}, @@ -21,6 +21,7 @@ pub struct PushNotification { pub body: String, pub tag: String, pub timestamp: u64, + pub url: String, } impl PushNotification { @@ -64,6 +65,7 @@ impl PushNotification { body, tag: channel.id().to_string(), timestamp, + url: format!("{}/channel/{}/{}", *APP_URL, channel.id(), msg.id), } } }