Sorry this is a huge commit, this actually includes a ton of stuff. Text color is now readable, multiple accounts are supported alongside end-to-end encryption but no cross-signing yet :-) There's also a whole lot of other small changes, such as choosing the server you want to request a room directory from.
36 lines
712 B
C++
Executable file
36 lines
712 B
C++
Executable file
#pragma once
|
|
|
|
#include <functional>
|
|
#include <QObject>
|
|
#include <QNetworkReply>
|
|
#include <QNetworkRequest>
|
|
|
|
class RequestSender : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
RequestSender(QObject* parent = nullptr) : QObject(parent) {}
|
|
|
|
RequestSender(const RequestSender& other) {
|
|
fn = other.fn;
|
|
}
|
|
|
|
~RequestSender() {
|
|
QObject::disconnect(this);
|
|
}
|
|
|
|
std::function<void(QNetworkReply*)> fn;
|
|
|
|
void finished(QNetworkReply* reply) {
|
|
if(reply->request().originatingObject() == this) {
|
|
//qDebug() << reply->errorString();
|
|
|
|
fn(reply);
|
|
|
|
deleteLater();
|
|
reply->deleteLater();
|
|
}
|
|
}
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(RequestSender)
|