Sync activity center (#2443)

sync activity center
This commit is contained in:
Michele Balistreri 2021-12-02 17:23:02 +03:00 committed by GitHub
parent ea95ce2d4b
commit 0867458f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 587 additions and 117 deletions

View File

@ -1 +1 @@
0.91.12
0.91.14

View File

@ -269,6 +269,66 @@ func (db sqlitePersistence) buildActivityCenterQuery(tx *sql.Tx, cursor string,
return db.unmarshalActivityCenterNotificationRows(rows)
}
func (db sqlitePersistence) runActivityCenterIDQuery(query string) ([][]byte, error) {
rows, err := db.db.Query(query)
if err != nil {
return nil, err
}
var ids [][]byte
for rows.Next() {
var id []byte
err = rows.Scan(&id)
if err != nil {
return nil, err
}
ids = append(ids, id)
}
return ids, nil
}
func (db sqlitePersistence) GetNotReadActivityCenterNotificationIds() ([][]byte, error) {
return db.runActivityCenterIDQuery("SELECT a.id FROM activity_center_notifications a WHERE NOT a.read")
}
func (db sqlitePersistence) GetToProcessActivityCenterNotificationIds() ([][]byte, error) {
return db.runActivityCenterIDQuery("SELECT a.id FROM activity_center_notifications a WHERE NOT a.dismissed AND NOT a.accepted")
}
func (db sqlitePersistence) GetActivityCenterNotificationsByID(ids []types.HexBytes) ([]*ActivityCenterNotification, error) {
idsArgs := make([]interface{}, 0, len(ids))
for _, id := range ids {
idsArgs = append(idsArgs, id)
}
inVector := strings.Repeat("?, ", len(ids)-1) + "?"
rows, err := db.db.Query("SELECT a.id, a.read, a.accepted, a.dismissed FROM activity_center_notifications a WHERE a.id IN ("+inVector+")", idsArgs...) // nolint: gosec
if err != nil {
return nil, err
}
var notifications []*ActivityCenterNotification
for rows.Next() {
notification := &ActivityCenterNotification{}
err := rows.Scan(
&notification.ID,
&notification.Read,
&notification.Accepted,
&notification.Dismissed)
if err != nil {
return nil, err
}
notifications = append(notifications, notification)
}
return notifications, nil
}
func (db sqlitePersistence) ActivityCenterNotifications(currCursor string, limit uint64) (string, []*ActivityCenterNotification, error) {
var tx *sql.Tx
var err error

View File

@ -2994,6 +2994,54 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte
continue
}
case protobuf.SyncActivityCenterRead:
if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) {
logger.Warn("not coming from us, ignoring")
continue
}
a := msg.ParsedMessage.Interface().(protobuf.SyncActivityCenterRead)
logger.Debug("Handling SyncActivityCenterRead", zap.Any("message", a))
err = m.handleActivityCenterRead(messageState, a)
if err != nil {
logger.Warn("failed to handle SyncActivityCenterRead", zap.Error(err))
allMessagesProcessed = false
continue
}
case protobuf.SyncActivityCenterAccepted:
if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) {
logger.Warn("not coming from us, ignoring")
continue
}
a := msg.ParsedMessage.Interface().(protobuf.SyncActivityCenterAccepted)
logger.Debug("Handling SyncActivityCenterAccepted", zap.Any("message", a))
err = m.handleActivityCenterAccepted(messageState, a)
if err != nil {
logger.Warn("failed to handle SyncActivityCenterAccepted", zap.Error(err))
allMessagesProcessed = false
continue
}
case protobuf.SyncActivityCenterDismissed:
if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) {
logger.Warn("not coming from us, ignoring")
continue
}
a := msg.ParsedMessage.Interface().(protobuf.SyncActivityCenterDismissed)
logger.Debug("Handling SyncActivityCenterDismissed", zap.Any("message", a))
err = m.handleActivityCenterDismissed(messageState, a)
if err != nil {
logger.Warn("failed to handle SyncActivityCenterDismissed", zap.Error(err))
allMessagesProcessed = false
continue
}
case protobuf.RequestAddressForTransaction:
command := msg.ParsedMessage.Interface().(protobuf.RequestAddressForTransaction)
logger.Debug("Handling RequestAddressForTransaction", zap.Any("message", command))

