Skip to content

Commit

Permalink
fix: [BUG] Invitation to join space : notification is never updated - E…
Browse files Browse the repository at this point in the history
…XO-75048 - Meeds-io/meeds#2531

Prior to this change, if a user is invited to join a space, and he accepts, the join notification is never updated.
This commit fix this bug by correcting the update notification method since the condition to check if the notification should be updated or not was wrong.
  • Loading branch information
mkrout committed Oct 28, 2024
1 parent 6eb3942 commit 15cfa17
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.exoplatform.social.notification.impl;

import org.apache.commons.lang3.StringUtils;
import org.exoplatform.commons.api.notification.NotificationContext;
import org.exoplatform.commons.api.notification.model.*;
import org.exoplatform.commons.api.notification.plugin.BaseNotificationPlugin;
Expand Down Expand Up @@ -126,7 +127,7 @@ private void updateNotificationsStatus(Space space, String from, String to, Stri
webNotificationFilter.setPluginKey(new PluginKey(pluginId));
List<NotificationInfo> webNotifs = getWebNotificationService().getNotificationInfos(webNotificationFilter, 0, -1);
for (NotificationInfo info : webNotifs) {
if (info.getTo().equals(to) && info.getFrom().equals(from) && !"accepted".equals(info.getOwnerParameter().get("status"))) {
if (info.getTo().equals(to) && (StringUtils.isEmpty(info.getFrom()) || info.getFrom().equals(from)) && !"accepted".equals(info.getOwnerParameter().get("status"))) {
//one element has changed, we need to update
info.setTo(to);
info.setFrom(from);
Expand Down

0 comments on commit 15cfa17

Please sign in to comment.