Enable Telegram Notification API
This commit is contained in:
parent
d35d15a7e0
commit
436bce0966
2 changed files with 15 additions and 0 deletions
|
@ -67,6 +67,7 @@ TDLibWrapper::TDLibWrapper(QObject *parent) : QObject(parent)
|
||||||
this->tdLibReceiver->start();
|
this->tdLibReceiver->start();
|
||||||
|
|
||||||
this->setLogVerbosityLevel();
|
this->setLogVerbosityLevel();
|
||||||
|
this->setOptionInteger("notification_group_count_max", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
TDLibWrapper::~TDLibWrapper()
|
TDLibWrapper::~TDLibWrapper()
|
||||||
|
@ -218,6 +219,19 @@ void TDLibWrapper::getMessage(const QString &chatId, const QString &messageId)
|
||||||
this->sendRequest(requestObject);
|
this->sendRequest(requestObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TDLibWrapper::setOptionInteger(const QString &optionName, const int &optionValue)
|
||||||
|
{
|
||||||
|
qDebug() << "[TDLibWrapper] Setting integet option " << optionName << optionValue;
|
||||||
|
QVariantMap requestObject;
|
||||||
|
requestObject.insert("@type", "setOption");
|
||||||
|
requestObject.insert("name", optionName);
|
||||||
|
QVariantMap optionValueMap;
|
||||||
|
optionValueMap.insert("@type", "optionValueInteger");
|
||||||
|
optionValueMap.insert("value", optionValue);
|
||||||
|
requestObject.insert("value", optionValueMap);
|
||||||
|
this->sendRequest(requestObject);
|
||||||
|
}
|
||||||
|
|
||||||
QVariantMap TDLibWrapper::getUserInformation()
|
QVariantMap TDLibWrapper::getUserInformation()
|
||||||
{
|
{
|
||||||
return this->userInformation;
|
return this->userInformation;
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId);
|
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId);
|
||||||
Q_INVOKABLE void sendTextMessage(const QString &chatId, const QString &message, const QString &replyToMessageId = "0");
|
Q_INVOKABLE void sendTextMessage(const QString &chatId, const QString &message, const QString &replyToMessageId = "0");
|
||||||
Q_INVOKABLE void getMessage(const QString &chatId, const QString &messageId);
|
Q_INVOKABLE void getMessage(const QString &chatId, const QString &messageId);
|
||||||
|
Q_INVOKABLE void setOptionInteger(const QString &optionName, const int &optionValue);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void versionDetected(const QString &version);
|
void versionDetected(const QString &version);
|
||||||
|
|
Loading…
Reference in a new issue