'Returns the presence for all users in their presence list.'

@defer.inlineCallbacks
def get_presence_list(self, observer_user, accepted=None):

    if (not self.is_mine(observer_user)):
        raise SynapseError(400, 'User    is    not    hosted    on    this    Home    Server')
    presence_list = (yield self.store.get_presence_list(observer_user.localpart, accepted=accepted))
    results = (yield self.get_states(target_user_ids=[row['observed_user_id'] for row in presence_list], as_event=False))
    now = self.clock.time_msec()
    results[:] = [format_user_presence_state(r, now) for r in results]
    is_accepted = {row['observed_user_id']: row['accepted'] for row in presence_list}
    for result in results:
        result.update({'accepted': is_accepted})
    defer.returnValue(results)
