'name' => $data['name'],
'nick' => $data['nick']];
- // Only fill the pubkey if it was empty before. We have to prevent identity theft.
- if (!empty($contact['pubkey'])) {
- unset($contact['pubkey']);
- } else {
- $updated['pubkey'] = $data['pubkey'];
- }
-
if ($data['keywords'] != '') {
$updated['keywords'] = $data['keywords'];
}
if ($data['location'] != '') {
$updated['location'] = $data['location'];
}
- if ($data['about'] != '') {
- $updated['about'] = $data['about'];
+
+ // Update the technical stuff as well - if filled
+ if ($data['notify'] != '') {
+ $updated['notify'] = $data['notify'];
+ }
+ if ($data['poll'] != '') {
+ $updated['poll'] = $data['poll'];
+ }
+ if ($data['batch'] != '') {
+ $updated['batch'] = $data['batch'];
+ }
+ if ($data['request'] != '') {
+ $updated['request'] = $data['request'];
+ }
+ if ($data['confirm'] != '') {
+ $updated['confirm'] = $data['confirm'];
+ }
+ if ($data['poco'] != '') {
+ $updated['poco'] = $data['poco'];
+ }
+
+ // Only fill the pubkey if it had been empty before. We have to prevent identity theft.
+ if (empty($contact['pubkey'])) {
+ $updated['pubkey'] = $data['pubkey'];
}
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
}
if (in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""])) {
- $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = %d AND NOT `item`.`global`))";
+ $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = ? AND NOT `item`.`global`))";
} else {
- $sql = "`item`.`uid` = %d";
+ $sql = "`item`.`uid` = ?";
}
$author_id = intval($r[0]["author-id"]);
$contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
- $r = q(item_query(local_user()) . " AND `item`.`" . $contact . "` = %d AND " . $sql .
- " AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d",
- intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST),
- intval($a->pager['start']), intval($a->pager['itemspage'])
- );
+ $condition = ["`$contact` = ? AND `gravity` IN (?, ?) AND " . $sql,
+ $author_id, GRAVITY_PARENT, GRAVITY_COMMENT, local_user()];
+ $params = ['order' => ['created' => true],
+ 'limit' => [$a->pager['start'], $a->pager['itemspage']]];
+ $r = Item::selectForUser(local_user(), [], $condition, $params);
+
+ $items = Item::inArray($r);
- $o = conversation($a, $r, 'contact-posts', false);
+ $o = conversation($a, $items, 'contact-posts', false);
- $o .= alt_pager($a, count($r));
+ $o .= alt_pager($a, count($items));
return $o;
}