Avoid SQL errors due to duplicate entries in the "participation" table
This commit is contained in:
parent
480fde7ca8
commit
f23596421d
1 changed files with 4 additions and 1 deletions
|
@ -2211,7 +2211,10 @@ class Diaspora
|
|||
}
|
||||
|
||||
logger('Received participation for ID: '.$item['id'].' - Contact: '.$contact_id.' - Server: '.$server, LOGGER_DEBUG);
|
||||
dba::insert('participation', ['iid' => $item['id'], 'cid' => $contact_id, 'fid' => $person['id'], 'server' => $server]);
|
||||
|
||||
if (!dba::exists('participation', ['iid' => $item['id'], 'server' => $server])) {
|
||||
dba::insert('participation', ['iid' => $item['id'], 'cid' => $contact_id, 'fid' => $person['id'], 'server' => $server]);
|
||||
}
|
||||
|
||||
// Send all existing comments and likes to the requesting server
|
||||
$comments = dba::p("SELECT `item`.`id`, `item`.`verb`, `contact`.`self`
|
||||
|
|
Loading…
Reference in a new issue