Commit Graph

143 Commits

Author SHA1 Message Date
Iuri Matias 3470583fd4 bump dotherside & nimqml 2021-07-23 13:22:04 -04:00
Andrei Smirnov 201a87d052 Updated submodules and fixed SystemTrayIcon menu. 2021-07-23 13:22:04 -04:00
Andrei Smirnov b3528bd717 fix(@desktop): missing context menu on SystemTrayIcon 2021-07-23 13:22:04 -04:00
Iuri Matias a406a24df5 bump status-go 2021-07-22 13:48:53 -04:00
Richard Ramos 9c3db82278 bump statusgo 2021-07-22 13:48:53 -04:00
Richard Ramos 3707f67637 bump status-go 2021-07-22 13:48:53 -04:00
Richard Ramos 6849091460 feat: community user status pt 2 2021-07-22 13:48:53 -04:00
Richard Ramos 42a31f66b3 update statusgo 2021-07-21 15:09:23 -04:00
Richard Ramos 561991da67 Add wakuv2 fleets 2021-07-21 15:09:23 -04:00
Pascal Precht 9795890544 ui(Communities): remove unnecessary dividers in modals
There was a change in StatusQ that introduced dividers for modal footers
and headers, so we don't need to put them in the content manually anymore.

This commit removes the no longer needed ones.
2021-07-20 08:40:29 -04:00
Michael Bradley, Jr 88b990a21a build: bump vendor/nimbus-build-system 2021-07-16 17:40:40 -04:00
Jonathan Rainville e1c6cf224b fix(act-center): fix unread count when accepting or dismissing notif
Fixes #2727
2021-07-06 12:51:43 -04:00
Jonathan Rainville 2e98724641 feat(community): add notification setting to community
Fixes #2421
2021-07-06 10:41:10 -04:00
Jonathan Rainville a6ecf6b092 chore: update status-go to latest version 2021-06-29 10:18:01 -04:00
Eric Mastro 557c068983 fix: update community invite text in push notification
Changes the community invitation text notifications from

“Upgrade to see a community invitation”

to

**InviteUsersToCommunity**
```golang
fmt.Sprintf("You have been invited to the community %s", community.Name())
```

**ShareCommunity**
```golang
fmt.Sprintf("Community %s has been shared with you", community.Name())
```
2021-06-29 07:54:33 -04:00
Richard Ramos 1d3e5230b2 revert: SortFilterProxyModel 2021-06-23 08:08:08 -04:00
Richard Ramos fd4e0de3f3 feat: SortFilterProxyModel 2021-06-21 16:28:46 -04:00
Richard Ramos e6bfd52e73
fix: status-go version 2021-06-18 11:00:27 -04:00
Iuri Matias eab9d68aff move types out of libstatus; remove libstatus types references 2021-06-17 11:11:36 -04:00
Jonathan Rainville e27c66d8af feat(act-center): hide viewed notifications when clicking the hide btn 2021-06-15 13:14:19 -04:00
Jonathan Rainville 447794f0e7 update status-go 2021-06-15 13:14:19 -04:00
Jonathan Rainville 32676d50af fix: fix pinnedBy not being right when reopening the app 2021-06-11 10:55:55 -04:00
Richard Ramos 086653ac52 fix: code review 2 2021-06-10 19:33:22 -04:00
Eric Mastro fee211483d feat: edit community channels
Closes #2344.

Add ability to edit name, description, and private fields of a community channel.

feat: Display community channel description
Ensure the width of the description does not surpass the context menu and instead wraps to the next line.

feat: After channel is created, set it as the active channel
2021-06-10 19:33:22 -04:00
Eric Mastro 21e6affa98 feat: edit community channels
Closes #2344.

Add ability to edit name, description, and private fields of a community channel.

feat: Display community channel description
Ensure the width of the description does not surpass the context menu and instead wraps to the next line.

feat: After channel is created, set it as the active channel
2021-06-09 10:19:26 +10:00
Iuri Matias 739f243e8a fix status-go version 2021-06-02 12:58:05 -04:00
Iuri Matias aa57de15a9 point to latest commit of DOtherSide 2021-06-02 11:05:28 -04:00
B.Melnik f433020d1d feat: commit dotherside 2021-06-02 11:05:28 -04:00
Jonathan Rainville 18b26a1c67 start of activity center function calls 2021-05-31 15:54:18 -04:00
Michael Bradley, Jr 4e477a5b64 build: bump vendor/DOtherSide
Fix a typo in a recently added header file in DOtherSide that causes problems
on case-sensitive filesystems, e.g. on Linux.

