Only build notification when there are subscriptions
This commit is contained in:
@@ -301,8 +301,8 @@ impl Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mentions = self.mentions.clone();
|
let mentions = self.mentions.clone();
|
||||||
let enc = serde_json::to_string(&PushNotification::new(self.clone()).await).unwrap();
|
|
||||||
ClientboundNotification::Message(self).publish(channel.id().to_string());
|
ClientboundNotification::Message(self.clone()).publish(channel.id().to_string());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Web Push Test Code
|
Web Push Test Code
|
||||||
@@ -365,6 +365,7 @@ impl Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if subscriptions.len() > 0 {
|
if subscriptions.len() > 0 {
|
||||||
|
let enc = serde_json::to_string(&PushNotification::new(self).await).unwrap();
|
||||||
let client = WebPushClient::new();
|
let client = WebPushClient::new();
|
||||||
let key =
|
let key =
|
||||||
base64::decode_config(VAPID_PRIVATE_KEY.clone(), base64::URL_SAFE).unwrap();
|
base64::decode_config(VAPID_PRIVATE_KEY.clone(), base64::URL_SAFE).unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user