Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
More helpful variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Aug 18, 2015
1 parent 776ee6d commit 83eb627
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions synapse/handlers/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,20 @@ def get_states(self, target_users, auth_user, as_event=False, check_auth=True):
)

if check_auth:
for u in local_users:
for user in local_users:
visible = yield self.is_presence_visible(
observer_user=auth_user,
observed_user=u
observed_user=user
)

if not visible:
raise SynapseError(404, "Presence information not visible")

results = {}
if local_users:
for u in local_users:
if u in self._user_cachemap:
results[u] = self._user_cachemap[u].get_state()
for user in local_users:
if user in self._user_cachemap:
results[user] = self._user_cachemap[user].get_state()

local_to_user = {u.localpart: u for u in local_users}

Expand All @@ -295,9 +295,9 @@ def get_states(self, target_users, auth_user, as_event=False, check_auth=True):
res["status_msg"] = state["status_msg"]
results[local_to_user[local_part]] = res

for u in remote_users:
for user in remote_users:
# TODO(paul): Have remote server send us permissions set
results[u] = self._get_or_offline_usercache(u).get_state()
results[user] = self._get_or_offline_usercache(user).get_state()

for state in results.values():
if "last_active" in state:
Expand Down

0 comments on commit 83eb627

Please sign in to comment.