0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 18:13:54 +01:00

Removed unused 'is_visible' method

This commit is contained in:
Mark Haines 2015-05-20 14:48:11 +01:00
parent 8eca5bd50a
commit 7ae8afb7ef

View file

@ -1045,32 +1045,6 @@ class PresenceEventSource(object):
self.hs = hs
self.clock = hs.get_clock()
@defer.inlineCallbacks
def is_visible(self, observer_user, observed_user):
if observer_user == observed_user:
defer.returnValue(True)
presence = self.hs.get_handlers().presence_handler
if (yield presence.store.user_rooms_intersect(
[u.to_string() for u in observer_user, observed_user])):
defer.returnValue(True)
if self.hs.is_mine(observed_user):
pushmap = presence._local_pushmap
defer.returnValue(
observed_user.localpart in pushmap and
observer_user in pushmap[observed_user.localpart]
)
else:
recvmap = presence._remote_recvmap
defer.returnValue(
observed_user in recvmap and
observer_user in recvmap[observed_user]
)
@defer.inlineCallbacks
@log_function
def get_new_events_for_user(self, user, from_key, limit):
@ -1099,7 +1073,6 @@ class PresenceEventSource(object):
user_ids_to_check |= set(joined)
updates = []
# TODO(paul): use a DeferredList ? How to limit concurrency.
for observed_user in user_ids_to_check & set(cachemap):
cached = cachemap[observed_user]