Skip to content

Commit 223adf6

Browse files
goggalaxyrbierbasz-gog
authored andcommitted
Remove chat and users
1 parent bfb63a4 commit 223adf6

File tree

8 files changed

+5
-625
lines changed

8 files changed

+5
-625
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="galaxy.plugin.api",
5-
version="0.42",
5+
version="0.43",
66
description="GOG Galaxy Integrations Python API",
77
author='Galaxy team',
88
author_email='[email protected]',

src/galaxy/api/consts.py

-8
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,3 @@ class LocalGameState(Flag):
117117
None_ = 0
118118
Installed = 1
119119
Running = 2
120-
121-
122-
class PresenceState(Enum):
123-
""""Possible states that a user can be in."""
124-
Unknown = "Unknown"
125-
Online = "online"
126-
Offline = "offline"
127-
Away = "away"

src/galaxy/api/plugin.py

+2-107
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
from typing import Any, List, Dict, Optional, Union
1212

13-
from galaxy.api.types import Achievement, Game, LocalGame, FriendInfo, GameTime, UserInfo, Room
13+
from galaxy.api.types import Achievement, Game, LocalGame, FriendInfo, GameTime
1414

1515
from galaxy.api.jsonrpc import Server, NotificationClient, ApplicationError
1616
from galaxy.api.consts import Feature
1717
from galaxy.api.errors import UnknownError, ImportInProgress
18-
from galaxy.api.types import Authentication, NextStep, Message
18+
from galaxy.api.types import Authentication, NextStep
1919

2020

