From 295e44a87fcedbe4fb50d81d385fa4bc4c50ade7 Mon Sep 17 00:00:00 2001 From: Rossen Georgiev Date: Tue, 9 Aug 2016 18:54:49 +0100 Subject: [PATCH] tweaks to user builtin --- steam/client/builtins/user.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/steam/client/builtins/user.py b/steam/client/builtins/user.py index d6b84c0..086ed3f 100644 --- a/steam/client/builtins/user.py +++ b/steam/client/builtins/user.py @@ -37,9 +37,11 @@ class User(object): self.user = None def __handle_set_persona(self): - self.change_status(persona_state=self.persona_state) self.user = self.get_user(self.steam_id, False) + if self.persona_state != EPersonaState.Offline: + self.change_status(persona_state=self.persona_state) + def __handle_persona_state(self, message): for friend in message.body.friends: steamid = friend.friendid @@ -71,14 +73,14 @@ class User(object): proto_fill_from_dict(message.body, kwargs) self.send(message) - def request_persona_state(self, steam_ids): + def request_persona_state(self, steam_ids, state_flags=863): """Request persona state data :param steam_ids: list of steam ids :type steam_ids: :class:`list` """ m = MsgProto(EMsg.ClientRequestFriendData) - m.body.persona_state_requested = 863 + m.body.persona_state_requested = state_flags m.body.friends.extend(steam_ids) self.send(m)