<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
// It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033
// It is not removed by now. Possibly the code is needed?
//if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(User::PAGE_FLAGS_FREELOVE))) {
- // DBA::update(
- // 'contact',
+ // Contact::update(
// array('rel' => Contact::FRIEND, 'writable' => true),
// array('id' => $contact["id"], 'uid' => $contact["uid"])
// );
} elseif (($contact["rel"] == Contact::SHARING) || ($contact["rel"] == Contact::FRIEND)) {
// Yes, then it is fine.
return true;
- // Is it a post to a community?
- } elseif (($contact["rel"] == Contact::FOLLOWER) && in_array($importer["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
- // That's good
- return true;
// Is the message a global user or a comment?
} elseif (($importer["uid"] == 0) || $is_comment) {
// Messages for the global users and comments are always accepted
private static function receiveRequestMakeFriend(array $importer, array $contact)
{
if ($contact["rel"] == Contact::SHARING) {
- DBA::update(
- 'contact',
+ Contact::update(
['rel' => Contact::FRIEND, 'writable' => true],
['id' => $contact["id"], 'uid' => $importer["uid"]]
);
$datarray["object-type"] = Activity\ObjectType::IMAGE;
$datarray["post-type"] = Item::PT_IMAGE;
+ } elseif ($data->poll) {
+ $datarray["object-type"] = Activity\ObjectType::NOTE;
+ $datarray["post-type"] = Item::PT_POLL;
} else {
$datarray["object-type"] = Activity\ObjectType::NOTE;
$datarray["post-type"] = Item::PT_NOTE;
private static function prependParentAuthorMention($body, $profile_url)
{
- $profile = Contact::getByURL($profile_url, false, ['addr', 'name', 'contact-type']);
+ $profile = Contact::getByURL($profile_url, false, ['addr', 'name']);
if (!empty($profile['addr'])
- && $profile['contact-type'] != Contact::TYPE_COMMUNITY
&& !strstr($body, $profile['addr'])
&& !strstr($body, $profile_url)
) {