2121
class JSONEncoder(json.JSONEncoder):
@@ -122,40 +122,6 @@ def eof_handler():
122122
result_name="friend_info_list",
123123
feature=Feature.ImportFriends
124124
)
125-
self._register_method(
126-
"import_user_infos",
127-
self.get_users,
128-
result_name="user_info_list",
129-
feature=Feature.ImportUsers
130-
)
131-
self._register_method(
132-
"send_message",
133-
self.send_message,
134-
feature=Feature.Chat
135-
)
136-
self._register_method(
137-
"mark_as_read",
138-
self.mark_as_read,
139-
feature=Feature.Chat
140-
)
141-
self._register_method(
142-
"import_rooms",
143-
self.get_rooms,
144-
result_name="rooms",
145-
feature=Feature.Chat
146-
)
147-
self._register_method(
148-
"import_room_history_from_message",
149-
self.get_room_history_from_message,
150-
result_name="messages",
151-
feature=Feature.Chat
152-
)
153-
self._register_method(
154-
"import_room_history_from_timestamp",
155-
self.get_room_history_from_timestamp,
156-
result_name="messages",
157-
feature=Feature.Chat
158-
)
159125
self._register_method(
160126
"import_game_times",
161127
self.get_game_times,
@@ -441,26 +407,6 @@ def remove_friend(self, user_id: str) -> None:
441407
params = {"user_id": user_id}
442408
self._notification_client.notify("friend_removed", params)
443409

444-
def update_room(
445-
self,
446-
room_id: str,
447-
unread_message_count: Optional[int]=None,
448-
new_messages: Optional[List[Message]]=None
449-
) -> None:
450-
"""WIP, Notify the client to update the information regarding
451-
a chat room that the currently authenticated user is in.
452-
453-
:param room_id: id of the room to update
454-
:param unread_message_count: information about the new unread message count in the room
455-
:param new_messages: list of new messages that the user received
456-
"""
457-
params = {"room_id": room_id}
458-
if unread_message_count is not None:
459-
params["unread_message_count"] = unread_message_count
460-
if new_messages is not None:
461-
params["messages"] = new_messages
462-
self._notification_client.notify("chat_room_updated", params)
463-
464410
def update_game_time(self, game_time: GameTime) -> None:
465411
"""Notify the client to update game time for a game.
466412
@@ -772,57 +718,6 @@ async def get_friends(self):
772718
"""
773719
raise NotImplementedError()
774720

775-
async def get_users(self, user_id_list: List[str]) -> List[UserInfo]:
776-
"""WIP, Override this method to return the list of users matching the provided ids.
777-
This method is called by the GOG Galaxy Client.
778-
779-
:param user_id_list: list of user ids
780-
"""
781-
raise NotImplementedError()
782-
783-
async def send_message(self, room_id: str, message_text: str) -> None:
784-
"""WIP, Override this method to send message to a chat room.
785-
This method is called by the GOG Galaxy Client.
786-
787-
:param room_id: id of the room to which the message should be sent
788-
:param message_text: text which should be sent in the message
789-
"""
790-
raise NotImplementedError()
791-
792-
async def mark_as_read(self, room_id: str, last_message_id: str) -> None:
793-
"""WIP, Override this method to mark messages in a chat room as read up to the id provided in the parameter.
794-
This method is called by the GOG Galaxy Client.
795-
796-
:param room_id: id of the room
797-
:param last_message_id: id of the last message; room is marked as read only if this id matches
798-
the last message id known to the client
799-
"""
800-
raise NotImplementedError()
801-
802-
async def get_rooms(self) -> List[Room]:
803-
"""WIP, Override this method to return the chat rooms in which the user is currently in.
804-
This method is called by the GOG Galaxy Client
805-
"""
806-
raise NotImplementedError()
807-
808-
async def get_room_history_from_message(self, room_id: str, message_id: str) -> List[Message]:
809-
"""WIP, Override this method to return the chat room history since the message provided in parameter.
810-
This method is called by the GOG Galaxy Client.
811-
812-
:param room_id: id of the room
813-
:param message_id: id of the message since which the history should be retrieved
814-
"""
815-
raise NotImplementedError()
816-
817-
async def get_room_history_from_timestamp(self, room_id: str, from_timestamp: int) -> List[Message]:
818-
"""WIP, Override this method to return the chat room history since the timestamp provided in parameter.
819-
This method is called by the GOG Galaxy Client.
820-
821-
:param room_id: id of the room
822-
:param from_timestamp: timestamp since which the history should be retrieved
823-
"""
824-
raise NotImplementedError()
825-
826721
async def get_game_times(self) -> List[GameTime]:
827722
"""
828723
.. deprecated:: 0.33

src/galaxy/api/types.py

+1-55
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from dataclasses import dataclass
22
from typing import List, Dict, Optional
33

4-
from galaxy.api.consts import LicenseType, LocalGameState, PresenceState
4+
from galaxy.api.consts import LicenseType, LocalGameState
55

66
@dataclass
77
class Authentication():
@@ -130,34 +130,6 @@ class LocalGame():
130130
game_id: str
131131
local_game_state: LocalGameState
132132

133-
@dataclass
134-
class Presence():
135-
"""Information about a presence of a user.
136-
137-
:param presence_state: the state in which the user's presence is
138-
:param game_id: id of the game which the user is currently playing
139-
:param presence_status: optional attached string with the detailed description of the user's presence
140-
"""
141-
presence_state: PresenceState
142-
game_id: Optional[str] = None
143-
presence_status: Optional[str] = None
144-
145-
@dataclass
146-
class UserInfo():
147-
"""Detailed information about a user.
148-
149-
:param user_id: of the user
150-
:param is_friend: whether the user is a friend of the currently authenticated user
151-
:param user_name: of the user
152-
:param avatar_url: to the avatar of the user
153-
:param presence: about the users presence
154-
"""
155-
user_id: str
156-
is_friend: bool
157-
user_name: str
158-
avatar_url: str
159-
presence: Presence
160-
161133
@dataclass
162134
class FriendInfo():
163135
"""Information about a friend of the currently authenticated user.
@@ -168,32 +140,6 @@ class FriendInfo():
168140
user_id: str
169141
user_name: str
170142

171-
@dataclass
172-
class Room():
173-
"""WIP, Chatroom.
174-
175-
:param room_id: id of the room
176-
:param unread_message_count: number of unread messages in the room
177-
:param last_message_id: id of the last message in the room
178-
"""
179-
room_id: str
180-
unread_message_count: int
181-
last_message_id: str
182-
183-
@dataclass
184-
class Message():
185-
"""WIP, A chatroom message.
186-
187-
:param message_id: id of the message
188-
:param sender_id: id of the sender of the message
189-
:param sent_time: time at which the message was sent
190-
:param message_text: text attached to the message
191-
"""
192-
message_id: str
193-
sender_id: str
194-
sent_time: int
195-
message_text: str
196-
197143
@dataclass
198144
class GameTime():
199145
"""Game time of a game, defines the total time spent in the game

tests/conftest.py

-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ def plugin(reader, writer):
4242
"install_game",
4343
"uninstall_game",
4444
"get_friends",
45-
"get_users",
46-
"send_message",
47-
"mark_as_read",
48-
"get_rooms",
49-
"get_room_history_from_message",
50-
"get_room_history_from_timestamp",
5145
"get_game_times",
5246
"shutdown_platform_client"
5347
)

0 commit comments

Comments
 (0)