$nurls = q(
"SELECT `id`, `nurl` FROM `contact` WHERE `uid`= %d AND `profile-id` = %d",
intval(api_user()),
- intval($rr['profile_id'])
+ intval($rr['id'])
);
foreach ($nurls as $nurl) {
while ($term = DBA::fetch($result)) {
$posts[] = $term['oid'];
}
- DBA::close($terms);
+ DBA::close($result);
$condition = ['uid' => local_user(), 'id' => $posts];
} else {
function smilies_content(App $a)
{
$smilies = Smilies::getList();
- if ($a->argv[1] === "json") {
+ if (!empty($a->argv[1]) && ($a->argv[1] === "json")) {
$results = [];
for ($i = 0; $i < count($smilies['texts']); $i++) {
$results[] = ['text' => $smilies['texts'][$i], 'icon' => $smilies['icons'][$i]];
*/
public static function markForArchival(array $contact)
{
+
+ if (!isset($contact['url'])) {
+ logger('Empty contact. ' . System::callstack(10), LOGGER_DEBUG);
+ }
+
// Contact already archived or "self" contact? => nothing to do
if ($contact['archive'] || $contact['self']) {
return;
if (!empty($webfinger["aliases"]) && is_array($webfinger["aliases"])) {
foreach ($webfinger["aliases"] as $alias) {
- if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
+ if (empty($data["url"]) && !strstr($alias, "@")) {
+ $data["url"] = $alias;
+ } elseif (!strstr($alias, "@") && normalise_link($alias) != normalise_link($data["url"])) {
$data["alias"] = $alias;
} elseif (substr($alias, 0, 5) == 'acct:') {
$data["addr"] = substr($alias, 5);
$author["avatar"] = current($avatarlist);
}
+ if (empty($author['avatar']) && !empty($author['link'])) {
+ $cid = Contact::getIdForURL($author['link'], 0);
+ if (!empty($cid)) {
+ $contact = DBA::selectFirst('contact', ['avatar'], ['id' => $cid]);
+ if (DBA::isResult($contact)) {
+ $author['avatar'] = $contact['avatar'];
+ }
+ }
+ }
+
if (DBA::isResult($contact_old) && !$onlyfetch) {
logger("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.", LOGGER_DEBUG);