$notifs = ping_get_notifications(local_user());
- $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ? AND (`vid` != ? OR `vid` IS NULL)",
- local_user(), local_user(), Verb::getID(Activity::FOLLOW)];
- $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar',
- 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall', 'activity'];
- $params = ['order' => ['received' => true]];
- $items = Item::selectForUser(local_user(), $fields, $condition, $params);
-
+ $condition = ["`unseen` AND `uid` = ? AND NOT `origin` AND (`vid` != ? OR `vid` IS NULL)",
+ local_user(), Verb::getID(Activity::FOLLOW)];
+ $items = Item::selectForUser(local_user(), ['wall'], $condition);
if (DBA::isResult($items)) {
$items_unseen = Item::inArray($items);
$arr = ['items' => $items_unseen];
}
}
}
+ DBA::close($items);
if ($network_count) {
// Find out how unseen network posts are spread across groups
$row['key'] . "\t" . $row['rows'] . "\t" . $row['Extra'] . "\t" .
basename($backtrace[1]["file"]) . "\t" .
$backtrace[1]["line"] . "\t" . $backtrace[2]["function"] . "\t" .
- substr($query, 0, 2000) . "\n", FILE_APPEND);
+ substr($query, 0, 4000) . "\n", FILE_APPEND);
}
}
}
@file_put_contents($this->configCache->get('system', 'db_log'), DateTimeFormat::utcNow() . "\t" . $duration . "\t" .
basename($backtrace[1]["file"]) . "\t" .
$backtrace[1]["line"] . "\t" . $backtrace[2]["function"] . "\t" .
- substr($this->replaceParameters($sql, $args), 0, 2000) . "\n", FILE_APPEND);
+ substr($this->replaceParameters($sql, $args), 0, 4000) . "\n", FILE_APPEND);
}
}
return $retval;
DBA::close($contacts);
if (!empty($owner['alias'])) {
- $condition = ['url' => $owner['alias'], 'rel' => [Contact::SHARING, Contact::FRIEND]];
+ $condition = ['nurl' => Strings::normaliseLink($owner['alias']), 'rel' => [Contact::SHARING, Contact::FRIEND]];
$contacts = DBA::select('contact', ['uid'], $condition);
while ($contact = DBA::fetch($contacts)) {
if ($contact['uid'] == 0) {
$condition = ["`network` IN (?, ?, ?, ?) AND `uid` = ? AND NOT `self` AND `last-update` < ?",
Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, 0, $last_updated];
- $total = DBA::count('contact', $condition);
$oldest_date = '';
$oldest_id = '';
$contacts = DBA::select('contact', ['id', 'last-update'], $condition, ['limit' => 100, 'order' => ['last-update']]);
Worker::add(PRIORITY_LOW, "UpdateContact", $contact['id'], 'force');
++$count;
}
- Logger::info('Initiated update for public contacts', ['interval' => $count, 'total' => $total, 'id' => $oldest_id, 'oldest' => $oldest_date]);
+ Logger::info('Initiated update for public contacts', ['interval' => $count, 'id' => $oldest_id, 'oldest' => $oldest_date]);
DBA::close($contacts);
}
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1355);
+ define('DB_UPDATE_VERSION', 1356);
}
return [
"attag_uid" => ["attag(32)", "uid"],
"dfrn-id" => ["dfrn-id(64)"],
"issued-id" => ["issued-id(64)"],
+ "network_uid_lastupdate" => ["network", "uid", "last-update"],
"gsid" => ["gsid"]
]
],
"addr" => ["addr(32)"],
"alias" => ["alias(190)"],
"followers" => ["followers(190)"],
+ "baseurl" => ["baseurl(190)"],
"gsid" => ["gsid"]
]
],