public async Task <List <TgContact> > GetContacts() { var contacts = await _client.GetContacts(); var userContactConstructors = contacts.Users.OfType <UserContactConstructor>(); return(_usersMapper.Map(userContactConstructors).ToList()); }
private async Task <List <SimpleUser> > GetUsers() { var ids = (await mClient.GetContacts()).Cast <ContactConstructor>(); var ius = ids.Select(r => TL.inputUserContact(r.user_id)).ToList(); var users = new List <SimpleUser>(ius.Count); foreach (var user in ius) { var su = new SimpleUser(await mClient.GetFullUser(user)); if (su.Self) { mSelfUserId = su.Id; } users.Add(su); } users.Sort(); return(users); }
public static async Task <LC> GetContact(Peer user) { return((await client.GetContacts(user)).FirstOrDefault()); }