@@ 282,13 282,10 @@ class Roster(LegacyRoster[str, Contact]):
async def known_user_ids(self, only_friends=False, including_me=True):
me = await self.mm.mm_id
- r = [
- await c.mm_id()
- for _jid, c in self.session.contacts.known_contacts(
- only_friends=only_friends
- ).items()
- if await c.mm_id() != me
- ]
+ known_contacts = self.session.contacts.known_contacts(
+ only_friends=only_friends
+ ).items()
+ r = [await c.mm_id() for _jid, c in known_contacts if await c.mm_id() != me]
if including_me:
r.append(me)
return r