Explorar o código

#4558 - Build-in API support (befriend)

roman.lesnikov@gmail.com %!s(int64=2) %!d(string=hai) anos
pai
achega
bab1b067c0

+ 9 - 0
template/scripts/BxBaseServiceProfiles.php

@@ -148,6 +148,15 @@ class BxBaseServiceProfiles extends BxDol
         else
             return '';
     }
+    
+    public function serviceBefriend ($iProfileId)
+    {
+        $oConnections = BxDolConnection::getObjectInstance('sys_profiles_friends'); 
+        $this->_oConnectionFriends->addConnection((int)bx_get_logged_profile_id(), $iProfileId);
+        $this->_oConnectionFriends->addConnection($iProfileId, (int)bx_get_logged_profile_id());
+        $oProfile = BxDolProfile::getInstance($iProfileId);
+        return $oProfile->getUnitAPI($iProfileId);
+    }
 
     public function serviceProfileStats ($iProfileId = 0)
     {

+ 1 - 0
template/scripts/BxBaseServices.php

@@ -80,6 +80,7 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
             'BrowseSubscriptions' => 'BxBaseServiceProfiles',
             'BrowseMembers' => 'BxBaseServiceProfiles',
             'UpdateSettings' => 'BxBaseServiceProfiles',
+            'Befriend' => 'BxBaseServiceProfiles',
             
             'GetChartGrowth' => 'BxBaseChartServices',
             'GetChartStats' => 'BxBaseChartServices',