コード例 #1
0
  @Override
  public void process(NotificationContext ctx, String... userIds) {
    NotificationInfo notification = ctx.getNotificationInfo();
    String pluginId = notification.getKey().getId();
    UserSettingService userService =
        (UserSettingService)
            ExoContainerContext.getCurrentContainer()
                .getComponentInstanceOfType(UserSettingService.class);

    for (String userId : userIds) {
      UserSetting userSetting = userService.get(userId);
      // check channel active for user
      if (!userSetting.isChannelActive(getChannel().getId())) {
        continue;
      }

      if (userSetting.isActive(getChannel().getId(), pluginId)) {
        process(ctx.setNotificationInfo(notification.clone(true).setTo(userId)), userId);
      }
    }
  }