<commit_before>/*
   Copyright (C) 2018 <NAME> <<EMAIL>>

   This file is a part of TelegramQt library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

 */

#ifndef TELEGRAMQT_CLIENT_CONTACTS_API_HPP
#define TELEGRAMQT_CLIENT_CONTACTS_API_HPP

#include "ClientApi.hpp"
#include "TelegramNamespace.hpp"

namespace Telegram {

class PendingOperation;

namespace Client {

class PendingContactsOperation;
class ContactsApiPrivate;
class ContactList;

class TELEGRAMQT_EXPORT ContactsApi : public ClientApi
{
    Q_OBJECT
public:
    explicit ContactsApi(QObject *parent = nullptr);

    struct ContactInfo
    {
        QString phoneNumber;
        QString firstName;
        QString lastName;
    };

    using ContactInfoList = QVector<ContactInfo>;

    ContactList *getContactList();

    QString selfPhone() const;
    quint32 selfContactId() const;

    PendingContactsOperation *addContacts(const ContactInfoList &contacts);

    PendingOperation *deleteContacts(const QVector<quint32> &ids);
    PendingOperation *blockContact(quint32 contactId);
    PendingOperation *unblockContact(quint32 contactId);
    PendingContactsOperation *getBlockedContacts();

    PendingContactsOperation *search(const QString &query, int limit = 10);
    PendingContactsOperation *resolveUsername(const QString &username);
    PendingContactsOperation *exportCard();
    PendingContactsOperation *importCard(const QByteArray &cardInfo);

protected:
    Q_DECLARE_PRIVATE_D(d, ContactsApi)
};

} // Client namespace

} // Telegram namespace

#endif // TELEGRAMQT_CLIENT_MESSAGING_API_HPP<commit_msg>ContactsApi: Add stub for contactStatusChanged()<commit_after>/*
   Copyright (C) 2018 <NAME> <<EMAIL>>

   This file is a part of TelegramQt library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

 */

#ifndef TELEGRAMQT_CLIENT_CONTACTS_API_HPP
#define TELEGRAMQT_CLIENT_CONTACTS_API_HPP

#include "ClientApi.hpp"
#include "TelegramNamespace.hpp"

namespace Telegram {

class PendingOperation;

namespace Client {

class PendingContactsOperation;
class ContactsApiPrivate;
class ContactList;

class TELEGRAMQT_EXPORT ContactsApi : public ClientApi
{
    Q_OBJECT
public:
    explicit ContactsApi(QObject *parent = nullptr);

    struct ContactInfo
    {
        QString phoneNumber;
        QString firstName;
        QString lastName;
    };

    using ContactInfoList = QVector<ContactInfo>;

    ContactList *getContactList();

    QString selfPhone() const;
    quint32 selfContactId() const;

    PendingContactsOperation *addContacts(const ContactInfoList &contacts);

    PendingOperation *deleteContacts(const QVector<quint32> &ids);
    PendingOperation *blockContact(quint32 contactId);
    PendingOperation *unblockContact(quint32 contactId);
    PendingContactsOperation *getBlockedContacts();

    PendingContactsOperation *search(const QString &query, int limit = 10);
    PendingContactsOperation *resolveUsername(const QString &username);
    PendingContactsOperation *exportCard();
    PendingContactsOperation *importCard(const QByteArray &cardInfo);

Q_SIGNALS:
    void contactStatusChanged(quint32 userId, TelegramNamespace::ContactStatus status);

protected:
    Q_DECLARE_PRIVATE_D(d, ContactsApi)
};

} // Client namespace

} // Telegram namespace

#endif // TELEGRAMQT_CLIENT_MESSAGING_API_HPP
{'fraction_non_alphanumeric': 0.06457695027103465, 'fraction_numerical': 0.008013198208814519, 'mean_word_length': 4.58421052631579, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4196102', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1183, 'n_words': 383}