2018-07-23 15:21:31 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2017-present, Status Research and Development GmbH.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RCTSTATUS_H
|
|
|
|
#define RCTSTATUS_H
|
|
|
|
|
|
|
|
#include "moduleinterface.h"
|
|
|
|
|
2018-11-06 16:01:43 +00:00
|
|
|
#include <QLoggingCategory>
|
2018-07-23 15:21:31 +00:00
|
|
|
#include <QVariantMap>
|
|
|
|
|
2018-11-06 16:01:43 +00:00
|
|
|
Q_DECLARE_LOGGING_CATEGORY(RCTSTATUS)
|
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
class RCTStatusPrivate;
|
|
|
|
class RCTStatus : public QObject, public ModuleInterface {
|
|
|
|
Q_OBJECT
|
|
|
|
Q_INTERFACES(ModuleInterface)
|
|
|
|
|
|
|
|
Q_DECLARE_PRIVATE(RCTStatus)
|
|
|
|
|
|
|
|
public:
|
|
|
|
Q_INVOKABLE RCTStatus(QObject* parent = 0);
|
|
|
|
~RCTStatus();
|
|
|
|
|
|
|
|
void setBridge(Bridge* bridge) override;
|
|
|
|
|
|
|
|
QString moduleName() override;
|
|
|
|
QList<ModuleMethod*> methodsToExport() override;
|
|
|
|
QVariantMap constantsToExport() override;
|
|
|
|
|
2018-09-07 09:53:43 +00:00
|
|
|
Q_INVOKABLE void startNode(QString configString);
|
2018-07-23 15:21:31 +00:00
|
|
|
Q_INVOKABLE void stopNode();
|
|
|
|
Q_INVOKABLE void createAccount(QString password, double callbackId);
|
|
|
|
Q_INVOKABLE void notifyUsers(QString token, QString payloadJSON, QString tokensJSON, double callbackId);
|
|
|
|
Q_INVOKABLE void addPeer(QString enode, double callbackId);
|
|
|
|
Q_INVOKABLE void recoverAccount(QString passphrase, QString password, double callbackId);
|
|
|
|
Q_INVOKABLE void login(QString address, QString password, double callbackId);
|
2018-08-20 12:06:57 +00:00
|
|
|
Q_INVOKABLE void sendTransaction(QString txArgsJSON, QString password, double callbackId);
|
|
|
|
Q_INVOKABLE void signMessage(QString rpcParams, double callbackId);
|
2018-07-19 15:51:06 +00:00
|
|
|
Q_INVOKABLE void signGroupMembership(QString content, double callbackId);
|
2018-10-01 08:47:20 +00:00
|
|
|
Q_INVOKABLE void extractGroupMembershipSignatures(QString signatures, double callbackId);
|
2018-11-02 13:48:45 +00:00
|
|
|
Q_INVOKABLE void enableInstallation(QString installationId, double callbackId);
|
|
|
|
Q_INVOKABLE void disableInstallation(QString installationId, double callbackId);
|
Add mailservers confirmations & use peer count for online status
We now check that we are only connected to some `peers` instead of using `NetInfo` from `react-native`.
This is because it has been reported to be quite flaky at times, not reporting online status after sleeping, and for privacy concerns (on ios it pings `apple.com`, on desktop `google.com`).
Adds a new banner `Wallet Offline` and change `Connecting to peers` to `Chat offline`.
A message will be marked as `Sent` only if it made it to the mailserver you are connected to, which will increase the guarantees that we can make about a message (if you see it as sent, it has reached at least a mailserver), this has the consequence that:
- If you are not connected to any mailserver or the mailserver is non responsive/down, and you send a message, it will be marked as `Not sent`, although it might have been actually made it in the network.
Probably this is something that we would like to communicate to the user through UX (i.e. tick if made it to at least a peer, double tick if it made to a mailserver )
Currently I have only enabled this feature in nightlies & devs, I would give it a run and see how we feel about it.
2018-12-06 10:53:45 +00:00
|
|
|
Q_INVOKABLE void updateMailservers(QString enodes, double callbackId);
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
Q_INVOKABLE void setAdjustResize();
|
|
|
|
Q_INVOKABLE void setAdjustPan();
|
|
|
|
Q_INVOKABLE void setSoftInputMode(int i);
|
|
|
|
|
|
|
|
Q_INVOKABLE void clearCookies();
|
|
|
|
Q_INVOKABLE void clearStorageAPIs();
|
2018-08-20 12:06:57 +00:00
|
|
|
Q_INVOKABLE void callRPC(QString payload, double callbackId);
|
|
|
|
Q_INVOKABLE void callPrivateRPC(QString payload, double callbackId);
|
2018-07-23 15:21:31 +00:00
|
|
|
Q_INVOKABLE void closeApplication();
|
|
|
|
Q_INVOKABLE void getDeviceUUID(double callbackId);
|
|
|
|
|
|
|
|
Q_INVOKABLE static bool JSCEnabled();
|
2018-08-16 19:51:48 +00:00
|
|
|
Q_INVOKABLE static void statusGoEventCallback(const char* event);
|
2018-07-23 15:21:31 +00:00
|
|
|
|
2018-08-16 19:51:48 +00:00
|
|
|
void emitStatusGoEvent(QString event);
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2018-08-16 19:51:48 +00:00
|
|
|
void statusGoEvent(QString event);
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
2018-08-16 19:51:48 +00:00
|
|
|
void onStatusGoEvent(QString event);
|
2018-07-23 15:21:31 +00:00
|
|
|
|
|
|
|
private:
|
2018-11-06 16:01:43 +00:00
|
|
|
void logStatusGoResult(const char* methodName, const char* result);
|
2018-09-14 16:52:14 +00:00
|
|
|
|
2018-07-23 15:21:31 +00:00
|
|
|
QScopedPointer<RCTStatusPrivate> d_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RCTSTATUS_H
|