feat: add snooze mvp - #8694
Conversation
ChristophWurst
left a comment
There was a problem hiding this comment.
Early architectural nitpicking 鉁旓笍
| $now = $this->timeFactory->getTime(); | ||
| $snooze = new MessageSnooze(); | ||
| $snooze->setMessageId($message->getMessageId()); | ||
| $snooze->setSnoozedUntil($now); | ||
| $this->messageSnoozeMapper->insert($snooze); |
| return new JSONResponse([], Http::STATUS_FORBIDDEN); | ||
| } | ||
|
|
||
| $this->snoozeService->snoozeThread($selectedMessage, $unixTimestamp); |
There was a problem hiding this comment.
pretty cool that a whole thread can be snoozed as well :)
ChristophWurst
left a comment
There was a problem hiding this comment.
Code looks super clean! Will also give this a test shortly
| $rows = array_map(static function (array $row) { | ||
| return [ | ||
| 'messageId' => (string)$row[0] | ||
| ]; | ||
| }, $result->fetchAll(\PDO::FETCH_NUM)); |
There was a problem hiding this comment.
| use OCP\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
|
|
||
| class Version3300Date20230807300513 extends SimpleMigrationStep { |
There was a problem hiding this comment.
| class Version3300Date20230807300513 extends SimpleMigrationStep { | |
| class Version3400Date20230807300513 extends SimpleMigrationStep { |
because the next minor will be 3.4. 3.3 has already been branched off
ChristophWurst
left a comment
There was a problem hiding this comment.
bump the version in info.xml so that the backrground job is inserted and the migration run automatically
ChristophWurst
left a comment
There was a problem hiding this comment.
Works!
Message can be snoozed (moved) 鉁旓笍
When timestamp expires (updated the database) the message move back 鉁旓笍
be3fbdd to
bbda253
Compare
|
馃槵 needs rebase onto latest main to get rid of the conflicts |
f882dd2 to
26de4f8
Compare
| 'length' => 4, | ||
| ]); | ||
| $messagesRetentionTable->setPrimaryKey(['id'], 'mail_msg_snoozed_id_idx'); | ||
| $messagesRetentionTable->addIndex(['message_id'], 'mail_msg_snoozed_msgid_idx'); |
There was a problem hiding this comment.
should we make it unique? two entries don't make any sense
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
26de4f8 to
e16b6a7
Compare
fix: #2048