-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...rc/main/java/com/linagora/tmail/james/app/TMailCleverAttachmentIdAssignationStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/******************************************************************** | ||
* As a subpart of Twake Mail, this file is edited by Linagora. * | ||
* * | ||
* https://twake-mail.com/ * | ||
* https://linagora.com * | ||
* * | ||
* This file is subject to The Affero Gnu Public License * | ||
* version 3. * | ||
* * | ||
* https://www.gnu.org/licenses/agpl-3.0.en.html * | ||
* * | ||
* This program is distributed in the hope that it will be * | ||
* useful, but WITHOUT ANY WARRANTY; without even the implied * | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * | ||
* PURPOSE. See the GNU Affero General Public License for * | ||
* more details. * | ||
********************************************************************/ | ||
package com.linagora.tmail.james.app; | ||
|
||
import org.apache.james.mailbox.cassandra.mail.CassandraAttachmentMapper; | ||
import org.apache.james.mailbox.model.AttachmentId; | ||
import org.apache.james.mailbox.model.MessageId; | ||
import org.apache.james.mailbox.model.ParsedAttachment; | ||
import org.apache.james.mailbox.model.StringBackedAttachmentId; | ||
|
||
public class TMailCleverAttachmentIdAssignationStrategy implements CassandraAttachmentMapper.AttachmentIdAssignationStrategy { | ||
@Override | ||
public AttachmentId assign(ParsedAttachment parsedAttachment, MessageId messageId) { | ||
if (parsedAttachment instanceof TMailCleverParsedAttachment TMailCleverParsedAttachment) { | ||
return StringBackedAttachmentId.from(TMailCleverParsedAttachment.translate(messageId)); | ||
} | ||
return StringBackedAttachmentId.random(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...distributed/src/main/java/com/linagora/tmail/james/app/TMailCleverBlobResolverModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
...rc/main/java/com/linagora/tmail/james/app/TmailCleverAttachmentIdAssignationStrategy.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
...ps/distributed/src/main/scala/com/linagora/tmail/james/app/TMailCleverMessageParser.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters