'Returns the set of users that the given user should see presence
updates for'

@cachedInlineCallbacks(num_args=2, cache_context=True)
def _get_interested_in(self, user, explicit_room_id, cache_context):

    user_id = user.to_string()
    plist = (yield self.store.get_presence_list_accepted(user.localpart, on_invalidate=cache_context.invalidate))
    users_interested_in = set((row['observed_user_id'] for row in plist))
    users_interested_in.add(user_id)
    users_who_share_room = (yield self.store.get_users_who_share_room_with_user(user_id, on_invalidate=cache_context.invalidate))
    users_interested_in.update(users_who_share_room)
    if explicit_room_id:
        user_ids = (yield self.store.get_users_in_room(explicit_room_id, on_invalidate=cache_context.invalidate))
        users_interested_in.update(user_ids)
    defer.returnValue(users_interested_in)
