Merge branch 'friendica:develop' into mastodon-api-reshare-fixes

This commit is contained in:
Hank G 2023-08-15 11:57:28 -04:00 committed by GitHub
commit f879b2c9bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 29 deletions

View File

@ -6,28 +6,28 @@ User specific public contact data
Fields Fields
------ ------
| Field | Description | Type | Null | Key | Default | Extra | | Field | Description | Type | Null | Key | Default | Extra |
| ------------------------- | ------------------------------------------------------------ | ------------------ | ---- | --- | ------- | ----- | | ------------------------- | ----------------------------------------------------------------------- | ------------------ | ---- | --- | ------- | ----- |
| cid | Contact id of the linked public contact | int unsigned | NO | PRI | 0 | | | cid | Contact id of the linked public contact | int unsigned | NO | PRI | 0 | |
| uid | User id | mediumint unsigned | NO | PRI | 0 | | | uid | User id | mediumint unsigned | NO | PRI | 0 | |
| uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | | | uri-id | Id of the item-uri table entry that contains the contact url | int unsigned | YES | | NULL | |
| blocked | Contact is completely blocked for this user | boolean | YES | | NULL | | | blocked | Contact is completely blocked for this user | boolean | YES | | NULL | |
| ignored | Posts from this contact are ignored | boolean | YES | | NULL | | | ignored | Posts from this contact are ignored | boolean | YES | | NULL | |
| collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | | | collapsed | Posts from this contact are collapsed | boolean | YES | | NULL | |
| hidden | This contact is hidden from the others | boolean | YES | | NULL | | | hidden | This contact is hidden from the others | boolean | YES | | NULL | |
| is-blocked | User is blocked by this contact | boolean | YES | | NULL | | | is-blocked | User is blocked by this contact | boolean | YES | | NULL | |
| pending | | boolean | YES | | NULL | | | pending | | boolean | YES | | NULL | |
| rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | NULL | | | rel | The kind of the relation between the user and the contact | tinyint unsigned | YES | | NULL | |
| info | | mediumtext | YES | | NULL | | | info | | mediumtext | YES | | NULL | |
| notify_new_posts | | boolean | YES | | NULL | | | notify_new_posts | | boolean | YES | | NULL | |
| remote_self | | boolean | YES | | NULL | | | remote_self | 0 => No mirroring, 1-2 => Mirror as own post, 3 => Mirror as reshare | tinyint unsigned | YES | | NULL | |
| fetch_further_information | | tinyint unsigned | YES | | NULL | | | fetch_further_information | 0 => None, 1 => Fetch information, 3 => Fetch keywords, 2 => Fetch both | tinyint unsigned | YES | | NULL | |
| ffi_keyword_denylist | | text | YES | | NULL | | | ffi_keyword_denylist | | text | YES | | NULL | |
| subhub | | boolean | YES | | NULL | | | subhub | | boolean | YES | | NULL | |
| hub-verify | | varbinary(383) | YES | | NULL | | | hub-verify | | varbinary(383) | YES | | NULL | |
| protocol | Protocol of the contact | char(4) | YES | | NULL | | | protocol | Protocol of the contact | char(4) | YES | | NULL | |
| rating | Automatically detected feed poll frequency | tinyint | YES | | NULL | | | rating | Automatically detected feed poll frequency | tinyint | YES | | NULL | |
| priority | Feed poll priority | tinyint unsigned | YES | | NULL | | | priority | Feed poll priority | tinyint unsigned | YES | | NULL | |
Indexes Indexes
------------ ------------

View File

@ -1365,6 +1365,17 @@ class Worker
return $new_retrial; return $new_retrial;
} }
/**
* Get the number of retrials for the current worker task
*
* @return integer
*/
public static function getRetrial(): int
{
$queue = DI::app()->getQueue();
return $queue['retrial'] ?? 0;
}
/** /**
* Defers the current worker entry * Defers the current worker entry
* *

View File

@ -126,7 +126,7 @@ class Emailer
* @return bool * @return bool
* @throws InternalServerErrorException * @throws InternalServerErrorException
*/ */
public function send(IEmail $email) public function send(IEmail $email): bool
{ {
Hook::callAll('emailer_send_prepare', $email); Hook::callAll('emailer_send_prepare', $email);
@ -151,7 +151,7 @@ class Emailer
} }
$fromName = Email::encodeHeader(html_entity_decode($email->getFromName(), ENT_QUOTES, 'UTF-8'), 'UTF-8'); $fromName = Email::encodeHeader(html_entity_decode($email->getFromName(), ENT_QUOTES, 'UTF-8'), 'UTF-8');
$fromAddress = $email->getFromAddress(); $fromAddress = $email->getFromAddress();
$replyTo = $email->getReplyTo(); $replyTo = $email->getReplyTo();
$messageSubject = Email::encodeHeader(html_entity_decode($email->getSubject(), ENT_QUOTES, 'UTF-8'), 'UTF-8'); $messageSubject = Email::encodeHeader(html_entity_decode($email->getSubject(), ENT_QUOTES, 'UTF-8'), 'UTF-8');
@ -161,12 +161,17 @@ class Emailer
. rand(100000000, 999999999) . '=:' . rand(100000000, 999999999) . '=:'
. rand(10000, 99999); . rand(10000, 99999);
$messageHeader = $email->getAdditionalMailHeaderString();
if ($countMessageId === 0) {
$messageHeader .= 'Message-ID: <Friendica-Util-Emailer-' . Strings::getRandomHex() . '@' . $this->baseUrl->getHost() . '>' . "\r\n";
}
// generate a multipart/alternative message header // generate a multipart/alternative message header
$messageHeader = $email->getAdditionalMailHeaderString() . $messageHeader .=
"From: $fromName <{$fromAddress}>\r\n" . "From: $fromName <{$fromAddress}>\r\n" .
"Reply-To: $fromName <{$replyTo}>\r\n" . "Reply-To: $fromName <{$replyTo}>\r\n" .
"MIME-Version: 1.0\r\n" . "MIME-Version: 1.0\r\n" .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\""; "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
// assemble the final multipart message body with the text and html types included // assemble the final multipart message body with the text and html types included
$textBody = chunk_split(base64_encode($email->getMessage(true))); $textBody = chunk_split(base64_encode($email->getMessage(true)));

View File

@ -21,6 +21,7 @@
namespace Friendica\Worker; namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -146,6 +147,8 @@ class Cron
// Update "blocked" status of servers // Update "blocked" status of servers
Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers'); Worker::add(Worker::PRIORITY_LOW, 'UpdateBlockedServers');
Addon::reload();
DI::keyValue()->set('last_cron_daily', time()); DI::keyValue()->set('last_cron_daily', time());
} }