Commit 3d6589ce authored by Robert Nix's avatar Robert Nix
Browse files

Use MediaWiki User IDs for user identifiers

parent 54fba8b2
Pipeline #125776790 passed with stage
in 1 minute and 14 seconds
...@@ -12,7 +12,6 @@ declare(strict_types=1); ...@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Reverb; namespace Reverb;
use CentralIdLookup;
use User; use User;
class UserIdHelper { class UserIdHelper {
...@@ -24,8 +23,7 @@ class UserIdHelper { ...@@ -24,8 +23,7 @@ class UserIdHelper {
* @return integer * @return integer
*/ */
public static function getUserIdForService(User $user): int { public static function getUserIdForService(User $user): int {
$lookup = CentralIdLookup::factory(); return $user->getId();
return $lookup->centralIdFromLocalUser($user, CentralIdLookup::AUDIENCE_RAW);
} }
/** /**
...@@ -36,7 +34,6 @@ class UserIdHelper { ...@@ -36,7 +34,6 @@ class UserIdHelper {
* @return User|null * @return User|null
*/ */
public static function getUserForServiceUserId(int $serviceUserId): ?User { public static function getUserForServiceUserId(int $serviceUserId): ?User {
$lookup = CentralIdLookup::factory(); return User::newFromId($serviceUserId);
return $lookup->localUserFromCentralId($serviceUserId);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment