mirror of
https://github.com/friendica/friendica
synced 2025-04-28 21:04:22 +02:00
All item selects are now done by the post class
This commit is contained in:
parent
2d0443a109
commit
b892db0cf3
16 changed files with 108 additions and 688 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Model\Contact;
|
|||
use Exception;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\APContact;
|
||||
|
@ -64,7 +65,7 @@ class Relation
|
|||
return;
|
||||
}
|
||||
|
||||
DBA::update('contact-relation', ['last-interaction' => $interaction_date], ['cid' => $target, 'relation-cid' => $actor], true);
|
||||
DBA::insert('contact-relation', ['last-interaction' => $interaction_date, 'cid' => $target, 'relation-cid' => $actor], Database::INSERT_UPDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,14 +137,14 @@ class Relation
|
|||
$actor = Contact::getIdForURL($contact);
|
||||
if (!empty($actor)) {
|
||||
if (in_array($contact, $followers)) {
|
||||
$fields = ['cid' => $target, 'relation-cid' => $actor];
|
||||
DBA::update('contact-relation', ['follows' => true, 'follow-updated' => DateTimeFormat::utcNow()], $fields, true);
|
||||
$fields = ['cid' => $target, 'relation-cid' => $actor, 'follows' => true, 'follow-updated' => DateTimeFormat::utcNow()];
|
||||
DBA::insert('contact-relation', $fields, Database::INSERT_UPDATE);
|
||||
$follower_counter++;
|
||||
}
|
||||
|
||||
if (in_array($contact, $followings)) {
|
||||
$fields = ['cid' => $actor, 'relation-cid' => $target];
|
||||
DBA::update('contact-relation', ['follows' => true, 'follow-updated' => DateTimeFormat::utcNow()], $fields, true);
|
||||
$fields = ['cid' => $actor, 'relation-cid' => $target, 'follows' => true, 'follow-updated' => DateTimeFormat::utcNow()];
|
||||
DBA::insert('contact-relation', $fields, Database::INSERT_UPDATE);
|
||||
$following_counter++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue