Skip to content

Commit

Permalink
fix announcement notification. (#17793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhanttimeline authored Sep 11, 2024
1 parent e7cfa48 commit 052430e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,15 @@ default OutgoingMessage createThreadMessage(String publisherName, ChangeEvent ev
String.format(
"Ends At : %s", getDateString(thread.getAnnouncement().getEndTime())));
}
case ENTITY_DELETED -> {
headerMessage =
String.format(
"[%s] **@%s** posted an update on **Announcement**",
publisherName, thread.getUpdatedBy());
attachmentList.add(
String.format(
"Announcement Deleted: %s", thread.getAnnouncement().getDescription()));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,22 +372,31 @@ public static Set<String> getTargetsForAlert(
handleConversationNotification(category, type, event));
// TODO: For Announcement, Immediate Consumer needs to be Notified (find information from
// Lineage)
case Announcement -> {
receiverUrls.addAll(buildReceivers(action, category, type, event, event.getEntityId()));
}
}
} else {
EntityInterface entityInterface = getEntity(event);
receiverUrls.addAll(
buildReceiversListFromActions(
action,
category,
type,
Entity.getCollectionDAO(),
entityInterface.getId(),
event.getEntityType()));
receiverUrls.addAll(buildReceivers(action, category, type, event, entityInterface.getId()));
}

return receiverUrls;
}

private static Set<String> buildReceivers(
SubscriptionAction action,
SubscriptionDestination.SubscriptionCategory category,
SubscriptionDestination.SubscriptionType type,
ChangeEvent event,
UUID id) {
Set<String> result = new HashSet<>();
result.addAll(
buildReceiversListFromActions(
action, category, type, Entity.getCollectionDAO(), id, event.getEntityType()));
return result;
}

public static List<Invocation.Builder> getTargetsForWebhookAlert(
SubscriptionAction action,
SubscriptionDestination.SubscriptionCategory category,
Expand Down

0 comments on commit 052430e

Please sign in to comment.