push: only send direct notifications if we have data (#133)

This commit is contained in:
Nick Mills-Barrett
2026-03-24 10:12:04 +00:00
committed by GitHub
parent ae5f2f3093
commit bec7ee8f5e

View File

@@ -262,7 +262,7 @@ func (t *TelegramClient) ConnectBackground(ctx context.Context, params *bridgev2
var sender *bridgev2.Ghost
var messageID networkid.MessageID
var messageText, notificationText, notificationTitle string
if data != nil {
if notifs, ok := t.main.Bridge.Matrix.(bridgev2.MatrixConnectorWithNotifications); ok && data != nil {
if data.Aps != nil {
notificationTitle = data.Aps.Alert.Title
notificationText = data.Aps.Alert.Body
@@ -306,9 +306,6 @@ func (t *TelegramClient) ConnectBackground(ctx context.Context, params *bridgev2
if relatedPortal != nil && data.Custom.MessageID != 0 {
messageID = ids.MakeMessageID(relatedPortal.PortalKey, data.Custom.MessageID)
}
}
notifs, ok := t.main.Bridge.Matrix.(bridgev2.MatrixConnectorWithNotifications)
if ok {
notifs.DisplayNotification(ctx, &bridgev2.DirectNotificationData{
Portal: relatedPortal,
Sender: sender,