forked from GNUsocial/gnu-social
Provisional fix for ticket #3108: Facebook bridge sends "likes" as the notice's original poster instead of as the person doing the liking.
Adds optional $profile parameter for Facebookclient constructor and uses that for the foreign_link lookup if provided instead of the notice's poster.
This commit is contained in:
@@ -48,7 +48,12 @@ class Facebookclient
|
||||
protected $notice = null; // The user's notice
|
||||
protected $user = null; // Sender of the notice
|
||||
|
||||
function __construct($notice)
|
||||
/**
|
||||
*
|
||||
* @param Notice $notice the notice to manipulate
|
||||
* @param Profile $profile local user to act as; if left empty, the notice's poster will be used.
|
||||
*/
|
||||
function __construct($notice, $profile=null)
|
||||
{
|
||||
$this->facebook = self::getFacebook();
|
||||
|
||||
@@ -60,8 +65,9 @@ class Facebookclient
|
||||
|
||||
$this->notice = $notice;
|
||||
|
||||
$profile_id = $profile ? $profile->id : $notice->profile_id;
|
||||
$this->flink = Foreign_link::getByUserID(
|
||||
$notice->profile_id,
|
||||
$profile_id,
|
||||
FACEBOOK_SERVICE
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user