Skip to content

Store the references, in-reply-to and the thread root id#3337

Merged
ChristophWurst merged 1 commit into
masterfrom
enhancement/in-reply-to-references-thread-id
Jul 6, 2020
Merged

Store the references, in-reply-to and the thread root id#3337
ChristophWurst merged 1 commit into
masterfrom
enhancement/in-reply-to-references-thread-id

Conversation

@ChristophWurst

@ChristophWurst ChristophWurst commented Jul 1, 2020

Copy link
Copy Markdown
Member

For #17, extracted from #2125.

This stores the raw values of In-Reply-To and References in the database as well as the Message-ID of the root element of a message thread. The default is the own (but parsed) message-id, like if the message was its own root. In a follow-up PR I'll finish the algorithm (possibly in #2125) to update this reference if a new root is found. The goal is to have the root as stable as possible and the threading algorithm should make that possible in most cases, we we only have to update this field once.

@nextcloud/mail please review

Steps to test

  1. Check out the branch
  2. Run the migration
  3. See that new messages have these three attributes populated

Comment thread lib/Db/Message.php Outdated
Comment thread lib/Db/MessageMapper.php
Comment thread lib/Migration/Version1050Date20200624101359.php
Comment thread lib/Model/IMAPMessage.php

$msg->setUid($this->getUid());
$msg->setMessageId($this->getMessageId());
$msg->setReferences($this->getRawReferences());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just thinking here if it would make sense to split them already and just store it as json or something? Basically process on input. So that you don't have to do it every time afterwards? But just a suggestion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I was also thinking about that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just do that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is the other way around right? Now you still store them flat and process on setting it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are parsed and set once during the insert. What would you like to see different? The layer at which the parsing happens?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I'm just stupid then

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the enhancement/in-reply-to-references-thread-id branch from bbf8e42 to dc2cd0c Compare July 3, 2020 14:38
Comment thread lib/Model/IMAPMessage.php

$msg->setUid($this->getUid());
$msg->setMessageId($this->getMessageId());
$msg->setReferences($this->getRawReferences());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I'm just stupid then

@ChristophWurst ChristophWurst merged commit 6bf5354 into master Jul 6, 2020
@ChristophWurst ChristophWurst deleted the enhancement/in-reply-to-references-thread-id branch July 6, 2020 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants