*/
use Friendica\App;
+use Friendica\Content\OEmbed;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Model\GContact;
+use Friendica\Model\Group;
use Friendica\Model\Photo;
+use Friendica\Model\User;
use Friendica\Object\Image;
require_once 'include/enotify.php';
PConfig::set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']);
PConfig::set(local_user(), 'twitter', 'post', 1);
// reload the Addon Settings page, if we don't do it see Bug #42
- goaway($a->get_baseurl() . '/settings/connectors');
+ goaway('settings/connectors');
} else {
// if no PIN is supplied in the POST variables, the user has changed the setting
// to post a tweet for every new __public__ posting to the wall
$max_char = 280;
require_once "include/plaintext.php";
- $msgarr = plaintext($a, $b, $max_char, true, 8);
+ $msgarr = plaintext($b, $max_char, true, 8);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) {
// -----------------
$max_char = 280;
require_once "include/plaintext.php";
- $msgarr = plaintext($a, $b, $max_char, true, 8);
+ $msgarr = plaintext($b, $max_char, true, 8);
$msg = $msgarr["text"];
if (($msg == "") && isset($msgarr["title"])) {
}
}
- $msgarr = plaintext($a, $item, $max_char, true, 8);
+ $msgarr = plaintext($item, $max_char, true, 8);
$msg = $msgarr["text"];
if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {
$contact_id = $r[0]['id'];
- $g = q("SELECT def_gid FROM user WHERE uid = %d LIMIT 1",
- intval($uid)
- );
-
- if ($g && intval($g[0]['def_gid'])) {
- require_once 'include/group.php';
- group_add_member($uid, '', $contact_id, $g[0]['def_gid']);
- }
+ Group::addMember(User::getDefaultGroup($uid), $contact_id);
$photos = Photo::importProfilePhoto($avatar, $uid, $contact_id, true);
function twitter_expand_entities(App $a, $body, $item, $no_tags = false, $picture)
{
- require_once "include/oembed.php";
require_once "include/network.php";
$tags = "";
if ($url->url && $url->expanded_url && $url->display_url) {
$expanded_url = original_url($url->expanded_url);
- $oembed_data = oembed_fetch_url($expanded_url);
+ $oembed_data = OEmbed::fetchURL($expanded_url);
// Quickfix: Workaround for URL with "[" and "]" in it
if (strpos($expanded_url, "[") || strpos($expanded_url, "]")) {