View File

@ -1,26 +1,91 @@
package protocol
import (
"context"
"github.com/golang/protobuf/proto"
"github.com/status-im/status-go/eth-node/types"
"github.com/status-im/status-go/protocol/common"
"github.com/status-im/status-go/protocol/protobuf"
)
func (m *Messenger) UnreadActivityCenterNotificationsCount() (uint64, error) {
return m.persistence.UnreadActivityCenterNotificationsCount()
}
func (m *Messenger) MarkAllActivityCenterNotificationsRead() error {
func toHexBytes(b [][]byte) []types.HexBytes {
hb := make([]types.HexBytes, len(b))
for i, v := range b {
hb[i] = types.HexBytes(v)
}
return hb
}
func fromHexBytes(hb []types.HexBytes) [][]byte {
b := make([][]byte, len(hb))
for i, v := range hb {
b[i] = v
}
return b
}
func (m *Messenger) MarkAllActivityCenterNotificationsRead(ctx context.Context) error {
if m.hasPairedDevices() {
ids, err := m.persistence.GetNotReadActivityCenterNotificationIds()
if err != nil {
return err
}
_, err = m.MarkActivityCenterNotificationsRead(ctx, toHexBytes(ids), true)
return err
}
return m.persistence.MarkAllActivityCenterNotificationsRead()
}
func (m *Messenger) MarkActivityCenterNotificationsRead(ids []types.HexBytes) error {
return m.persistence.MarkActivityCenterNotificationsRead(ids)
func (m *Messenger) MarkActivityCenterNotificationsRead(ctx context.Context, ids []types.HexBytes, sync bool) (*MessengerResponse, error) {
err := m.persistence.MarkActivityCenterNotificationsRead(ids)
if err != nil {
return nil, err
}
if !sync {
notifications, err := m.persistence.GetActivityCenterNotificationsByID(ids)
if err != nil {
return nil, err
}
return m.processActivityCenterNotifications(notifications, true)
}
syncMessage := &protobuf.SyncActivityCenterRead{
Clock: m.getTimesource().GetCurrentTime(),
Ids: fromHexBytes(ids),
}
encodedMessage, err := proto.Marshal(syncMessage)
if err != nil {
return nil, err
}
err = m.sendToPairedDevices(ctx, common.RawMessage{
Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_READ,
ResendAutomatically: true,
})
return nil, err
}
func (m *Messenger) MarkActivityCenterNotificationsUnread(ids []types.HexBytes) error {
return m.persistence.MarkActivityCenterNotificationsUnread(ids)
}
func (m *Messenger) processAcceptedActivityCenterNotifications(notifications []*ActivityCenterNotification) (*MessengerResponse, error) {
func (m *Messenger) processActivityCenterNotifications(notifications []*ActivityCenterNotification, addNotifications bool) (*MessengerResponse, error) {
response := &MessengerResponse{}
var chats []*Chat
for _, notification := range notifications {
@ -36,6 +101,10 @@ func (m *Messenger) processAcceptedActivityCenterNotifications(notifications []*
chats = append(chats, chat)
response.AddChat(chat)
}
if addNotifications {
response.AddActivityCenterNotification(notification)
}
}
if len(chats) != 0 {
err := m.saveChats(chats)
@ -46,28 +115,103 @@ func (m *Messenger) processAcceptedActivityCenterNotifications(notifications []*
return response, nil
}
func (m *Messenger) AcceptAllActivityCenterNotifications() (*MessengerResponse, error) {
func (m *Messenger) processAcceptedActivityCenterNotifications(ctx context.Context, notifications []*ActivityCenterNotification, sync bool) (*MessengerResponse, error) {
ids := make([][]byte, len(notifications))
for i := range notifications {
ids[i] = notifications[i].ID
notifications[i].Accepted = true
}
if sync {
syncMessage := &protobuf.SyncActivityCenterAccepted{
Clock: m.getTimesource().GetCurrentTime(),
Ids: ids,
}
encodedMessage, err := proto.Marshal(syncMessage)
if err != nil {
return nil, err
}
err = m.sendToPairedDevices(ctx, common.RawMessage{
Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_ACCEPTED,
ResendAutomatically: true,
})
if err != nil {
return nil, err
}
}
return m.processActivityCenterNotifications(notifications, !sync)
}
func (m *Messenger) AcceptAllActivityCenterNotifications(ctx context.Context) (*MessengerResponse, error) {
notifications, err := m.persistence.AcceptAllActivityCenterNotifications()
if err != nil {
return nil, err
}
return m.processAcceptedActivityCenterNotifications(notifications)
return m.processAcceptedActivityCenterNotifications(ctx, notifications, true)
}
func (m *Messenger) AcceptActivityCenterNotifications(ids []types.HexBytes) (*MessengerResponse, error) {
func (m *Messenger) AcceptActivityCenterNotifications(ctx context.Context, ids []types.HexBytes, sync bool) (*MessengerResponse, error) {
notifications, err := m.persistence.AcceptActivityCenterNotifications(ids)
if err != nil {
return nil, err
}
return m.processAcceptedActivityCenterNotifications(notifications)
return m.processAcceptedActivityCenterNotifications(ctx, notifications, sync)
}
func (m *Messenger) DismissAllActivityCenterNotifications() error {
func (m *Messenger) DismissAllActivityCenterNotifications(ctx context.Context) error {
if m.hasPairedDevices() {
ids, err := m.persistence.GetToProcessActivityCenterNotificationIds()
if err != nil {
return err
}
_, err = m.DismissActivityCenterNotifications(ctx, toHexBytes(ids), true)
return err
}
return m.persistence.DismissAllActivityCenterNotifications()
}
func (m *Messenger) DismissActivityCenterNotifications(ids []types.HexBytes) error {
return m.persistence.DismissActivityCenterNotifications(ids)
func (m *Messenger) DismissActivityCenterNotifications(ctx context.Context, ids []types.HexBytes, sync bool) (*MessengerResponse, error) {
err := m.persistence.DismissActivityCenterNotifications(ids)
if err != nil {
return nil, err
}
if !sync {
notifications, err := m.persistence.GetActivityCenterNotificationsByID(ids)
if err != nil {
return nil, err
}
return m.processActivityCenterNotifications(notifications, true)
}
syncMessage := &protobuf.SyncActivityCenterDismissed{
Clock: m.getTimesource().GetCurrentTime(),
Ids: fromHexBytes(ids),
}
encodedMessage, err := proto.Marshal(syncMessage)
if err != nil {
return nil, err
}
err = m.sendToPairedDevices(ctx, common.RawMessage{
Payload: encodedMessage,
MessageType: protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_DISMISSED,
ResendAutomatically: true,
})
return nil, err
}
func (m *Messenger) ActivityCenterNotifications(cursor string, limit uint64) (*ActivityCenterPaginationResponse, error) {
@ -81,3 +225,36 @@ func (m *Messenger) ActivityCenterNotifications(cursor string, limit uint64) (*A
Notifications: notifications,
}, nil
}
func (m *Messenger) handleActivityCenterRead(state *ReceivedMessageState, message protobuf.SyncActivityCenterRead) error {
m.logger.Info("HANDLING SYNC ACTIVITY CENTER READ")
resp, err := m.MarkActivityCenterNotificationsRead(context.TODO(), toHexBytes(message.Ids), false)
if err != nil {
return err
}
return state.Response.Merge(resp)
}
func (m *Messenger) handleActivityCenterAccepted(state *ReceivedMessageState, message protobuf.SyncActivityCenterAccepted) error {
m.logger.Info("HANDLING SYNC ACTIVITY CENTER ACCEPTED")
resp, err := m.AcceptActivityCenterNotifications(context.TODO(), toHexBytes(message.Ids), false)
if err != nil {
return err
}
return state.Response.Merge(resp)
}
func (m *Messenger) handleActivityCenterDismissed(state *ReceivedMessageState, message protobuf.SyncActivityCenterDismissed) error {
m.logger.Info("HANDLING SYNC ACTIVITY CENTER DISMISS")
resp, err := m.DismissActivityCenterNotifications(context.TODO(), toHexBytes(message.Ids), false)
if err != nil {
return err
}
return state.Response.Merge(resp)
}

View File

@ -86,7 +86,7 @@ func (s *MessengerActivityCenterMessageSuite) TestDismissOneToOneMessage() {
s.Require().Len(response.ActivityCenterNotifications(), 1)
// Dismiss all
s.Require().NoError(s.m.DismissAllActivityCenterNotifications())
s.Require().NoError(s.m.DismissAllActivityCenterNotifications(context.Background()))
// Send another message
inputMessage = buildTestMessage(*theirChat)
@ -130,7 +130,7 @@ func (s *MessengerActivityCenterMessageSuite) TestDeleteOneToOneChat() {
s.Require().Len(response.ActivityCenterNotifications(), 1)
// accept notification
_, err = s.m.AcceptAllActivityCenterNotifications()
_, err = s.m.AcceptAllActivityCenterNotifications(context.Background())
s.Require().NoError(err)
request := &requests.DeactivateChat{ID: response.Chats()[0].ID}

View File

@ -183,6 +183,7 @@ func (r *MessengerResponse) Merge(response *MessengerResponse) error {
r.AddMessages(response.Messages())
r.AddCommunities(response.Communities())
r.AddPinMessages(response.PinMessages())
r.AddActivityCenterNotifications(response.ActivityCenterNotifications())
return nil
}

View File

@ -60,6 +60,9 @@ const (
ApplicationMetadataMessage_SYNC_CHAT_REMOVED ApplicationMetadataMessage_Type = 34
ApplicationMetadataMessage_SYNC_CHAT_MESSAGES_READ ApplicationMetadataMessage_Type = 35
ApplicationMetadataMessage_BACKUP ApplicationMetadataMessage_Type = 36
ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_READ ApplicationMetadataMessage_Type = 37
ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_ACCEPTED ApplicationMetadataMessage_Type = 38
ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_DISMISSED ApplicationMetadataMessage_Type = 39
)
var ApplicationMetadataMessage_Type_name = map[int32]string{
@ -100,6 +103,9 @@ var ApplicationMetadataMessage_Type_name = map[int32]string{
34: "SYNC_CHAT_REMOVED",
35: "SYNC_CHAT_MESSAGES_READ",
36: "BACKUP",
37: "SYNC_ACTIVITY_CENTER_READ",
38: "SYNC_ACTIVITY_CENTER_ACCEPTED",
39: "SYNC_ACTIVITY_CENTER_DISMISSED",
}
var ApplicationMetadataMessage_Type_value = map[string]int32{
@ -140,6 +146,9 @@ var ApplicationMetadataMessage_Type_value = map[string]int32{
"SYNC_CHAT_REMOVED": 34,
"SYNC_CHAT_MESSAGES_READ": 35,
"BACKUP": 36,
"SYNC_ACTIVITY_CENTER_READ": 37,
"SYNC_ACTIVITY_CENTER_ACCEPTED": 38,
"SYNC_ACTIVITY_CENTER_DISMISSED": 39,
}
func (x ApplicationMetadataMessage_Type) String() string {
@ -218,46 +227,48 @@ func init() {
}
var fileDescriptor_ad09a6406fcf24c7 = []byte{
// 642 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x5b, 0x4f, 0x1b, 0x3d,
0x10, 0xfd, 0x02, 0x7c, 0x5c, 0x26, 0x5c, 0x8c, 0xb9, 0x85, 0x70, 0x0b, 0x01, 0xb5, 0xb4, 0x95,
0x52, 0xa9, 0x7d, 0xac, 0xfa, 0xe0, 0x78, 0x07, 0x62, 0xc8, 0xda, 0x8b, 0xed, 0xa5, 0x4a, 0x5f,
0xac, 0xa5, 0xa4, 0x08, 0x09, 0x48, 0x04, 0xe1, 0x81, 0x1f, 0xd0, 0x5f, 0xd1, 0x3f, 0x5b, 0x79,
0x73, 0xd9, 0x50, 0x42, 0x79, 0x4a, 0xf6, 0x9c, 0x33, 0x33, 0x3b, 0x67, 0x66, 0x16, 0xca, 0x49,
0xbb, 0x7d, 0x7d, 0xf5, 0x23, 0xe9, 0x5c, 0xb5, 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45, 0x60, 0x1d, 0xc7, 0xee, 0x65, 0x2f, 0x98, 0x6a, 0x92, 0x67, 0xfa,
0xad, 0x49, 0x89, 0x16, 0x61, 0x9d, 0x29, 0xad, 0x9a, 0x91, 0x4e, 0xac, 0x8f, 0xd0, 0x19, 0xc9,
0x7d, 0x95, 0x39, 0x5e, 0x23, 0xfb, 0xc3, 0xab, 0xca, 0x46, 0x36, 0x18, 0xe9, 0x06, 0x0a, 0x52,
0x0e, 0x5b, 0x1b, 0x85, 0xfb, 0xad, 0x6c, 0x10, 0x50, 0x90, 0x03, 0x0a, 0x30, 0x5d, 0x65, 0xfc,
0x22, 0x89, 0xc9, 0xe1, 0xd0, 0x91, 0x41, 0xd9, 0x46, 0x98, 0x94, 0xa3, 0x72, 0x68, 0x7a, 0xd4,
0x1f, 0x86, 0x8e, 0x7c, 0x0b, 0xf7, 0xae, 0x11, 0x05, 0x39, 0x0a, 0x8e, 0x9b, 0x48, 0x11, 0xd2,
0x46, 0xd2, 0x5a, 0x14, 0xe4, 0xb8, 0xba, 0xf0, 0x57, 0xbe, 0xf2, 0xcb, 0xef, 0x83, 0x4f, 0xd4,
0xd5, 0x74, 0xf6, 0xef, 0xb7, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xb4, 0xe9, 0x28, 0x49,
0x05, 0x00, 0x00,
}

View File

@ -50,5 +50,8 @@ message ApplicationMetadataMessage {
SYNC_CHAT_REMOVED = 34;
SYNC_CHAT_MESSAGES_READ = 35;
BACKUP = 36;
SYNC_ACTIVITY_CENTER_READ = 37;
SYNC_ACTIVITY_CENTER_ACCEPTED = 38;
SYNC_ACTIVITY_CENTER_DISMISSED = 39;
}
}

View File

@ -793,6 +793,147 @@ func (m *SyncChatMessagesRead) GetId() string {
return ""
}
type SyncActivityCenterRead struct {
Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"`
Ids [][]byte `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SyncActivityCenterRead) Reset() { *m = SyncActivityCenterRead{} }
func (m *SyncActivityCenterRead) String() string { return proto.CompactTextString(m) }
func (*SyncActivityCenterRead) ProtoMessage() {}
func (*SyncActivityCenterRead) Descriptor() ([]byte, []int) {
return fileDescriptor_d61ab7221f0b5518, []int{11}
}
func (m *SyncActivityCenterRead) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SyncActivityCenterRead.Unmarshal(m, b)
}
func (m *SyncActivityCenterRead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SyncActivityCenterRead.Marshal(b, m, deterministic)
}
func (m *SyncActivityCenterRead) XXX_Merge(src proto.Message) {
xxx_messageInfo_SyncActivityCenterRead.Merge(m, src)
}
func (m *SyncActivityCenterRead) XXX_Size() int {
return xxx_messageInfo_SyncActivityCenterRead.Size(m)
}
func (m *SyncActivityCenterRead) XXX_DiscardUnknown() {
xxx_messageInfo_SyncActivityCenterRead.DiscardUnknown(m)
}
var xxx_messageInfo_SyncActivityCenterRead proto.InternalMessageInfo
func (m *SyncActivityCenterRead) GetClock() uint64 {
if m != nil {
return m.Clock
}
return 0
}
func (m *SyncActivityCenterRead) GetIds() [][]byte {
if m != nil {
return m.Ids
}
return nil
}
type SyncActivityCenterAccepted struct {
Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"`
Ids [][]byte `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SyncActivityCenterAccepted) Reset() { *m = SyncActivityCenterAccepted{} }
func (m *SyncActivityCenterAccepted) String() string { return proto.CompactTextString(m) }
func (*SyncActivityCenterAccepted) ProtoMessage() {}
func (*SyncActivityCenterAccepted) Descriptor() ([]byte, []int) {
return fileDescriptor_d61ab7221f0b5518, []int{12}
}
func (m *SyncActivityCenterAccepted) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SyncActivityCenterAccepted.Unmarshal(m, b)
}
func (m *SyncActivityCenterAccepted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SyncActivityCenterAccepted.Marshal(b, m, deterministic)
}
func (m *SyncActivityCenterAccepted) XXX_Merge(src proto.Message) {
xxx_messageInfo_SyncActivityCenterAccepted.Merge(m, src)
}
func (m *SyncActivityCenterAccepted) XXX_Size() int {
return xxx_messageInfo_SyncActivityCenterAccepted.Size(m)
}
func (m *SyncActivityCenterAccepted) XXX_DiscardUnknown() {
xxx_messageInfo_SyncActivityCenterAccepted.DiscardUnknown(m)
}
var xxx_messageInfo_SyncActivityCenterAccepted proto.InternalMessageInfo
func (m *SyncActivityCenterAccepted) GetClock() uint64 {
if m != nil {
return m.Clock
}
return 0
}
func (m *SyncActivityCenterAccepted) GetIds() [][]byte {
if m != nil {
return m.Ids
}
return nil
}
type SyncActivityCenterDismissed struct {
Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"`
Ids [][]byte `protobuf:"bytes,2,rep,name=ids,proto3" json:"ids,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SyncActivityCenterDismissed) Reset() { *m = SyncActivityCenterDismissed{} }
func (m *SyncActivityCenterDismissed) String() string { return proto.CompactTextString(m) }
func (*SyncActivityCenterDismissed) ProtoMessage() {}
func (*SyncActivityCenterDismissed) Descriptor() ([]byte, []int) {
return fileDescriptor_d61ab7221f0b5518, []int{13}
}
func (m *SyncActivityCenterDismissed) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SyncActivityCenterDismissed.Unmarshal(m, b)
}
func (m *SyncActivityCenterDismissed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SyncActivityCenterDismissed.Marshal(b, m, deterministic)
}
func (m *SyncActivityCenterDismissed) XXX_Merge(src proto.Message) {
xxx_messageInfo_SyncActivityCenterDismissed.Merge(m, src)
}
func (m *SyncActivityCenterDismissed) XXX_Size() int {
return xxx_messageInfo_SyncActivityCenterDismissed.Size(m)
}
func (m *SyncActivityCenterDismissed) XXX_DiscardUnknown() {
xxx_messageInfo_SyncActivityCenterDismissed.DiscardUnknown(m)
}
var xxx_messageInfo_SyncActivityCenterDismissed proto.InternalMessageInfo
func (m *SyncActivityCenterDismissed) GetClock() uint64 {
if m != nil {
return m.Clock
}
return 0
}
func (m *SyncActivityCenterDismissed) GetIds() [][]byte {
if m != nil {
return m.Ids
}
return nil
}
func init() {
proto.RegisterType((*Backup)(nil), "protobuf.Backup")
proto.RegisterType((*PairInstallation)(nil), "protobuf.PairInstallation")
@ -805,6 +946,9 @@ func init() {
proto.RegisterType((*SyncInstallation)(nil), "protobuf.SyncInstallation")
proto.RegisterType((*SyncChatRemoved)(nil), "protobuf.SyncChatRemoved")
proto.RegisterType((*SyncChatMessagesRead)(nil), "protobuf.SyncChatMessagesRead")
proto.RegisterType((*SyncActivityCenterRead)(nil), "protobuf.SyncActivityCenterRead")
proto.RegisterType((*SyncActivityCenterAccepted)(nil), "protobuf.SyncActivityCenterAccepted")
proto.RegisterType((*SyncActivityCenterDismissed)(nil), "protobuf.SyncActivityCenterDismissed")
}
func init() {
@ -812,53 +956,56 @@ func init() {
}
var fileDescriptor_d61ab7221f0b5518 = []byte{
// 763 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0xcd, 0x6e, 0xdb, 0x38,
0x10, 0x86, 0x6c, 0xc7, 0x76, 0xc6, 0xb2, 0x13, 0x10, 0xc1, 0x86, 0xc9, 0x62, 0x11, 0x47, 0xd9,
0x60, 0x7d, 0xf2, 0x2e, 0xb2, 0x87, 0xc5, 0x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0x52, 0xd2, 0x7a, 0x55, 0xd2, 0x07, 0xe6, 0x67, 0x1b, 0x5a, 0xfe, 0x94, 0x48, 0xb5,
0x22, 0xd7, 0xb4, 0xa7, 0xa9, 0xcc, 0x51, 0xa0, 0xba, 0xc2, 0x5f, 0x70, 0x52, 0xde, 0xa6, 0x91,
0xb5, 0xc4, 0x46, 0x5a, 0x22, 0x21, 0x89, 0x34, 0xe3, 0xd2, 0x70, 0x8d, 0xe1, 0x7c, 0xae, 0xc1,
0xe6, 0xdd, 0x66, 0x41, 0xff, 0x57, 0xb6, 0xbf, 0xa5, 0xf5, 0xda, 0x7f, 0x74, 0xfb, 0xdf, 0xec,
0x7e, 0xf4, 0x14, 0xec, 0xe2, 0xd5, 0x8a, 0x9d, 0xc0, 0x35, 0x7d, 0xc5, 0xef, 0xcb, 0xaf, 0xb8,
0xe9, 0x4e, 0xb7, 0x93, 0x94, 0xff, 0x02, 0x1d, 0x43, 0x8b, 0x98, 0x89, 0xd1, 0x0a, 0x3d, 0x48,
0xa3, 0x18, 0x2d, 0x77, 0x71, 0x02, 0xfd, 0x0b, 0xe5, 0xf3, 0x19, 0x15, 0xb8, 0xa1, 0x49, 0x6c,
0x2f, 0xab, 0x7b, 0x35, 0xd6, 0xf9, 0x07, 0x36, 0xb4, 0x57, 0x11, 0x2a, 0xc6, 0x7d, 0xb5, 0xa9,
0xf9, 0x0f, 0xb6, 0x16, 0x07, 0x5f, 0x52, 0x21, 0xc8, 0x84, 0x0a, 0x97, 0x92, 0x15, 0x4f, 0x9f,
0x76, 0xdf, 0x76, 0x86, 0x7f, 0x1e, 0x2f, 0x08, 0x8e, 0x9b, 0xfa, 0xef, 0xef, 0xef, 0x01, 0x00,
0x00, 0xff, 0xff, 0x9c, 0x69, 0xcf, 0x28, 0xd5, 0x07, 0x00, 0x00,
// 814 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x54, 0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2c, 0x59, 0xb6, 0x27, 0x7f,
0x00, 0x36, 0x0f, 0x8c, 0xbc, 0x8e, 0xa7, 0x7e, 0xdd, 0x4b, 0xb3, 0xf9, 0xdb, 0x15, 0x26, 0x94,
0xb2, 0x54, 0xb2, 0xc3, 0xab, 0x7c, 0x6d, 0x86, 0x7c, 0xbb, 0xca, 0x25, 0x17, 0x11, 0x17, 0xe2,
0xf0, 0x32, 0x17, 0xbd, 0x5f, 0xba, 0xe3, 0x8f, 0xce, 0x37, 0x7a, 0xcf, 0x5b, 0xfa, 0xef, 0x93,
0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x59, 0x97, 0x1e, 0x7c, 0xa4, 0x08, 0x00, 0x00,
}

View File

@ -90,3 +90,18 @@ message SyncChatMessagesRead {
uint64 clock = 1;
string id = 2;
}
message SyncActivityCenterRead {
uint64 clock = 1;
repeated bytes ids = 2;
}
message SyncActivityCenterAccepted {
uint64 clock = 1;
repeated bytes ids = 2;
}
message SyncActivityCenterDismissed {
uint64 clock = 1;
repeated bytes ids = 2;
}

View File

@ -257,6 +257,12 @@ func (m *StatusMessage) HandleApplication() error {
return m.unmarshalProtobufData(new(protobuf.SyncChatMessagesRead))
case protobuf.ApplicationMetadataMessage_BACKUP:
return m.unmarshalProtobufData(new(protobuf.Backup))
case protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_READ:
return m.unmarshalProtobufData(new(protobuf.SyncActivityCenterRead))
case protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_ACCEPTED:
return m.unmarshalProtobufData(new(protobuf.SyncActivityCenterAccepted))
case protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_DISMISSED:
return m.unmarshalProtobufData(new(protobuf.SyncActivityCenterDismissed))
}
return nil
}

View File

@ -871,32 +871,34 @@ func (api *PublicAPI) UnreadActivityCenterNotificationsCount() (uint64, error) {
return api.service.messenger.UnreadActivityCenterNotificationsCount()
}
func (api *PublicAPI) MarkAllActivityCenterNotificationsRead() error {
return api.service.messenger.MarkAllActivityCenterNotificationsRead()
func (api *PublicAPI) MarkAllActivityCenterNotificationsRead(ctx context.Context) error {
return api.service.messenger.MarkAllActivityCenterNotificationsRead(ctx)
}
func (api *PublicAPI) MarkActivityCenterNotificationsRead(ids []types.HexBytes) error {
return api.service.messenger.MarkActivityCenterNotificationsRead(ids)
func (api *PublicAPI) MarkActivityCenterNotificationsRead(ctx context.Context, ids []types.HexBytes) error {
_, err := api.service.messenger.MarkActivityCenterNotificationsRead(ctx, ids, true)
return err
}
func (api *PublicAPI) MarkActivityCenterNotificationsUnread(ids []types.HexBytes) error {
return api.service.messenger.MarkActivityCenterNotificationsUnread(ids)
}
func (api *PublicAPI) AcceptAllActivityCenterNotifications() (*protocol.MessengerResponse, error) {
return api.service.messenger.AcceptAllActivityCenterNotifications()
func (api *PublicAPI) AcceptAllActivityCenterNotifications(ctx context.Context) (*protocol.MessengerResponse, error) {
return api.service.messenger.AcceptAllActivityCenterNotifications(ctx)
}
func (api *PublicAPI) AcceptActivityCenterNotifications(ids []types.HexBytes) (*protocol.MessengerResponse, error) {
return api.service.messenger.AcceptActivityCenterNotifications(ids)
func (api *PublicAPI) AcceptActivityCenterNotifications(ctx context.Context, ids []types.HexBytes) (*protocol.MessengerResponse, error) {
return api.service.messenger.AcceptActivityCenterNotifications(ctx, ids, true)
}
func (api *PublicAPI) DismissAllActivityCenterNotifications() error {
return api.service.messenger.DismissAllActivityCenterNotifications()
func (api *PublicAPI) DismissAllActivityCenterNotifications(ctx context.Context) error {
return api.service.messenger.DismissAllActivityCenterNotifications(ctx)
}
func (api *PublicAPI) DismissActivityCenterNotifications(ids []types.HexBytes) error {
return api.service.messenger.DismissActivityCenterNotifications(ids)
func (api *PublicAPI) DismissActivityCenterNotifications(ctx context.Context, ids []types.HexBytes) error {
_, err := api.service.messenger.DismissActivityCenterNotifications(ctx, ids, true)
return err
}
func (api *PublicAPI) ActivityCenterNotifications(cursor string, limit uint64) (*protocol.ActivityCenterPaginationResponse, error) {