PeerData *NewGroupInner::selectedUser() { for (ContactsData::const_iterator i = _contactsData.cbegin(), e = _contactsData.cend(); i != e; ++i) { if (i.value()->check) { return i.key(); } } return 0; }
QVector<MTPInputUser> NewGroupInner::selectedInputs() { QVector<MTPInputUser> result; result.reserve(_contactsData.size()); for (ContactsData::const_iterator i = _contactsData.cbegin(), e = _contactsData.cend(); i != e; ++i) { if (i.value()->check) { result.push_back(i.key()->inputUser); } } return result; }
QVector<UserData*> AddParticipantInner::selected() { QVector<UserData*> result; result.reserve(_contactsData.size()); for (ContactsData::const_iterator i = _contactsData.cbegin(), e = _contactsData.cend(); i != e; ++i) { if (i.value()->check) { result.push_back(i.key()); } } return result; }