mirror of
https://github.com/status-im/status-go.git
synced 2025-02-20 10:48:36 +00:00
Add feature flag for push notifications and bump version
This commit is contained in:
parent
4ae2c59e9b
commit
45815e57d7
@ -5,4 +5,7 @@ type FeatureFlags struct {
|
|||||||
// using datasync, breaking change for non-v1 clients. Public messages
|
// using datasync, breaking change for non-v1 clients. Public messages
|
||||||
// are not impacted
|
// are not impacted
|
||||||
Datasync bool
|
Datasync bool
|
||||||
|
|
||||||
|
// PushNotification indicates whether we should be enabling the push notification feature
|
||||||
|
PushNotifications bool
|
||||||
}
|
}
|
||||||
|
@ -1459,7 +1459,7 @@ func (m *Messenger) SendChatMessage(ctx context.Context, message *Message) (*Mes
|
|||||||
|
|
||||||
id, err := m.dispatchMessage(ctx, &common.RawMessage{
|
id, err := m.dispatchMessage(ctx, &common.RawMessage{
|
||||||
LocalChatID: chat.ID,
|
LocalChatID: chat.ID,
|
||||||
SendPushNotification: !chat.Public(),
|
SendPushNotification: m.featureFlags.PushNotifications && !chat.Public(),
|
||||||
Payload: encodedMessage,
|
Payload: encodedMessage,
|
||||||
MessageType: protobuf.ApplicationMetadataMessage_CHAT_MESSAGE,
|
MessageType: protobuf.ApplicationMetadataMessage_CHAT_MESSAGE,
|
||||||
ResendAutomatically: true,
|
ResendAutomatically: true,
|
||||||
|
@ -116,6 +116,13 @@ func WithDatasync() func(c *config) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WithPushNotifications() func(c *config) error {
|
||||||
|
return func(c *config) error {
|
||||||
|
c.featureFlags.PushNotifications = true
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func WithEnvelopesMonitorConfig(emc *transport.EnvelopesMonitorConfig) Option {
|
func WithEnvelopesMonitorConfig(emc *transport.EnvelopesMonitorConfig) Option {
|
||||||
return func(c *config) error {
|
return func(c *config) error {
|
||||||
c.envelopesMonitorConfig = emc
|
c.envelopesMonitorConfig = emc
|
||||||
|
@ -88,6 +88,7 @@ func (s *MessengerPushNotificationSuite) newMessengerWithKey(shh types.Waku, pri
|
|||||||
WithMessagesPersistenceEnabled(),
|
WithMessagesPersistenceEnabled(),
|
||||||
WithDatabaseConfig(tmpFile.Name(), ""),
|
WithDatabaseConfig(tmpFile.Name(), ""),
|
||||||
WithDatasync(),
|
WithDatasync(),
|
||||||
|
WithPushNotifications(),
|
||||||
}
|
}
|
||||||
return s.newMessengerWithOptions(shh, privateKey, options)
|
return s.newMessengerWithOptions(shh, privateKey, options)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user