Also unify the build command for DOtherSide across platforms.
2021-05-27 18:25:26 -05:00
Jonathan Rainville 0cfa4e5daa update status-go version to match master 2021-05-26 12:12:05 -04:00
Jonathan Rainville b52dceb984 feat(Chat): add pinned messages feature 2021-05-26 12:12:05 -04:00
Richard Ramos 6abba06c42 fix: always show the v 2021-05-25 15:23:07 -04:00
Richard Ramos 0ded790f0d feat: create community categories 2021-05-25 15:23:07 -04:00
Richard Ramos aebfaef72e Update status-go version 2021-05-25 14:47:13 -04:00
Richard Ramos 22839f177b feat: use new API for joining/leaving chats
Fixes #2526
Fixes #2487
2021-05-25 14:47:13 -04:00
Pascal Precht 923350a46f fix(Chat): honor joined date when preserving channel order
Prior to this commit, loaded channels and chats would always be
sorted by date of last message received, with the latest one being
moved to the top of the list.

When new channels or chats are joined, they are added on top of the
list as well, however, when the application is restarted,
those new joined chats would not necessarily show up at the top anymore
becaue nothing keeps track of when a channel was joined, which should
be taken into account when preserving the order.

The changes introduced in this commit solve this by introducing a
new `joined` property on the `Chat` type which gets updated with
the current timestamp whenever a channel is joined.

It also depends on the changes made to the `status-go` client, which
have to land first: https://github.com/status-im/status-go/pull/2158

Closes: #1832
2021-05-21 13:06:34 -04:00
Richard Ramos 2000018834 bump status-go version 2021-05-18 15:24:05 -04:00
Richard Ramos 3a042a4a09 feat: use new pending transfer API 2021-05-18 15:24:05 -04:00
Richard Ramos 19d4279237 use new wallet api to receive wallet signals 2021-05-18 15:24:05 -04:00
Eric Mastro 29ac475385 feat: add DockClicker event filter
Add an event filter to `qApp` that can detect a dock icon click (in macos) when the main window is hidden or closed.

When the event has been triggered, the main window will be shown again.

Co-authored-by: Boris Melnik <82511785+borismelnik@users.noreply.github.com>
2021-05-14 10:28:14 -04:00
Jonathan Rainville 6567dcadec chore: update status-go 2021-04-29 12:30:05 -04:00
Michael Bradley, Jr c03a086c01 feat: command-line option can be used to specify app's data directory
In the repo:
```
$ bin/nim_status_client --help
```
In the packaged app (macOS example):
```
$ cd /Applications/Status.app/Contents/MacOS
$ ./nim_status_client --help
```
Output:
```
Usage:

nim_status_client [OPTIONS]...

The following options are available:

 -d, --dataDir      Status Desktop data directory.
```

**Using the option**

```
$ cd ~/status-ci-builds/master/Status.app/Contents/MacOS
$ ./nim_status_client --dataDir:"${HOME}/status-dirs/master"
```
In another terminal:
```
$ cd ~/status-ci-builds/PR-4242/Status.app/Contents/MacOS
$ ./nim_status_client --dataDir:"${HOME}/status-dirs/PR-4242"
```

The path supplied can be relative or absolute, and can be specified with
`--dataDir:[path]`, `--dataDir=[path]`, `-d:[path]`, or `-d=[path]`.

Either `:` or `=` must be used, i.e. this *will not* work: `--dataDir [path]`
or `-d [path]`.

The name of the option follows Nim's partial case-insensitivity rules, so
`--dataDir`, `--datadir`, and `--data_dir` are all equivalent. See
[Identifier equality][ieq] in the Nim Manual.

It is possible to run the same build in multiple terminals by supplying
different `--dataDir`, i.e. this works:
```
$ cd /Applications/Status.app/Contents/MacOS
$ ./nim_status_client --dataDir="${HOME}/temp/some1"
```
In another terminal:
```
$ cd /Applications/Status.app/Contents/MacOS
$ ./nim_status_client --dataDir="${HOME}/temp/some2"
```

**Windows**

It is recommended to use a Git Bash or MSYS2 terminal when invoking
`bin/nim_status_client.exe` (development build) or `bin/Status.exe` (production
build) on the command-line. The reason is that if the exe is invoked in a
session of `cmd.exe` it will return to the prompt immediately; the app will run
but there will be no output in the terminal. In any case, the `--dataDir`
option will take effect whether the exe is invoked in `cmd.exe` or a
recommended terminal.

For development builds, when invoking `bin/nim_status_client.exe` directly
instead of via `make run`, because e.g. you wish to use the `--dataDir` option,
it is required to first setup the `PATH` environment variable correctly. See
the `run-windows` target in this repo's Makefile for more information.

**Linux**

The `--dataDir` option may be passed to command-line invocation of a
production (AppImage) build in the same way as passing it to a development
build:

```
$ Status.AppImage --dataDir:/path/to/wherever
```

For development builds, when invoking `bin/nim_status_client` directly instead
of via `make run`, because e.g. you wish to use the `--dataDir` option, it is
required to setup the `LD_LIBRARY_PATH` environment variable correctly. See the
`run-linux` target in this repo's Makefile for more information.

---

BREAKING CHANGE: The `qt` subdir of the app's data directory is now a sibling
of the status-go directory rather than a subdir of the status-go directory:

```
Status (app data directory)
├── data (status-go directory)
├── qt
└── tmp
```

Because app settings are stored in the `qt` directory that means that existing
installations will lose their customized settings.

At app startup, it would be possible to detect `Status/data/qt` and if
`Status/qt` doesn't exist yet then copy `Status/data/qt` to
`Status/qt`. However, there was some concern that behavior could lead to
problems later on if we forget the workaround is in place. So for now that
settings preservation strategy has not been implemented, but it might be before
this commit is merged pending full team awareness/consensus.

---

Command-line option support is provided by
[nim-confutils](https://github.com/status-im/nim-confutils).

The environment variable `NIM_STATUS_CLIENT_DEV` has been removed in favor of
passing a "define" option to the Nim compiler: `-d:development` for development
builds (e.g. `make V=1`) and `-d:production` for packaged builds (e.g. `make
V=1 pkg`). Passing the correct option is handled automatically by the Makefile.

A make variable named `RELEASE` has been introduced, which defaults to
`false`. Presently the `RELEASE` variable should not be set on the command-line
nor in CI as more work needs to be done to toggle the proper compiler flags. In
the case of Status Desktop, "release vs. debug" is a concern orthogonal to
"production vs. development". At present, production builds and development
builds are all debug builds, but that will likely change in the future: we can
have non-release CI production builds and local development builds be debug
builds, while release builds in CI would be production builds with
`RELEASE=true` (the compiled executable will be fully optimized).

Prior to the changes in this PR, symmetry is somewhat lacking between
development and production (packaged) builds with respect to the concept of the
"data directory". In development builds the root of the repo effectively serves
as the `Status` directory used by production builds, e.g. on macOS
`~/Library/Application Support/Status`. Also, there's a bit of confusion as to
whether "data directory" refers to a directory for the desktop app's overall
data (including status-go data) or to the specific directory used by status-go.

This PR attempts to provide symmetry and reduce confusion:
* The term "data directory" means the directory used by the desktop app to
store multiple kinds of data and is not a reference to the subdirectory used by
status-go.
* For development builds the "data directory" defaults to `./Status/` relative
to the root of the repo.
* For production builds the "data directory" default is the same as before,
e.g. on macOS it's ` ~/Library/Application Support/Status/`.

The directory used by status-go is `Status/data/`. To be clear, that should be
referred to as the "status-go directory" and not the app's "data directory". It
would nice if we could rename it from `Status/data/` to `Status/status-go/`. We
can do that, I already checked that it works correctly; however, for existing
installations it would require that at app launch we check for the presence of
`Status/data/` and rename it to `Status/status-go`. While simple enough to do,
I was concerned that there might be edge cases where the directory rename could
cause a problem (e.g. if another copy of the app is running) so chose for now
to stick with the status-go directory being `Status/data/`.

---

**NOTES**

More work needs to be done to ensure that all data written by the app is
contained in the default or cli-specified data directory. Currently, both
development and production (packaged) builds are writing to common directories
outside of the data directory, e.g. located within `~/Library/` on
macOS. Changing that behavior seems like it will mainly involve changing
defaults related to Qt components such as the web engine. See:
https://github.com/status-im/status-desktop/issues/1141.

In general, additional refactoring could be done in the future. For
example, implementing `StatusDesktopConfig` in
`src/status/libstatus/accounts/constants.nim` (as done in this PR) works fine
for now, but better code organization is desirable.

---

Closes #2268

[ieq]: https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
2021-04-26 09:40:58 -05:00
Eric Mastro 82987305ab chore: bump dotherside and nimqml
Bump dotherside to a commit that is on its current master branch. The previous commit and the current commit have the same contents, however the previous commit lived on a branch, and not on the master branch of dotherside.

An attempt to bump nimqml to its master branch commit resulted in an error, which has been logged https://github.com/status-im/status-desktop/issues/2275. Instead, the commit change here is the same as dotherside — moving the commit hash from its branched version to the commit that lives on the master branch line. However, as mentioned already, it is not at master HEAD due to the error.
2021-04-21 17:57:29 -04:00
Eric Mastro 66912fd811 feat: introduce Task Manager threadpool
The `TaskManager` threadpool is a memory-safe replacement for the `spawnAndSend` operations that are currently causing memory issues in status-desktop.

From a fundamental memory management point of view, `libstatus/settings`, `libstatus/contracts`, and `libstatus/tokens` (custom tokens) have all been converted to `{.threadvar.}`s and `Atomic[bool]`s to maintain the cache and `dirty` flag across threads, respectively, eliminating the need for thread locks and incorrect `{.gcsafe.}` compiler overrides.

The successful [recyclable threadpool experiment from `nim-task-runner`](https://github.com/status-im/nim-task-runner/blob/test/use-cases/test/use_cases/test_sync.nim) using `AsyncChannel[ThreadSafeString]`s was brought over to `status-desktop` and implemented in somewhat of a hardcoded manner, as we knew this would save some time instead of trying to create a fully fleshed out `nim-task-runner` API and build a miraculous macro that may or may not be able to generate the needed API.

The threadpool is started by the `TaskManager` and both the `TaskManager` and the `TaskManager`'s threadpool are started as early as possible in the application lifecycle (in `nim_status_client.nim`). The `TaskManager` creates a thread to run the threadpool. During its initialization, the threadpool then spools up all the threads it will manage and puts them in an idle thread sequence. This is to prevent expensive thread creation and teardown happening during the app's lifetime as it is quite expensive and blocks the main thread. When tasks comes in to the pool, the task is sent to an idle thread, or put in a queue if all threads are busy. The idle thread is moved to the busy thread sequence. When a task is completed, the thread is taken out of the busy threads sequence and moved back in to the sequence of idle threads, effectively recycling it.

The first `spawnAndSend` we were able to change over to the new threadpool was `estimate`, which estimates the gas of a sticker purchase transaction.

From the consumer point of view, the existing `spawnAndSend` to achieve this looks like:
```nim
  proc estimate*(self: StickersView, packId: int, address: string, price: string, uuid: string) {.slot.} =
    let status_stickers = self.status.stickers
    spawnAndSend(self, "setGasEstimate") do:
      var success: bool
      var estimate = status_stickers.estimateGas(packId, address, price, success)
      if not success:
        estimate = 325000
      let result: tuple[estimate: int, uuid: string] = (estimate, uuid)
      Json.encode(result)
```
And the new syntax looks like this:
```nim
  proc estimate*(self: StickersView, packId: int, address: string, price: string, uuid: string) {.slot.} =
    self.status.taskManager.threadPool.stickers.stickerPackPurchaseGasEstimate(cast[pointer](self.vptr), "setGasEstimate", packId, address, price, uuid)
```
The logic inside the `spawnAndSend` body was moved to [src/status/tasks/stickers.nim](https://github.com/status-im/status-desktop/compare/experiment/tasks-3?expand=1#diff-09e57eef00b0cee5c4abdb9039f948d8372e7003e09e934a9b4c7e9167d47658).

This is just the first migration of `spawnAndSend`, however moving the majority of the remaining `spawnAndSend`s will likely just be an exercise in copy/pasta. There will be one or two that may require a bit more thinking, depending how they rely on data from the model.

Once the `spawnAndSend`s have been converted to the threadpool, we can start implementing the [long-running process from the task runner use case experiments](https://github.com/status-im/nim-task-runner/blob/test/use-cases/test/use_cases/test_long_running.nim).

And finally, we can then implement the [async tasks](https://github.com/status-im/nim-task-runner/blob/test/use-cases/test/use_cases/test_async.nim) if needed.

@michaelsbradleyjr and I spent many hours digging in to the depths of nim's memory management in an attempt to understand it. We have created [a presentation with our task runner experiment findings](https://docs.google.com/presentation/d/1ItCxAfsVTcIoH_E4bgvmHljhbU-tC3T6K2A6ahwAedk/edit?usp=sharing), and @michaelsbradleyjr has spent time [answering questions off the back of that presentation.](https://gist.github.com/michaelsbradleyjr/1eaa9937b3fbb4ffff3fb814f0dd82a9).

We have created a fork of `edn.nim` at `status-im/edn.nim` and we need the PR to be merged and the commit hash updated before we can merge this PR in to `status-desktop`.
2021-03-18 13:15:05 -04:00
Michael Bradley, Jr 016dd3081b refactor: nim_status -> status_go
Also, `status_go.startWallet` proc should be called with a boolean argument.
2021-03-16 16:37:27 -04:00
Michael Bradley, Jr c4e786bae3 build: add vendor/nim-status-go submodule 2021-03-16 16:37:27 -04:00
Michael Bradley, Jr 470d2e5a17 build: remove vendor/nim-status submodule 2021-03-16 16:37:27 -04:00
Richard Ramos e4cdb29a0b Update nimbus-build-system version 2021-03-11 10:36:18 -05:00
Jonathan Rainville f9817d4f52 feat: add community requests, permissions, ENS and more 2021-03-03 16:45:23 -05:00