Merge pull request #984 from annando/twitter-gsid

Twitter: set the baseurl and the gsid
pull/985/head
Hypolite Petovan 2020-05-23 18:15:48 -04:00 committed by GitHub
commit 47cb5d0b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -79,6 +79,7 @@ use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Conversation; use Friendica\Model\Conversation;
use Friendica\Model\Group; use Friendica\Model\Group;
use Friendica\Model\GServer;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\ItemContent; use Friendica\Model\ItemContent;
use Friendica\Model\ItemURI; use Friendica\Model\ItemURI;
@ -1069,11 +1070,13 @@ function twitter_fetch_contact($uid, $data, $create_user)
} }
$avatar = twitter_fix_avatar($data->profile_image_url_https); $avatar = twitter_fix_avatar($data->profile_image_url_https);
$url = "https://twitter.com/" . $data->screen_name; $baseurl = "https://twitter.com";
$url = $baseurl . "/" . $data->screen_name;
$addr = $data->screen_name . "@twitter.com"; $addr = $data->screen_name . "@twitter.com";
$fields = ['url' => $url, 'network' => Protocol::TWITTER, $fields = ['url' => $url, 'network' => Protocol::TWITTER,
'alias' => 'twitter::' . $data->id_str, 'alias' => 'twitter::' . $data->id_str,
'baseurl' => $baseurl, 'gsid' => GServer::getID($baseurl),
'name' => $data->name, 'nick' => $data->screen_name, 'addr' => $addr, 'name' => $data->name, 'nick' => $data->screen_name, 'addr' => $addr,
'location' => $data->location, 'about' => $data->description]; 'location' => $data->location, 'about' => $data->description];