use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
+use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Module\Login;
use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Proxy as ProxyUtils;
require_once 'include/conversation.php';
require_once 'include/items.php';
return;
}
- $unseen = DBA::exists('item', $condition);
+ $unseen = Item::exists($condition);
if ($unseen) {
$r = Item::update(['unseen' => false], $condition);
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
- 'lockstate' => (((is_array($a->user) &&
- ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
- (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
+ 'lockstate' => (is_array($a->user) &&
+ (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) ||
+ strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
'default_perms' => ACL::getDefaultUserPermissions($a->user),
'acl' => ACL::getFullSelectorHTML($a->user, true),
'bang' => '',
while ($term = DBA::fetch($result)) {
$posts[] = $term['oid'];
}
- DBA::close($terms);
+ DBA::close($result);
$condition = ['uid' => local_user(), 'id' => $posts];
} else {
$gid = 0;
+ $default_permissions = [];
+
if ($a->argc > 1) {
for ($x = 1; $x < $a->argc; $x ++) {
if (is_a_date_arg($a->argv[$x])) {
}
} elseif (intval($a->argv[$x])) {
$gid = intval($a->argv[$x]);
- $def_acl = ['allow_gid' => '<' . $gid . '>'];
+ $default_permissions = ['allow_gid' => '<' . $gid . '>'];
}
}
}
$nets = defaults($_GET, 'nets' , '');
if ($cid) {
- $def_acl = ['allow_cid' => '<' . intval($cid) . '>'];
+ $default_permissions = ['allow_cid' => '<' . intval($cid) . '>'];
}
if ($nets) {
$str .= '<' . $rr['id'] . '>';
}
if (strlen($str)) {
- $def_acl = ['allow_cid' => $str];
+ $default_permissions = ['allow_cid' => $str];
}
}
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
- 'lockstate' => ((($gid) || ($cid) || ($nets) || (is_array($a->user) &&
- ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
- (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
+ 'lockstate' => ($gid || $cid || $nets || (is_array($a->user) &&
+ (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) ||
+ strlen($a->user['deny_cid']) || strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'),
'default_perms' => ACL::getDefaultUserPermissions($a->user),
- 'acl' => ACL::getFullSelectorHTML((($gid || $cid || $nets) ? $def_acl : $a->user), true),
+ 'acl' => ACL::getFullSelectorHTML($a->user, true, $default_permissions),
'bang' => (($gid || $cid || $nets) ? '!' : ''),
'visitor' => 'block',
'profile_uid' => local_user(),
'id' => 'network',
'name' => htmlentities($contact['name']),
'itemurl' => defaults($contact, 'addr', $contact['nurl']),
- 'thumb' => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB),
+ 'thumb' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB),
'details' => $contact['location'],
];
'id' => 'network',
]) . $o;
- if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
+ if ($contact['network'] === Protocol::OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
notice(L10n::t('Private messages to this person are at risk of public disclosure.') . EOL);
}
} else {
FROM `item` $sql_post_table
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
- AND (`item`.`parent-uri` != `item`.`uri`
+ AND (`item`.`gravity` != %d
OR `contact`.`uid` = `item`.`uid` AND `contact`.`self`
OR `contact`.`rel` IN (%d, %d) AND NOT `contact`.`readonly`)
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = %d
AND NOT `item`.`moderated` AND $sql_extra4
$sql_extra3 $sql_extra $sql_range $sql_nets
ORDER BY `order_date` DESC LIMIT 100",
- intval(CONTACT_IS_SHARING),
- intval(CONTACT_IS_FRIEND),
+ intval(GRAVITY_PARENT),
+ intval(Contact::SHARING),
+ intval(Contact::FRIEND),
intval(local_user()),
intval(local_user())
);
STRAIGHT_JOIN `contact` ON `contact`.`id` = `thread`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
STRAIGHT_JOIN `item` ON `item`.`id` = `thread`.`iid`
- AND (`item`.`parent-uri` != `item`.`uri`
+ AND (`item`.`gravity` != %d
OR `contact`.`uid` = `item`.`uid` AND `contact`.`self`
OR `contact`.`rel` IN (%d, %d) AND NOT `contact`.`readonly`)
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = %d
AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
$sql_extra2 $sql_extra3 $sql_range $sql_extra $sql_nets
ORDER BY `order_date` DESC $pager_sql",
- intval(CONTACT_IS_SHARING),
- intval(CONTACT_IS_FRIEND),
+ intval(GRAVITY_PARENT),
+ intval(Contact::SHARING),
+ intval(Contact::FRIEND),
intval(local_user()),
intval(local_user())
);
}
// Only show it when unfiltered (no groups, no networks, ...)
- if (in_array($nets, ['', NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
+ if (in_array($nets, ['', Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]) && (strlen($sql_extra . $sql_extra2 . $sql_extra3) == 0)) {
if (DBA::isResult($r)) {
$top_limit = current($r)['order_date'];
$bottom_limit = end($r)['order_date'];