From 7be5dd110c786a8032195d772ff39a839ae43a7f Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Sun, 12 Nov 2017 23:33:14 -0500 Subject: [PATCH 1/3] GContact moved to src Update references to socgraph to GContact namespace functions. Related to https://github.com/friendica/friendica/issues/3878 --- pumpio/pumpio.php | 19 +++++++++---------- statusnet/statusnet.php | 8 ++++---- twitter/twitter.php | 12 ++++++------ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 81b5e107e..11d0e190b 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -6,17 +6,16 @@ * Author: Michael Vogel */ -use Friendica\Core\Worker; - -require('addon/pumpio/oauth/http.php'); -require('addon/pumpio/oauth/oauth_client.php'); -require_once('include/enotify.php'); -require_once('include/socgraph.php'); -require_once("include/Photo.php"); -require_once("mod/share.php"); - use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Core\Worker; +use Friendica\Model\GContact; + +require 'addon/pumpio/oauth/http.php'; +require 'addon/pumpio/oauth/oauth_client.php'; +require_once 'include/enotify.php'; +require_once "include/Photo.php"; +require_once "mod/share.php"; define('PUMPIO_DEFAULT_POLL_INTERVAL', 5); // given in minutes @@ -969,7 +968,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru function pumpio_get_contact($uid, $contact, $no_insert = false) { - update_gcontact(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, + GContact::updateGContact(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, "photo" => $contact->image->url, "name" => $contact->displayName, "hide" => true, "nick" => $contact->preferredUsername, "location" => $contact->location->displayName, "about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id))); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 75b1d7d1f..a482645bb 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -43,12 +43,12 @@ define('STATUSNET_DEFAULT_POLL_INTERVAL', 5); // given in minutes -require_once('library/twitteroauth.php'); -require_once('include/enotify.php'); -require_once("include/socgraph.php"); +require_once 'library/twitteroauth.php'; +require_once 'include/enotify.php'; use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Model\GContact; class StatusNetOAuth extends TwitterOAuth { function get_maxlength() { @@ -929,7 +929,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) { if ($contact->statusnet_profile_url == "") return(-1); - update_gcontact(array("url" => $contact->statusnet_profile_url, + GContact::updateGContact(array("url" => $contact->statusnet_profile_url, "network" => NETWORK_STATUSNET, "photo" => $contact->profile_image_url, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description, diff --git a/twitter/twitter.php b/twitter/twitter.php index 21b6122ec..bd2c627a8 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -60,13 +60,13 @@ * Requirements: PHP5, curl [Slinky library] */ -use Friendica\Core\Worker; - -require_once('include/enotify.php'); -require_once("include/socgraph.php"); - use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Core\Worker; +use Friendica\Model\GContact; + +require_once 'include/enotify.php'; + define('TWITTER_DEFAULT_POLL_INTERVAL', 5); // given in minutes @@ -956,7 +956,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) { $avatar = twitter_fix_avatar($contact->profile_image_url_https); - update_gcontact(array("url" => "https://twitter.com/".$contact->screen_name, + GContact::updateGContact(array("url" => "https://twitter.com/".$contact->screen_name, "network" => NETWORK_TWITTER, "photo" => $avatar, "hide" => true, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description, From 9c618c80af24108c1564b9f8bc198cfc6a1d6634 Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 13 Nov 2017 01:52:26 -0500 Subject: [PATCH 2/3] Review updates changes from review for function name changes. --- pumpio/pumpio.php | 2 +- statusnet/statusnet.php | 2 +- twitter/twitter.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 11d0e190b..a59d76198 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -968,7 +968,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru function pumpio_get_contact($uid, $contact, $no_insert = false) { - GContact::updateGContact(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, + GContact::update(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, "photo" => $contact->image->url, "name" => $contact->displayName, "hide" => true, "nick" => $contact->preferredUsername, "location" => $contact->location->displayName, "about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id))); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index a482645bb..bc0f31437 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -929,7 +929,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) { if ($contact->statusnet_profile_url == "") return(-1); - GContact::updateGContact(array("url" => $contact->statusnet_profile_url, + GContact::update(array("url" => $contact->statusnet_profile_url, "network" => NETWORK_STATUSNET, "photo" => $contact->profile_image_url, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description, diff --git a/twitter/twitter.php b/twitter/twitter.php index bd2c627a8..a4017562b 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -956,7 +956,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) { $avatar = twitter_fix_avatar($contact->profile_image_url_https); - GContact::updateGContact(array("url" => "https://twitter.com/".$contact->screen_name, + GContact::update(array("url" => "https://twitter.com/".$contact->screen_name, "network" => NETWORK_TWITTER, "photo" => $avatar, "hide" => true, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description, From b638efe8f9a01fc279977681a5ef5dfe98702a3a Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 13 Nov 2017 12:20:30 -0500 Subject: [PATCH 3/3] GContact renamed Rename and update references for GlobalContact --- pumpio/pumpio.php | 4 ++-- statusnet/statusnet.php | 4 ++-- twitter/twitter.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index a59d76198..4873d73df 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -9,7 +9,7 @@ use Friendica\Core\Config; use Friendica\Core\PConfig; use Friendica\Core\Worker; -use Friendica\Model\GContact; +use Friendica\Model\GlobalContact; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; @@ -968,7 +968,7 @@ function pumpio_dolike(&$a, $uid, $self, $post, $own_id, $threadcompletion = tru function pumpio_get_contact($uid, $contact, $no_insert = false) { - GContact::update(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, + GlobalContact::update(array("url" => $contact->url, "network" => NETWORK_PUMPIO, "generation" => 2, "photo" => $contact->image->url, "name" => $contact->displayName, "hide" => true, "nick" => $contact->preferredUsername, "location" => $contact->location->displayName, "about" => $contact->summary, "addr" => str_replace("acct:", "", $contact->id))); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index bc0f31437..5f3e83ca1 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -48,7 +48,7 @@ require_once 'include/enotify.php'; use Friendica\Core\Config; use Friendica\Core\PConfig; -use Friendica\Model\GContact; +use Friendica\Model\GlobalContact; class StatusNetOAuth extends TwitterOAuth { function get_maxlength() { @@ -929,7 +929,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) { if ($contact->statusnet_profile_url == "") return(-1); - GContact::update(array("url" => $contact->statusnet_profile_url, + GlobalContact::update(array("url" => $contact->statusnet_profile_url, "network" => NETWORK_STATUSNET, "photo" => $contact->profile_image_url, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description, diff --git a/twitter/twitter.php b/twitter/twitter.php index a4017562b..f8c6aec9a 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -63,7 +63,7 @@ use Friendica\Core\Config; use Friendica\Core\PConfig; use Friendica\Core\Worker; -use Friendica\Model\GContact; +use Friendica\Model\GlobalContact; require_once 'include/enotify.php'; @@ -956,7 +956,7 @@ function twitter_fetch_contact($uid, $contact, $create_user) { $avatar = twitter_fix_avatar($contact->profile_image_url_https); - GContact::update(array("url" => "https://twitter.com/".$contact->screen_name, + GlobalContact::update(array("url" => "https://twitter.com/".$contact->screen_name, "network" => NETWORK_TWITTER, "photo" => $avatar, "hide" => true, "name" => $contact->name, "nick" => $contact->screen_name, "location" => $contact->location, "about" => $contact->description,