Merge pull request #887 from annando/twitter-create-user

Twitter: Better respect "create user" setting
This commit is contained in:
Hypolite Petovan 2019-09-16 08:29:41 -04:00 committed by GitHub
commit 3492cdb077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1036,6 +1036,7 @@ function twitter_fetch_contact($uid, $data, $create_user)
$contact = DBA::selectFirst('contact', [], ['uid' => $uid, 'alias' => "twitter::" . $data->id_str]);
if (!DBA::isResult($contact) && !$create_user) {
Logger::info('User contact not found', ['uid' => $uid, 'twitter-id' => $data->id_str]);
return 0;
}
@ -1598,7 +1599,7 @@ function twitter_fetchparentposts(App $a, $uid, $post, TwitterOAuth $connection,
if (!empty($posts)) {
foreach ($posts as $post) {
$postarray = twitter_createpost($a, $uid, $post, $self, false, false, false);
$postarray = twitter_createpost($a, $uid, $post, $self, false, !PConfig::get($uid, 'twitter', 'create_user'), false);
if (empty($postarray['body'])) {
continue;
@ -1780,7 +1781,7 @@ function twitter_fetchhometimeline(App $a, $uid)
twitter_fetchparentposts($a, $uid, $post, $connection, $self);
}
$postarray = twitter_createpost($a, $uid, $post, $self, false, false, false);
$postarray = twitter_createpost($a, $uid, $post, $self, false, !$create_user, false);
if (empty($postarray['body'])) {
continue;