diff --git a/protocol/messenger_contacts.go b/protocol/messenger_contacts.go index 2d0a0a83fa..835670f457 100644 --- a/protocol/messenger_contacts.go +++ b/protocol/messenger_contacts.go @@ -973,38 +973,16 @@ func (m *Messenger) BlockContact(ctx context.Context, contactID string, fromSync // https://github.com/status-im/status-go/issues/3720 if !fromSyncing { updatedAt := m.GetCurrentTimeInMillis() - _, err = m.DismissAllActivityCenterNotificationsFromUser(ctx, contactID, updatedAt) + notifications, err := m.DismissAllActivityCenterNotificationsFromUser(ctx, contactID, updatedAt) if err != nil { return nil, err } + response.AddActivityCenterNotifications(notifications) } return response, nil } -// The same function as the one above. -// Should be removed with https://github.com/status-im/status-desktop/issues/8805 -func (m *Messenger) BlockContactDesktop(ctx context.Context, contactID string) (*MessengerResponse, error) { - response := &MessengerResponse{} - - err := m.blockContact(ctx, response, contactID, true, false) - if err != nil { - return nil, err - } - - response, err = m.DeclineAllPendingGroupInvitesFromUser(ctx, response, contactID) - if err != nil { - return nil, err - } - - notifications, err := m.DismissAllActivityCenterNotificationsFromUser(ctx, contactID, m.GetCurrentTimeInMillis()) - if err != nil { - return nil, err - } - response.AddActivityCenterNotifications(notifications) - return response, nil -} - func (m *Messenger) UnblockContact(contactID string) (*MessengerResponse, error) { response := &MessengerResponse{} contact, ok := m.allContacts.Load(contactID) diff --git a/services/ext/api.go b/services/ext/api.go index e516882d56..7f76140841 100644 --- a/services/ext/api.go +++ b/services/ext/api.go @@ -345,13 +345,6 @@ func (api *PublicAPI) BlockContact(ctx context.Context, contactID string) (*prot return api.service.messenger.BlockContact(ctx, contactID, false) } -// This function is the same as the one above, but used only on the desktop side, since at the end it doesn't set -// `Added` flag to `false`, but only `Blocked` to `true` -func (api *PublicAPI) BlockContactDesktop(ctx context.Context, contactID string) (*protocol.MessengerResponse, error) { - api.logger.Info("blocking contact", zap.String("contact", contactID)) - return api.service.messenger.BlockContactDesktop(ctx, contactID) -} - func (api *PublicAPI) UnblockContact(parent context.Context, contactID string) (*protocol.MessengerResponse, error) { return api.service.messenger.UnblockContact(contactID) }