Check contacts requested via extra-attribute

This commit is contained in:
Sebastian Wolf 2020-11-23 20:53:43 +01:00
parent 51cad07231
commit 20b773ac59
3 changed files with 3 additions and 6 deletions

View file

@ -96,7 +96,6 @@ Page {
tertiaryText { tertiaryText {
maximumLineCount: 1 maximumLineCount: 1
text: Functions.getChatPartnerStatusText(modelData.status["@type"], modelData.status.was_online); text: Functions.getChatPartnerStatusText(modelData.status["@type"], modelData.status.was_online);
elide: Text.ElideRight
} }
onClicked: { onClicked: {

View file

@ -44,7 +44,7 @@ namespace {
const QString _EXTRA("@extra"); const QString _EXTRA("@extra");
} }
TDLibWrapper::TDLibWrapper(AppSettings *appSettings, MceInterface *mceInterface, QObject *parent) : QObject(parent), joinChatRequested(false), contactsRequested(false) TDLibWrapper::TDLibWrapper(AppSettings *appSettings, MceInterface *mceInterface, QObject *parent) : QObject(parent), joinChatRequested(false)
{ {
LOG("Initializing TD Lib..."); LOG("Initializing TD Lib...");
this->appSettings = appSettings; this->appSettings = appSettings;
@ -793,9 +793,9 @@ void TDLibWrapper::getDeepLinkInfo(const QString &link)
void TDLibWrapper::getContacts() void TDLibWrapper::getContacts()
{ {
LOG("Retrieving contacts"); LOG("Retrieving contacts");
this->contactsRequested = true;
QVariantMap requestObject; QVariantMap requestObject;
requestObject.insert(_TYPE, "getContacts"); requestObject.insert(_TYPE, "getContacts");
requestObject.insert(_EXTRA, "contactsRequested");
this->sendRequest(requestObject); this->sendRequest(requestObject);
} }
@ -1187,9 +1187,8 @@ void TDLibWrapper::handleOpenWithChanged()
void TDLibWrapper::handleUsersReceived(const QString &extra, const QVariantList &userIds, int totalUsers) void TDLibWrapper::handleUsersReceived(const QString &extra, const QVariantList &userIds, int totalUsers)
{ {
if (this->contactsRequested) { if (extra == "contactsRequested") {
LOG("Received contacts list..."); LOG("Received contacts list...");
this->contactsRequested = false;
contacts.clear(); contacts.clear();
QListIterator<QVariant> userIdIterator(userIds); QListIterator<QVariant> userIdIterator(userIds);
while (userIdIterator.hasNext()) { while (userIdIterator.hasNext()) {

View file

@ -277,7 +277,6 @@ private:
QString activeChatSearchName; QString activeChatSearchName;
bool joinChatRequested; bool joinChatRequested;
bool contactsRequested;
}; };