X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FEvent.php;h=6f77832209274a12360fa5ff33c3e63d7800d8d6;hb=f2c1ecd19bb344137a91faab58d9a2524e0c8893;hp=5aa2f2488f4660756d426f23a7b1e396b5606bd6;hpb=0ea93bfba14d708d1e9f5b747f406b6f39f97ff4;p=friendica.git
diff --git a/src/Model/Event.php b/src/Model/Event.php
index 5aa2f2488f..6f77832209 100644
--- a/src/Model/Event.php
+++ b/src/Model/Event.php
@@ -344,7 +344,6 @@ class Event
$event['id'] = $event_id;
$item['uid'] = $event['uid'];
- $item['contact-id'] = $event['cid'];
$item['uri'] = $event['uri'];
$item['uri-id'] = ItemURI::getIdByURI($event['uri']);
$item['guid'] = $event['guid'];
@@ -363,11 +362,10 @@ class Event
$item['allow_gid'] = $event['allow_gid'];
$item['deny_cid'] = $event['deny_cid'];
$item['deny_gid'] = $event['deny_gid'];
- $item['private'] = intval($event['private'] ?? 0);
+ $item['private'] = $event['allow_cid'] && $event['allow_gid'] && $event['deny_cid'] && $event['deny_gid'] ? 0 : 1;
$item['visible'] = 1;
$item['verb'] = Activity::POST;
$item['object-type'] = Activity\ObjectType::EVENT;
- $item['post-type'] = Item::PT_EVENT;
$item['origin'] = $event['cid'] === 0 ? 1 : 0;
$item['body'] = self::getBBCode($event);
$item['event-id'] = $event['id'];
@@ -547,8 +545,8 @@ class Event
// Query for the event by event id
$events = DBA::toArray(DBA::p(
"SELECT `event`.*, `post-user`.`id` AS `itemid` FROM `event`
- LEFT JOIN `post-user`
- ON `post-user`.`event-id` = `event`.`id`
+ LEFT JOIN `post-user`
+ ON `post-user`.`event-id` = `event`.`id`
AND `post-user`.`uid` = `event`.`uid`
WHERE `event`.`id` = ?
AND `event`.`uid` = ?
@@ -932,9 +930,9 @@ class Event
// Construct the profile link (magic-auth).
$author = [
- 'uid' => 0,
+ 'uid' => 0,
'id' => $item['author-id'],
- 'network' => $item['author-network'],
+ 'network' => $item['author-network'],
'url' => $item['author-link'],
'alias' => $item['author-alias']
];
@@ -978,7 +976,7 @@ class Event
* Note: The string must only contain location data. A string with no bbcode will be
* handled as location name.
*
- * @param string $s The string with the bbcode formatted location data.
+ * @param string $s The string with the bbcode formatted location data.
*
* @return array The array with the location data.
* 'name' => The name of the location,
@@ -986,7 +984,7 @@ class Event
* 'coordinates' => Latitude and longitude (e.g. '48.864716,2.349014').
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private static function locationToArray(string $s): array
+ private static function locationToArray(string $s = ''): array
{
if ($s == '') {
return [];
@@ -1012,7 +1010,7 @@ class Event
}
}
- $location['name'] = BBCode::toPlaintext($location['name'], false, true);
+ $location['name'] = BBCode::toPlaintext($location['name'], false);
// Construct the map HTML.
if (isset($location['address'])) {