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
|
||||
// are not impacted
|
||||
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{
|
||||
LocalChatID: chat.ID,
|
||||
SendPushNotification: !chat.Public(),
|
||||
SendPushNotification: m.featureFlags.PushNotifications && !chat.Public(),
|
||||
Payload: encodedMessage,
|
||||
MessageType: protobuf.ApplicationMetadataMessage_CHAT_MESSAGE,
|
||||
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 {
|
||||
return func(c *config) error {
|
||||
c.envelopesMonitorConfig = emc
|
||||
|
|
|
@ -88,6 +88,7 @@ func (s *MessengerPushNotificationSuite) newMessengerWithKey(shh types.Waku, pri
|
|||
WithMessagesPersistenceEnabled(),
|
||||
WithDatabaseConfig(tmpFile.Name(), ""),
|
||||
WithDatasync(),
|
||||
WithPushNotifications(),
|
||||
}
|
||||
return s.newMessengerWithOptions(shh, privateKey, options)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue