mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
feat: parse message push notification content and replace internal formatting (#693)
* parse message push notification content and replace internal formatting Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> * fix: don't unwrap the error I was using for db debugging Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> * fix: emojis & remove compiler warning Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> * fix: emojis in pushd Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> * feat: report errors in the render function to sentry Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> --------- Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com>
This commit is contained in:
@@ -133,7 +133,10 @@ auto_derived!(
|
||||
#[serde(rename = "message_unpinned")]
|
||||
MessageUnpinned { id: String, by: String },
|
||||
#[serde(rename = "call_started")]
|
||||
CallStarted { by: String, finished_at: Option<Timestamp> },
|
||||
CallStarted {
|
||||
by: String,
|
||||
finished_at: Option<Timestamp>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Name and / or avatar override information
|
||||
@@ -201,6 +204,9 @@ auto_derived!(
|
||||
pub image: Option<String>,
|
||||
/// Message content or system message information
|
||||
pub body: String,
|
||||
/// The raw body, if the body has been rendered
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub raw_body: Option<String>,
|
||||
/// Unique tag, usually the channel ID
|
||||
pub tag: String,
|
||||
/// Timestamp at which this notification was created
|
||||
@@ -508,6 +514,7 @@ impl PushNotification {
|
||||
icon,
|
||||
image,
|
||||
body,
|
||||
raw_body: None,
|
||||
tag: channel.id().to_string(),
|
||||
timestamp,
|
||||
url: format!("{}/channel/{}/{}", config.hosts.app, channel.id(), msg.id),
|
||||
|
||||
Reference in New Issue
Block a user