Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-4502

MailManager: avoid adding an email address twice

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 14.2
    • Fix Version/s: 14.2.1
    • Component/s: Mail, Mailbox
    • Labels:
      None

      Description

      I noticed that if a user gets a change email address email the recipient address appears twice:

      This patch avoids that:

      diff --git a/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java b/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java
      index f90118f..9b400e4 100644
      --- a/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java
      +++ b/src/main/java/org/olat/core/util/mail/manager/MailManagerImpl.java
      @@ -1393,7 +1393,7 @@
       	
       	private boolean createAddress(List<Address> addressList, String address) throws AddressException {
       		Address add = createAddress(address);
      -		if(add != null) {
      +		if(add != null && !addressList.contains(add)) {
       			addressList.add(add);
       		}
       		return true;
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: