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;
|
|
|
|
|
2019-07-31 16:10:38 +00:00
|
|
|
Q_INVOKABLE void initKeystore();
|
2019-01-17 22:46:48 +00:00
|
|
|
Q_INVOKABLE void sendDataNotification(QString dataPayloadJSON, QString tokensJSON, double callbackId);
|
2019-04-30 11:49:45 +00:00
|
|
|
Q_INVOKABLE void sendLogs(QString dbJSON, QString jsLogs, double callbackId);
|
2018-07-23 15:21:31 +00:00
|
|
|
Q_INVOKABLE void addPeer(QString enode, double callbackId);
|
2019-08-01 20:11:59 +00:00
|
|
|
Q_INVOKABLE void prepareDirAndUpdateConfig(QString configString, double callbackId);
|
|
|
|
Q_INVOKABLE void login(QString accountData, QString password);
|
|
|
|
Q_INVOKABLE void saveAccountAndLogin(QString accountData, QString password, QString config, QString subAccountsData);
|
|
|
|
Q_INVOKABLE void logout();
|
|
|
|
Q_INVOKABLE void openAccounts(double callbackId);
|
|
|
|
Q_INVOKABLE void multiAccountStoreAccount(QString json, double callbackId);
|
|
|
|
Q_INVOKABLE void multiAccountLoadAccount(QString json, double callbackId);
|
|
|
|
Q_INVOKABLE void multiAccountReset(double callbackId);
|
|
|
|
Q_INVOKABLE void multiAccountDeriveAddresses(QString json, double callbackId);
|
2018-12-03 19:19:56 +00:00
|
|
|
Q_INVOKABLE void verify(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);
|
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);
|
2019-03-29 18:00:12 +00:00
|
|
|
Q_INVOKABLE void getNodesFromContract(QString url, QString address, double callbackId);
|
2019-03-22 13:57:27 +00:00
|
|
|
Q_INVOKABLE void chaosModeUpdate(bool on, 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
|
|
|
|
2019-09-12 09:41:25 +00:00
|
|
|
Q_INVOKABLE QString identicon(QString publicKey);
|
|
|
|
Q_INVOKABLE QString generateAlias(QString publicKey);
|
|
|
|
|
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
|
|
|
|
2019-08-01 20:11:59 +00:00
|
|
|
QString prepareDirAndUpdateConfig(QString configString);
|
2018-07-23 15:21:31 +00:00
|
|
|
QScopedPointer<RCTStatusPrivate> d_ptr;
|
2018-12-15 18:57:00 +00:00
|
|
|
QString d_gethLogFilePath;
|
2018-07-23 15:21:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RCTSTATUS_H
|