forked from friendica/friendica-addons
Add docs
This commit is contained in:
parent
a555820111
commit
9bd0609625
|
@ -997,11 +997,11 @@ function pumpio_dolike(App $a, $uid, $self, $post, $own_id, $threadcompletion =
|
||||||
$objauthor = '[url=' . $orig_post['author-link'] . ']' . $orig_post['author-name'] . '[/url]';
|
$objauthor = '[url=' . $orig_post['author-link'] . ']' . $orig_post['author-name'] . '[/url]';
|
||||||
$post_type = L10n::t('status');
|
$post_type = L10n::t('status');
|
||||||
$plink = '[url=' . $orig_post['plink'] . ']' . $post_type . '[/url]';
|
$plink = '[url=' . $orig_post['plink'] . ']' . $post_type . '[/url]';
|
||||||
$likedata['object-type'] = Activity::OBJ_NOTE;
|
$likedata['object-type'] = Activity\ObjectType::NOTE;
|
||||||
|
|
||||||
$likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink);
|
$likedata['body'] = L10n::t('%1$s likes %2$s\'s %3$s', $author, $objauthor, $plink);
|
||||||
|
|
||||||
$likedata['object'] = '<object><type>' . Activity::OBJ_NOTE . '</type><local>1</local>' .
|
$likedata['object'] = '<object><type>' . Activity\ObjectType::NOTE . '</type><local>1</local>' .
|
||||||
'<id>' . $orig_post['uri'] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . XML::escape($orig_post['plink']) . '" />') . '</link><title>' . $orig_post['title'] . '</title><content>' . $orig_post['body'] . '</content></object>';
|
'<id>' . $orig_post['uri'] . '</id><link>' . XML::escape('<link rel="alternate" type="text/html" href="' . XML::escape($orig_post['plink']) . '" />') . '</link><title>' . $orig_post['title'] . '</title><content>' . $orig_post['body'] . '</content></object>';
|
||||||
|
|
||||||
$ret = Item::insert($likedata);
|
$ret = Item::insert($likedata);
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
define('STATUSNET_DEFAULT_POLL_INTERVAL', 5); // given in minutes
|
define('STATUSNET_DEFAULT_POLL_INTERVAL', 5); // given in minutes
|
||||||
|
|
||||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'statusnetoauth.php';
|
require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'statusnetoauth.php';
|
||||||
|
|
||||||
use CodebirdSN\CodebirdSN;
|
use CodebirdSN\CodebirdSN;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
use Friendica\Content\OEmbed;
|
use Friendica\Content\OEmbed;
|
||||||
|
@ -48,7 +49,6 @@ use Friendica\Core\Logger;
|
||||||
use Friendica\Core\PConfig;
|
use Friendica\Core\PConfig;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Group;
|
use Friendica\Model\Group;
|
||||||
|
@ -1140,11 +1140,11 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex
|
||||||
$postarray['thr-parent'] = $item['uri'];
|
$postarray['thr-parent'] = $item['uri'];
|
||||||
$postarray['parent-uri'] = $item['parent-uri'];
|
$postarray['parent-uri'] = $item['parent-uri'];
|
||||||
$postarray['parent'] = $item['parent'];
|
$postarray['parent'] = $item['parent'];
|
||||||
$postarray['object-type'] = Activity::OBJ_COMMENT;
|
$postarray['object-type'] = Activity\ObjectType::COMMENT;
|
||||||
} else {
|
} else {
|
||||||
$postarray['thr-parent'] = $postarray['uri'];
|
$postarray['thr-parent'] = $postarray['uri'];
|
||||||
$postarray['parent-uri'] = $postarray['uri'];
|
$postarray['parent-uri'] = $postarray['uri'];
|
||||||
$postarray['object-type'] = Activity::OBJ_NOTE;
|
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is it me?
|
// Is it me?
|
||||||
|
@ -1168,7 +1168,7 @@ function statusnet_createpost(App $a, $uid, $post, $self, $create_user, $only_ex
|
||||||
$create_user = false;
|
$create_user = false;
|
||||||
} else {
|
} else {
|
||||||
$postarray['parent-uri'] = $postarray['uri'];
|
$postarray['parent-uri'] = $postarray['uri'];
|
||||||
$postarray['object-type'] = Activity::OBJ_NOTE;
|
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contactid == 0) {
|
if ($contactid == 0) {
|
||||||
|
|
|
@ -1341,7 +1341,7 @@ function twitter_media_entities($post, array &$postarray)
|
||||||
$media[$medium->url] .= "\n[img]" . $medium->media_url_https . '[/img]';
|
$media[$medium->url] .= "\n[img]" . $medium->media_url_https . '[/img]';
|
||||||
}
|
}
|
||||||
|
|
||||||
$postarray['object-type'] = Activity::OBJ_IMAGE;
|
$postarray['object-type'] = Activity\ObjectType::IMAGE;
|
||||||
break;
|
break;
|
||||||
case 'video':
|
case 'video':
|
||||||
case 'animated_gif':
|
case 'animated_gif':
|
||||||
|
@ -1352,7 +1352,7 @@ function twitter_media_entities($post, array &$postarray)
|
||||||
$media[$medium->url] .= "\n[img]" . $medium->media_url_https . '[/img]';
|
$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)) {
|
if (is_array($medium->video_info->variants)) {
|
||||||
$bitrate = 0;
|
$bitrate = 0;
|
||||||
// We take the video with the highest bitrate
|
// We take the video with the highest bitrate
|
||||||
|
@ -1409,11 +1409,11 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
$postarray['thr-parent'] = $parent_item['uri'];
|
$postarray['thr-parent'] = $parent_item['uri'];
|
||||||
$postarray['parent-uri'] = $parent_item['parent-uri'];
|
$postarray['parent-uri'] = $parent_item['parent-uri'];
|
||||||
$postarray['parent'] = $parent_item['parent'];
|
$postarray['parent'] = $parent_item['parent'];
|
||||||
$postarray['object-type'] = Activity::OBJ_COMMENT;
|
$postarray['object-type'] = Activity\ObjectType::COMMENT;
|
||||||
} else {
|
} else {
|
||||||
$postarray['thr-parent'] = $postarray['uri'];
|
$postarray['thr-parent'] = $postarray['uri'];
|
||||||
$postarray['parent-uri'] = $postarray['uri'];
|
$postarray['parent-uri'] = $postarray['uri'];
|
||||||
$postarray['object-type'] = Activity::OBJ_NOTE;
|
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is it me?
|
// Is it me?
|
||||||
|
@ -1438,7 +1438,7 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
$create_user = false;
|
$create_user = false;
|
||||||
} else {
|
} else {
|
||||||
$postarray['parent-uri'] = $postarray['uri'];
|
$postarray['parent-uri'] = $postarray['uri'];
|
||||||
$postarray['object-type'] = Activity::OBJ_NOTE;
|
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contactid == 0) {
|
if ($contactid == 0) {
|
||||||
|
@ -1481,7 +1481,7 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
|
|
||||||
// When the post contains links then use the correct object type
|
// When the post contains links then use the correct object type
|
||||||
if (count($post->entities->urls) > 0) {
|
if (count($post->entities->urls) > 0) {
|
||||||
$postarray['object-type'] = Activity::OBJ_BOOKMARK;
|
$postarray['object-type'] = Activity\ObjectType::BOOKMARK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search for media links
|
// Search for media links
|
||||||
|
@ -1521,7 +1521,7 @@ function twitter_createpost(App $a, $uid, $post, array $self, $create_user, $onl
|
||||||
// CHange the other post into a reshare activity
|
// CHange the other post into a reshare activity
|
||||||
$postarray['verb'] = Activity::ANNOUNCE;
|
$postarray['verb'] = Activity::ANNOUNCE;
|
||||||
$postarray['gravity'] = GRAVITY_ACTIVITY;
|
$postarray['gravity'] = GRAVITY_ACTIVITY;
|
||||||
$postarray['object-type'] = Activity::OBJ_NOTE;
|
$postarray['object-type'] = Activity\ObjectType::NOTE;
|
||||||
|
|
||||||
$postarray['thr-parent'] = $retweet['uri'];
|
$postarray['thr-parent'] = $retweet['uri'];
|
||||||
$postarray['parent-uri'] = $retweet['uri'];
|
$postarray['parent-uri'] = $retweet['uri'];
|
||||||
|
|
Loading…
Reference in a new issue