use Friendica\Core\L10n;
use Friendica\Database\Database;
+use Friendica\Model\Contact;
/**
* tool to find and merge duplicated contact entries.
{
$first = $this->dba->selectFirst('contact', ['id', 'nurl', 'url'], ["`uri-id` = ? AND `nurl` != ? AND `url` != ?", $uriid, '', ''], ['order' => ['id']]);
if (empty($first)) {
- $this->err($this->l10n->t('No valid first countact found for uri-id %d.', $uriid));
+ $this->err($this->l10n->t('No valid first contact found for uri-id %d.', $uriid));
return;
}
$this->out($first['url']);
$this->updateTable('post-thread-user', 'contact-id', $from, $to, false);
$this->updateTable('user-contact', 'cid', $from, $to, true);
- if (!$this->dba->delete('contact', ['id' => $from])) {
+ if (!Contact::deleteById($from)) {
$this->err($this->l10n->t('Deletion of id %d failed', $from));
} else {
$this->out($this->l10n->t('Deletion of id %d was successful', $from));