SDK-3110: Deprecate FriendInfo and replace with UserInfo

This commit is contained in:
Aleksej Pawlowskij
2019-10-28 11:07:54 +01:00
parent 0a20629459
commit e57ecc489c
3 changed files with 22 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ from galaxy.api.consts import Feature, OSCompatibility
from galaxy.api.errors import ImportInProgress, UnknownError
from galaxy.api.jsonrpc import ApplicationError, NotificationClient, Server
from galaxy.api.types import (
Achievement, Authentication, FriendInfo, Game, GameLibrarySettings, GameTime, LocalGame, NextStep, UserPresence
Achievement, Authentication, Game, GameLibrarySettings, GameTime, LocalGame, NextStep, UserInfo, UserPresence
)
from galaxy.task_manager import TaskManager
@@ -383,10 +383,10 @@ class Plugin:
params = {"local_game": local_game}
self._notification_client.notify("local_game_status_changed", params)
def add_friend(self, user: FriendInfo) -> None:
def add_friend(self, user: UserInfo) -> None:
"""Notify the client to add a user to friends list of the currently authenticated user.
:param user: FriendInfo of a user that the client will add to friends list
:param user: UserInfo of a user that the client will add to friends list
"""
params = {"friend_info": user}
self._notification_client.notify("friend_added", params)
@@ -747,7 +747,7 @@ class Plugin:
This method is called by the GOG Galaxy Client."""
raise NotImplementedError()
async def get_friends(self) -> List[FriendInfo]:
async def get_friends(self) -> List[UserInfo]:
"""Override this method to return the friends list
of the currently authenticated user.
This method is called by the GOG Galaxy Client.

View File

@@ -140,7 +140,10 @@ class LocalGame:
@dataclass
class FriendInfo:
"""Information about a friend of the currently authenticated user.
"""
.. deprecated:: 0.56
Use: :class:`UserInfo`.
Information about a friend of the currently authenticated user.
:param user_id: id of the user
:param user_name: username of the user
@@ -149,6 +152,16 @@ class FriendInfo:
user_name: str
@dataclass
class UserInfo:
"""Information about a user of related user.
:param user_id: id of the user
:param user_name: username of the user
"""
user_id: str
user_name: str
@dataclass
class GameTime:
"""Game time of a game, defines the total time spent in the game