- $user = null;
-
- // function was called with an argument /favorites/api_arg.format
- if (isset($apidata['api_arg'])) {
-
- if (is_numeric($apidata['api_arg'])) {
- $user = User::staticGet($apidata['api_arg']);
- } else {
- $nickname = common_canonical_nickname($apidata['api_arg']);
- $user = User::staticGet('nickname', $nickname);
- }
- } else {
-
- // if no user was specified, then we'll use the authenticated user
- $user = $apidata['user'];
- }
+ $this->auth_user = $apidata['user'];
+ $user = $this->get_user($apidata['api_arg'], $apidata);