use Friendica\Model\ItemContent;
use Friendica\Model\User;
use Friendica\Object\Image;
+use Friendica\Protocol\Activity;
use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
}
}
- if (($b['verb'] == ACTIVITY_POST) && $b['deleted']) {
+ if (($b['verb'] == Activity::POST) && $b['deleted']) {
twitter_action($a, $b["uid"], substr($orig_post["uri"], 9), "delete");
}
- if ($b['verb'] == ACTIVITY_LIKE) {
+ if ($b['verb'] == Activity::LIKE) {
Logger::log("twitter_post_hook: parameter 2 " . substr($b["thr-parent"], 9), Logger::DEBUG);
if ($b['deleted']) {
twitter_action($a, $b["uid"], substr($b["thr-parent"], 9), "unlike");
$media[$medium->url] .= "\n[img]" . $medium->media_url_https . '[/img]';
}
- $postarray['object-type'] = ACTIVITY_OBJ_IMAGE;
+ $postarray['object-type'] = Activity\ObjectType::IMAGE;
break;
case 'video':
case 'animated_gif':
$media[$medium->url] .= "\n[img]" . $medium->media_url_https . '[/img]';
}
- $postarray['object-type'] = ACTIVITY_OBJ_VIDEO;
+ $postarray['object-type'] = Activity\ObjectType::VIDEO;
if (is_array($medium->video_info->variants)) {
$bitrate = 0;
// We take the video with the highest bitrate
$postarray['thr-parent'] = $parent_item['uri'];
$postarray['parent-uri'] = $parent_item['parent-uri'];
$postarray['parent'] = $parent_item['parent'];
- $postarray['object-type'] = ACTIVITY_OBJ_COMMENT;
+ $postarray['object-type'] = Activity\ObjectType::COMMENT;
} else {
$postarray['thr-parent'] = $postarray['uri'];
$postarray['parent-uri'] = $postarray['uri'];
- $postarray['object-type'] = ACTIVITY_OBJ_NOTE;
+ $postarray['object-type'] = Activity\ObjectType::NOTE;
}
// Is it me?
$create_user = false;
} else {
$postarray['parent-uri'] = $postarray['uri'];
- $postarray['object-type'] = ACTIVITY_OBJ_NOTE;
+ $postarray['object-type'] = Activity\ObjectType::NOTE;
}
if ($contactid == 0) {
$postarray['contact-id'] = $contactid;
- $postarray['verb'] = ACTIVITY_POST;
+ $postarray['verb'] = Activity::POST;
$postarray['author-name'] = $postarray['owner-name'];
$postarray['author-link'] = $postarray['owner-link'];
$postarray['author-avatar'] = $postarray['owner-avatar'];
// When the post contains links then use the correct object type
if (count($post->entities->urls) > 0) {
- $postarray['object-type'] = ACTIVITY_OBJ_BOOKMARK;
+ $postarray['object-type'] = Activity\ObjectType::BOOKMARK;
}
// Search for media links
Item::insert($retweet);
// CHange the other post into a reshare activity
- $postarray['verb'] = ACTIVITY2_ANNOUNCE;
+ $postarray['verb'] = Activity::ANNOUNCE;
$postarray['gravity'] = GRAVITY_ACTIVITY;
- $postarray['object-type'] = ACTIVITY_OBJ_NOTE;
+ $postarray['object-type'] = Activity\ObjectType::NOTE;
$postarray['thr-parent'] = $retweet['uri'];
$postarray['parent-uri'] = $retweet['uri'];