[Fix] Added Community Kicked notification to response (#3427)
* [Fix] Added Community Kicked notification to response * Added unit test and updated response merge method * Update VERSION
This commit is contained in:
parent
b8209cbc7d
commit
141a3e2633
|
@ -1909,6 +1909,12 @@ func (s *MessengerCommunitiesSuite) TestRequestAccessAgain() {
|
|||
if len(response.Communities()) == 0 {
|
||||
return errors.New("community not received")
|
||||
}
|
||||
if len(response.ActivityCenterNotifications()) == 0 {
|
||||
return errors.New("activity center notification not received")
|
||||
}
|
||||
if response.ActivityCenterState().HasSeen {
|
||||
return errors.New("activity center seen state is incorrect")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
|
@ -4347,11 +4347,17 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte
|
|||
Type: ActivityCenterNotificationTypeCommunityKicked,
|
||||
Timestamp: m.getTimesource().GetCurrentTime(),
|
||||
CommunityID: changes.Community.IDString(),
|
||||
Read: false,
|
||||
}
|
||||
|
||||
err = m.addActivityCenterNotification(response, notification)
|
||||
if err != nil {
|
||||
m.logger.Error("failed to save notification", zap.Error(err))
|
||||
logger.Error("failed to save notification", zap.Error(err))
|
||||
continue
|
||||
}
|
||||
|
||||
if err := messageState.Response.Merge(response); err != nil {
|
||||
logger.Error("cannot merge notification response", zap.Error(err))
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
|
@ -306,6 +306,7 @@ func (r *MessengerResponse) Merge(response *MessengerResponse) error {
|
|||
r.AddVerificationRequests(response.VerificationRequests())
|
||||
r.AddTrustStatuses(response.trustStatus)
|
||||
r.AddActivityCenterNotifications(response.ActivityCenterNotifications())
|
||||
r.SetActivityCenterState(response.ActivityCenterState())
|
||||
r.AddEmojiReactions(response.EmojiReactions())
|
||||
r.AddInstallations(response.Installations)
|
||||
r.AddSavedAddresses(response.SavedAddresses())
|
||||
|
|
Loading…
Reference in New Issue