Skip to content

Commit

Permalink
Fix recursion bug with party and lobby channels
Browse files Browse the repository at this point in the history
Fixes #34
  • Loading branch information
Vincent 'Philaeux' Lamotte authored and rossengeorgiev committed Jan 25, 2018
1 parent 38682ef commit 4a68862
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dota2/features/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ def join_lobby_channel(self):
Response event: :attr:`EVENT_JOINED_CHANNEL`
"""
if self.lobby:
key = "Lobby_%s" % self.lobby.lobby_id, DOTAChatChannelType_t.DOTAChannelType_Lobby
if self._dota.lobby:
key = "Lobby_%s" % self._dota.lobby.lobby_id, DOTAChatChannelType_t.DOTAChannelType_Lobby
return self.join_channel(*key)

@property
Expand All @@ -181,8 +181,8 @@ def lobby(self):
:return: channel instance
:rtype: :class:`.ChatChannel`
"""
if self.lobby:
key = "Lobby_%s" % self.lobby.lobby_id, DOTAChatChannelType_t.DOTAChannelType_Lobby
if self._dota.lobby:
key = "Lobby_%s" % self._dota.lobby.lobby_id, DOTAChatChannelType_t.DOTAChannelType_Lobby
return self._channels_by_name.get(key, None)

def join_party_channel(self):
Expand All @@ -191,8 +191,8 @@ def join_party_channel(self):
Response event: :attr:`EVENT_JOINED_CHANNEL`
"""
if self.party:
key = "Party_%s" % self.party.party_id, DOTAChatChannelType_t.DOTAChannelType_Party
if self._dota.party:
key = "Party_%s" % self._dota.party.party_id, DOTAChatChannelType_t.DOTAChannelType_Party
return self.join_channel(*key)

@property
Expand All @@ -202,8 +202,8 @@ def party(self):
:return: channel instance
:rtype: :class:`.ChatChannel`
"""
if self.party:
key = "Party_%s" % self.party.party_id, DOTAChatChannelType_t.DOTAChannelType_Party
if self._dota.party:
key = "Party_%s" % self._dota.party.party_id, DOTAChatChannelType_t.DOTAChannelType_Party
return self._channels_by_name.get(key, None)

def get_channel_list(self):
Expand Down

0 comments on commit 4a68862

Please sign in to comment.