push: extract app sandbox flag to global variable
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
|||||||
|
|
||||||
var _ bridgev2.PushableNetworkAPI = (*TelegramClient)(nil)
|
var _ bridgev2.PushableNetworkAPI = (*TelegramClient)(nil)
|
||||||
|
|
||||||
|
var PushAppSandbox = false
|
||||||
|
|
||||||
func (t *TelegramClient) RegisterPushNotifications(ctx context.Context, pushType bridgev2.PushType, token string) error {
|
func (t *TelegramClient) RegisterPushNotifications(ctx context.Context, pushType bridgev2.PushType, token string) error {
|
||||||
meta := t.userLogin.Metadata.(*UserLoginMetadata)
|
meta := t.userLogin.Metadata.(*UserLoginMetadata)
|
||||||
if meta.PushEncryptionKey == nil {
|
if meta.PushEncryptionKey == nil {
|
||||||
@@ -35,7 +37,7 @@ func (t *TelegramClient) RegisterPushNotifications(ctx context.Context, pushType
|
|||||||
NoMuted: false,
|
NoMuted: false,
|
||||||
TokenType: tokenType,
|
TokenType: tokenType,
|
||||||
Token: token,
|
Token: token,
|
||||||
AppSandbox: false,
|
AppSandbox: PushAppSandbox,
|
||||||
Secret: meta.PushEncryptionKey,
|
Secret: meta.PushEncryptionKey,
|
||||||
OtherUIDs: nil, // TODO set properly
|
OtherUIDs: nil, // TODO set properly
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user