fix(activity_center): Add remove activity center notifications array to message response (#3277)
This commit is contained in:
parent
4be978a2fe
commit
1453f5a0e3
|
@ -107,11 +107,15 @@ func (s *MessengerDeleteMessageForEveryoneSuite) TestDeleteMessageForEveryone()
|
||||||
deleteMessageResponse, err := s.moderator.DeleteMessageAndSend(ctx, message.ID)
|
deleteMessageResponse, err := s.moderator.DeleteMessageAndSend(ctx, message.ID)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
_, err = WaitOnMessengerResponse(s.bob, func(response *MessengerResponse) bool {
|
response, err = WaitOnMessengerResponse(s.bob, func(response *MessengerResponse) bool {
|
||||||
return len(response.RemovedMessages()) > 0
|
return len(response.RemovedMessages()) > 0
|
||||||
}, "removed messages not received")
|
}, "removed messages not received")
|
||||||
s.Require().Equal(deleteMessageResponse.RemovedMessages()[0].DeletedBy, contactIDFromPublicKey(s.moderator.IdentityPublicKey()))
|
s.Require().Equal(deleteMessageResponse.RemovedMessages()[0].DeletedBy, contactIDFromPublicKey(s.moderator.IdentityPublicKey()))
|
||||||
|
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
s.Require().Len(response.ActivityCenterNotifications(), 1)
|
||||||
|
s.Require().True(response.ActivityCenterNotifications()[0].Deleted)
|
||||||
|
|
||||||
message, err = s.bob.MessageByID(message.ID)
|
message, err = s.bob.MessageByID(message.ID)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
s.Require().True(message.Deleted)
|
s.Require().True(message.Deleted)
|
||||||
|
|
|
@ -1583,6 +1583,10 @@ func (m *Messenger) HandleDeleteMessage(state *ReceivedMessageState, deleteMessa
|
||||||
state.Response.AddRemovedMessage(&RemovedMessage{MessageID: messageID, ChatID: chat.ID, DeletedBy: deleteMessage.DeleteMessage.DeletedBy})
|
state.Response.AddRemovedMessage(&RemovedMessage{MessageID: messageID, ChatID: chat.ID, DeletedBy: deleteMessage.DeleteMessage.DeletedBy})
|
||||||
state.Response.AddChat(chat)
|
state.Response.AddChat(chat)
|
||||||
state.Response.AddNotification(DeletedMessageNotification(messageID, chat))
|
state.Response.AddNotification(DeletedMessageNotification(messageID, chat))
|
||||||
|
state.Response.AddActivityCenterNotification(&ActivityCenterNotification{
|
||||||
|
ID: types.FromHex(messageID),
|
||||||
|
Deleted: true,
|
||||||
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue