Commit Graph

1056 Commits

Author SHA1 Message Date
Eric Mastro 590192ad9e fix: show suggestion profile pics for contacts only
Fixes: #2365.

Previously, suggestions for mentions were showing profile pics even for users who were not contacts. Now, profile pics are only shown for those users who are contacts. The user’s identicon is shown otherwise.

fix: user thumbnail not shown when no profile pic
When a user was a contact, but didn’t have a profile pic, an image would not be loaded and a ‘reload’ image would be shown instead. With this PR, if the user is a contact and they do not have a profile pic, their identicon will be shown instead.
2021-05-14 10:27:53 -04:00
Jonathan Rainville a0029ce270 refactor(ChatInput): refactor text formation to increase perfo and enbale undo 2021-05-14 10:27:47 -04:00
Eric Mastro ee1287b71d fix: prevent crash on generate account wrong password
Fixes #2448.

Currently, if a wrong password is entered when generating a wallet account, the app will crash due to attempting to decode a `GeneratedAccount ` from an rpc response containing only an error.

With this PR, we are detecting if an error is returned in the response, and if so, raising a StatusGoException. This exception is caught in the call chain, and translated in to a `StatusGoError` which is serialised and sent to the QML view, where it is parsed and displayed as an invalid password error in the input box.

refactor: remove string return values as error messages in wallet model
In the wallet model, we were passing back empty strings for no error, or an error as a string. This is not only confusing, but does not benefit from leaning on the compiler and strong types. One has to read the entire code to understand if a string result is returned when there is no error instead of implicitly being able to understand there is no return type.

To alleviate this, account creation fundtions that do not need to return a value have been changed to a void return type, and raise `StatusGoException` if there is an error encountered. This can be caught in the call chain and used as necessary (ie to pass to QML).

refactor: move invalid password string detection to Utils
Currently, we are reading returned view model values and checking to see if they include a known string from Status Go that means there was an invalid password used. This string was placed in the codebased in mulitple locations.

This PR moves the string check to a Utils function and updates all the references to use the function in Utils.
2021-05-14 10:27:37 -04:00
Pascal Precht 7329522a28 chore: add StatusQ as dependency
This commit does a couple of things:

- add StatusQ as a dependency (https://github.com/status-im/StatusQ)
  our emerging component library
- updates the rcc generation script to follow symlinks as well
- add qrc:/./StatusQ/src as import path

At the time of creating this commit `StatusQ` provides only the StatusIcon
component, but more will be added in the future.
2021-05-04 14:42:28 -04:00
Jonathan Rainville eac7009807 feat(community): fetch community info from link
Fixes #2290
2021-05-03 14:36:37 -04:00
Eric Mastro 0850835b34 fix: Send Message button not working in profile popup
Fixes: #2364

The Send Message button click event was erroring due to a refactor that had been done to allow for changing app sections.

This has been updated to follow the current way to change app sections.

fix: “Send Message” button crash in communities
This required switching from communities to normal view.

fix: crash when clicking channel link in community message
When a message in communities contains a link to another channel (ie #otherchannel), the search for this channel needed to be updated to also search for the channel by name, allowing for switching between channels within a community by message link. Additionally, when in a community, if the channel was located in a normal chat, it will switch the view to the normal chat after being found.
2021-04-29 12:36:58 -04:00
Jonathan Rainville 3a7c95967a feat: implement redesign of message replies
Fixes #2303
2021-04-29 12:35:59 -04:00
Jonathan Rainville 2c3449e676 chore: comment out StartWallet for the moment 2021-04-29 12:30:05 -04:00
Pascal Precht bceed7b7aa fix(Communities): receive community info after community import
This commit ensures that, once a community was imported, the application
will listen to the newly introduced `community.found` signal, which will be
emitted by status-go.

The signal exposes a `Community` object that is then used to add a
community item to the community list in the UI.

**This can only land after https://github.com/status-im/status-go/pull/2177 has landed first!**

Fixes #2024
2021-04-29 12:30:05 -04:00
Michael Bradley, Jr 02b26f3c28 build: launch nim_status_client directly in packaged builds for macOS
Remove the `nim_status_client.sh` launcher script and make related changes.
2021-04-28 07:15:44 -05:00
Jonathan Rainville fcc133e9d1 fix(Settings): fix QT settings not being saved on first start
Fixes #2312

This will reset the QT settings of all users, since we change from using the address to using the pubkey.
The reason for that is that the account address also called keyId is somehow not set correctly on first login. The pubkey stays constant on the other hand. So using the pubkey is better.
2021-04-27 15:27:48 -04:00
Richard Ramos 6fd68c10f3 fix: handle tokens with no decimals
Fixes #2432
2021-04-27 14:12:19 -04:00
Eric Mastro cf361de1e0 feat: show ENS name in notifications
Fixes: #2418.

Chat notifications for one-on-one chats were showing only a user’s alias and not their ENS name if they have one.

This PR now shows a user’s ENS name if they have one, or their alias if they don’t in one-on-one chat notifications.
2021-04-27 10:29:32 +02: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 86e69132c6 feat: add error handling to mark messages as seen logic 2021-04-20 14:44:27 -04:00
Pascal Precht aeedc87368 feat: introduce global settings
This commit introces global settings that apply across accounts used
inside the application. This is useful when settings like the selected
locale should b the same across all accounts.

Closes #2144
2021-04-19 13:53:14 +02:00
Eric Mastro e47092cfd0 feat: settings cache efficiency update
Current settings caching logic was inefficient when attempting to retrieve settings that contain the sensitive mnemonic. While those calls were limited to the login logic, each call would need to round trip to status-go to get all settings when they wanted to include sensitive data, as the cache was not being updated for these calls.

This PR updates the cache regardless if sensitive data is requested of not, effectively making the caching mechanism more efficient during login.
2021-04-15 17:02:28 -04:00
Eric Mastro 0a108dd849 feat: Add libstatus contacts caching
Fixes #2131.

After some heavy profiling, it became clear that sending of each message was causing a fetch to get all contacts from status-go. This was incurring a minimum of a 0.03s delay for each fetch, which was causing a bottleneck each time it was called for various operations throughout the codebase.

This code addds a layer of threadsafe caching to the contacts call, such that only the first call to contacts fetching will incur the delay, as well as every fetch after a contacts CUD operation.
2021-04-15 17:02:08 -04:00
Eric Mastro e7571bd2a4 feat: Add Methuselah and Mailserver long-running task
Fixes #2143.

Methuselah is the a task manager for long-running tasks. It allows fo registration of workers that will each run in their own thead. Each worker can pass messages to and recieve messages from the main thread.

MailserverWoker was also introduced which moves all mailserver model logic to a MethuselahWorker. All communication to/from the model is done via a MethuselahTask. Results of the task are returned to the main thread by way of `signal_handler`, which calls the QtObject slot specified in the task.

Mailsever also provides a way for the model to emit events inside of the worker. These events are forwarded to the main thread via the `receiveEvent` slot of the `MailserverController`.

Co-authored-by: Michael Bradley, Jr <michaelsbradleyjr@gmail.com>
2021-04-14 15:37:05 -04:00
Eric Mastro 0d677eb156 chore: change threadpool logs from debug to trace 2021-04-14 15:36:36 -04:00
Jonathan Rainville 1983fa79aa feat: improve ens search in wallet send by showing the result 2021-04-14 14:39:11 -04:00
Jonathan Rainville 438517a610 fix: fix missing channel identifier in new community chats
Fixes #2211
2021-04-14 12:33:45 -04:00
Jonathan Rainville ba500e5f73 fix: fix notifications not working for community chats
Fixes #2210
2021-04-14 12:33:45 -04:00
Pascal Precht 46fd32aaee feat: add SOCKS token to list of default tokens
Closes #2215
2021-04-14 10:46:49 +02:00
Jonathan Rainville 63b5c549b9 fix: fix invite button not setting Joined correctly
Fixes #2209
2021-04-13 17:50:32 -04:00
Pascal Precht 5ca9d66212 fix(Communities): ensure newly created community is opened 2021-04-13 15:21:00 -04:00
Richard Ramos 8543bf04d4 fix: code review 2021-04-06 14:31:06 -04:00
Richard Ramos 61555d610b fix: it's not necessary to leave chats 2021-04-06 14:31:06 -04:00
Richard Ramos 55ecb50f1b chore: autoremove chat groups 2021-04-06 14:31:06 -04:00
Richard Ramos 31f85787a6 fix: decline chat group invites if admin is not a contact 2021-04-05 12:02:05 -04:00
Richard Ramos 52b18c0c82 fix: leave chat groups 2021-04-05 12:01:45 -04:00
Eric Mastro 40dc428f63 fix: ens search hang
ENS search was executed in a task runner task. The task had a mistake during the copy/paste port from spawnAndSend.
2021-04-01 17:16:54 -04:00
Jonathan Rainville a01e851070 fix: fix being unable to put multiple spaces in a row 2021-04-01 17:07:25 -04:00
Jonathan Rainville 8b3ce83d00 fix: input box disappearing on communities
Fixes #2155
2021-03-31 16:53:08 -04:00
Jonathan Rainville 996b36714d fix: fix scroll speed on Windows 2021-03-30 16:02:10 -04:00
Jonathan Rainville a337b293da feat: show community context menu on Community button 2021-03-30 15:53:32 -04:00
Jonathan Rainville 147d93815f fix: fix unable to write to invite only community channels
This was caused by the fact that the canPost property was not exposed from the ChatItem model.
I'm actually not sure why it didn't show an error trying to call  a function that doesn't exist
2021-03-25 16:38:05 -04:00
Eric Mastro 2336aa4e6f fix: custom token validation for non-token addresses
When contract addresses that are not ERC-20 or ERC-721 were input, the token would be allowed to be added and would crash the app.

In addition, when an ERC-20 contract was deployed without a name and symbol, “Invalid ERC-20 address” would appear.

This PR adds error checking from the token detail lookup and reports the error back to the user in the modal. This prevents non-ERC-20/721 contracts from being able to be added to the app and prevents a crash.
2021-03-25 15:52:02 -04:00
Pascal Precht bb932ac35e fix(Timeline): remove "fetch more" fake message
Two fake messages are usually added to chat message lists inside a channel or
chat:

- One that imitates a chat identifier
- one that creates a button to fetch older messages

These two fake messages are added so it's ensured they show up at the beginning
of the chat.

The status timeline is also just a list of messages (filtered by a certain message
type), however there's no need to render these fake messages in this scenario.
That's why a `addFakeMessages` flag has been introduced which conditionally adds
those fake messages here: https://github.com/status-im/status-desktop/commit/3f012dbf0#diff-6aa545137319516beb03623bc6a9750e1d14a40c68d8868b5a672320fc4d680aR69

At some point, possibly around here (https://github.com/status-im/status-desktop/commit/8ee5abe57), the fake message for
the fetch more button has been reintroduced as default fake message.

This commit puts it back into the function so that it doesn't show up
inside the timeline view.
2021-03-24 14:41:43 -04:00
Michael Bradley, Jr 1200632989 feat: remove all remaining spawnAndSends
refactor: move threadpool task declarations inline with views

Co-authored-by: Michael Bradley Jr. <michaelsbradleyjr@gmail.com>
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2021-03-24 14:30:33 -04:00
Jonathan Rainville 7188579e46 fix: fix mention showing as pubkey and show styling 2021-03-24 14:16:55 -04:00
Jonathan Rainville 5d67a3f5f9 fix: fix sending three word names mentions not working 2021-03-24 14:16:55 -04:00
Jonathan Rainville 2a9f9118a1 fix: fix settings not being refetched when they had been edited before 2021-03-24 12:06:24 -05:00
Pascal Precht 20d0d162b5 fix(Contacts): ensure app doesn't crash when contact can't be resolved
There was a bug introduced https://github.com/status-im/status-desktop/commit/2ac67f95a where we'd rely on the
possibly resolved public key, which is passed to `generateAlias()`.

The public key is never guaranteed to be an actual key (if resolution fails,
it's a an empty string). Passing an empty string to `generateAlias()` causes
`status-go` to crash and we don't handle that error.

This commit ensures that we only attempt to generate an alias when we
indeed have a successfully resolved public key.
2021-03-22 15:49:38 -04:00
Eric Mastro b7124372e9 feat: stickers spawnAndSend to threadpool task
Move the remaining stickers spawnAndSend (obtainAvailableStickerPacks) into a threadpool task.

refactor: create a base class for tasks models to inherit from

NOTE: this branch is based off of `experiment/tasks-3` and should be rebased on master once that branch is merged.
2021-03-19 15:38:50 -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
Jonathan Rainville 62d10eba49 feat: show community invite component on community link 2021-03-17 16:09:23 -04:00
Jonathan Rainville 5581fca41d feat: show default unfurling for community links 2021-03-17 16:09:23 -04:00
Pascal Precht 9faf349b83 fix(libstatus): add safety check before accessing API response
We've introduced a regression in https://github.com/status-im/status-desktop/commit/f1e83f74b#diff-f35edd413addd14c1f81816d6b5ee2bcbdf85fa0e3295d324cb78c98e26d4327L364 where we check whether an RPC's `error` is `null`
and its `result` is not `null`.

This breaks the application with an illegal storage access,
 as in case of a successful API call, the response will have only a `result` key
 (even when it's `null`).

Since we haven't done anything with a possible `error` in the reponse even before
that change was made, this commit removes the `error` check and safe guards around
whether `result` exists.

Fixes #2062
2021-03-17 12:13:59 +01: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
Richard Ramos 4f4a3f1c30 feat: see stickers details when clicking on a sticker 2021-03-16 15:39:52 -04:00
Eric Mastro f1e83f74bc feat: drag and drop images
Allow up to 5 images to be dragged and dropped in to one-on-one chats and in the timeline. Can be combined with the existing upload button. The upload file dialog has been changed to allow multiple selections. Drag and dropped images adhere to the following rules, with corresponding validations messages:
- Max 5 image
- Image size must be 0.5 MB or less
- File extension must be one of [".png", ".jpg", ".jpeg", ".heif", "tif", ".tiff"]

Drag and drop and uploaded images are now also deduplicated.
2021-03-16 13:51:37 -04:00
Jonathan Rainville 7bb8a968c9 fix: fixes the ordering problem on deleting a channel
Fixes #2035
Also goes back to your first channel when deleting the current channel
2021-03-15 14:10:14 -04:00
Richard Ramos 3c024db15e fix: marking a mailserver as trusted is not necessary as this is done by status-go already 2021-03-11 10:35:31 -05:00
Pascal Precht 99dfd7b13a fix(Communities): ensure importCommunity API returns response
Prior to this commit we were ignoring the returned response of the
API call, making it impossible to work with it in case it's needed.
2021-03-11 10:00:05 -05:00
Pascal Precht 01d3369c64 fix(Communities): fallback to letter identicon if no image available
Prior to this commit, communities without an image would render invisible
in the navigation bar of the application. To avoid this, we're now falling
back to our StatusLetterIdenticon component, which renders the first letter
of the community name with the color of the community.
2021-03-11 10:00:05 -05:00
Jonathan Rainville 131685ecf5 fix: fix member popup layout and member not showing
Fixes #1949
2021-03-05 13:57:49 -05:00
Jonathan Rainville 5300dcac28 fix: fix getChannelById crashing on timeline call
Fixes #1987
2021-03-05 12:21:06 -05:00
Jonathan Rainville e94cfaec74 fix: fix member count not updating when inviting
Fixes #1949
2021-03-03 16:45:23 -05:00
Jonathan Rainville d1c6c0f9a9 fix: fix adding a second channel to a community disapearing
Fixes #1953
2021-03-03 16:45:23 -05:00
Jonathan Rainville 2f8d46fa76 fix: fix community channel color undefined issue 2021-03-03 16:45:23 -05:00
Jonathan Rainville e806ef9ff9 fix: fix clear chat and mute/unmute chat for communities 2021-03-03 16:45:23 -05:00
Jonathan Rainville 84034d5dbf fix: fix channel color in communities 2021-03-03 16:45:23 -05:00
Jonathan Rainville b33a7b8fcf fix: fix right clicking a channel in community
Fixes #1950
2021-03-03 16:45:23 -05:00
Jonathan Rainville e52f6daec9 feat: update to latest status go and add color to the community 2021-03-03 16:45:23 -05:00
Jonathan Rainville e28e98a394 fix: fix community rebase errors 2021-03-03 16:45:23 -05:00
Jonathan Rainville 35688e9740 feat: show unfurled link for status chats in 1:1 2021-03-03 16:45:23 -05:00
Jonathan Rainville f8704d7b64 feat: show unviewed count on the community button 2021-03-03 16:45:23 -05:00
Jonathan Rainville b76cb5682c fix: chats not updating on new messages in communities 2021-03-03 16:45:23 -05:00
Jonathan Rainville c57356235b fix: fix calling setActiveChannel from QML 2021-03-03 16:45:23 -05:00
Jonathan Rainville da77487746 fix: fix invite to use new API and remove the double msg send 2021-03-03 16:45:23 -05:00
Jonathan Rainville 941e9565ab fix: going to the previous channel when the community has no channel 2021-03-03 16:45:23 -05:00
Jonathan Rainville b38d1df591 refactor: move communities functions to communities view in chat 2021-03-03 16:45:23 -05:00
Jonathan Rainville 807048522a fix: ste channels correctly when going back and forth to communities 2021-03-03 16:45:23 -05:00
Jonathan Rainville f9817d4f52 feat: add community requests, permissions, ENS and more 2021-03-03 16:45:23 -05:00
Richard Ramos fb8380a861 Show login errors on the console 2021-03-03 15:45:36 -05:00
Pascal Precht 3615a16b70 fix(libstatus): make saveContact API memory safe(r)
In https://github.com/status-im/status-desktop/commit/31a9d1a6f we've fixed
a bug where a contact's thumbnail hasn't been passed to the `saveContact`
API.

Unfortunately, that fix wasn't memory safe. There are cases when a contact's
`identityImage` is `nil`, resulting in illegal storage access when accessing
a contact's thumbnail.

This commit fixes the issue by safe guarding around `identityImage` possibly
being `nil`.
2021-03-01 14:19:05 -05:00
Richard Ramos 358f647735 fix: delete mailserver topic on leaving channel 2021-02-25 15:42:46 -05:00
Jonathan Rainville 6bd8aa9504 fix: fix asset balances on new accounts 2021-02-25 15:42:33 -05:00
Richard Ramos 8ee5abe570 fix: chat identifier / fetch more messages order 2021-02-25 15:40:58 -05:00
Richard Ramos b43122d7f3 feat: use stacklayout for chat messages 2021-02-23 08:53:31 -05:00
Jonathan Rainville 98b3e64573 chore: update status-go version and update mailservers api 2021-02-22 10:01:19 -05:00
Jonathan Rainville 5327b7feea fix: fix mention not being removed 2021-02-22 09:58:28 -05:00
Pascal Precht 18ea9dc2cd fix: make reactions in 1-on-1 chats work
Turns out message reactions weren't functional in 1 on 1 chats.
Reaction signals come with a `chatId` that they correspond to, which is
then used to determine to channel and message list to apply/remove
the reaction to.

Inside of a 1 on 1 chat, the `chatId` of a reaction coming from the
will always be the pubKey of the the user that receives it.
A user however, usually doesn't store a chat item for her own pubKey
unless it's of type `Profile`.

This results in an illega storage access as reported in #1828

This commit fixes this bug by checking whether the reaction `chatId`
matches the user's `pubKey`. If that's the case, we know that the reaction
corresponds to the reaction's `fromAuthor` chat.

Fixes #1828
2021-02-22 09:58:07 -05:00
Richard Ramos b1b32d354d fix: TLS verification 2021-02-22 09:57:42 -05:00
staked-smart-ace 1ad506e746 Fixed dismissing issue when update contact's profile. Fixes #1761 2021-02-22 09:54:18 -05:00
staked-smart-ace 31a9d1a6f1 Fixed dismissing issue when update contact's profile. Fixes #1761 2021-02-22 09:54:18 -05:00
Richard Ramos 228e746421 fix: Disable ListenAddr as it is not necessary for running status-desktop 2021-02-18 17:55:50 -05:00
Richard Ramos 38eeaf111c fix: update image when switching account on login
Fixes: #1847
2021-02-18 16:40:33 -05:00
ace-smart 03353af634 Updated codes be more compacted. Fixes #1826 2021-02-11 10:15:29 -05:00
ace-smart 972cf9f138 Fixed the issue doesn't show nickname on profileview in 1:1 chat. Fixes #1826 2021-02-11 10:15:29 -05:00
Pascal Precht 8977ba4931 refactor: redesign PrivateChatPopup to match new designs
This commit introduces the new design and behaviour of the modal
that opens up when starting a new 1-on-1 chat.

Main changes include:

- New search UI/UX functionality of users and ENS resolutions
- Composed view of existing contacts and contacts to be searched
- Ability to add contacts from within the modal

Closes: #1747
2021-02-10 13:39:25 -05:00
Richard Ramos 2ac67f95aa fix: add contact using status ens name 2021-02-08 17:39:10 -05:00
Richard Ramos 366ebffbe7 fix: code review 2021-02-08 17:37:44 -05:00
Richard Ramos d0de5c074f fix: populate suggestion box with all users from the message list
Fixes: #1328
2021-02-08 17:37:44 -05:00
Jonathan Rainville 1616ae255b refactor: check mentions in toMessage 2021-02-08 16:48:14 -05:00
Jonathan Rainville bffe888b0d feat: improve compact mode to fix all alignements 2021-02-08 16:48:14 -05:00
Richard Ramos 4a9f63c59a fix: code review 2021-02-01 14:23:29 -05:00
Richard Ramos e76e936d2b feat: request older status updates 2021-02-01 14:23:29 -05:00
Richard Ramos c241bd47db fix: code review 2021-02-01 12:02:55 -05:00
Richard Ramos 81c33fe2af Do initial balance fetch async 2021-02-01 12:02:55 -05:00
Richard Ramos 17477b0c45 fix: code review 2021-02-01 12:02:55 -05:00
Richard Ramos 55466416d6 fix: initial load of messages and reactions done on a separate thread 2021-02-01 12:02:55 -05:00
Richard Ramos 6af10ac900 fix: determine if a mnemonic has been loaded only once 2021-02-01 12:02:55 -05:00
Pascal Precht b1e5a15e2a refactor(ChannelContextMenu): remove dependency on active channel
This commit does a bunch of things:

- First and foremost, it removes the active channel dependency.
  This is needed to have it operate on the correct channel object,
  without forcing us to change the active channel (e.g. right-clicking
  on a channel item that's not active, will make it active eventually)
- To make that work, this commit changes the `ChannelContextMenu`
  to receive a `ChatItemView`, so it can be used for things like determining
  what menu options are shown, what members are in a group, whether
  someone is admin of a group etc.
- This also required a new `QtProperty` called `contextChannel`.
  The reason this is required, is because in some cases, like receiving
  members count of groups, we need a complete `ChatItemView` object
  as we don't have access to certain APIs otherwise.
- Unfortunately, we can't pass down `activeChannel` every where for that
  because sometimes the context menu should not actually operate on
  the active channel.

Fixes: #1755
2021-02-01 11:53:06 -05:00
Jonathan Rainville 6dad050cc7 fix: fix muted chats not updating correctly in the profile 2021-01-22 13:41:46 -05:00
Jonathan Rainville edf3e99f08 fix: update muted channel state if the channel is the active one 2021-01-21 12:04:27 -05:00
Jonathan Rainville 64a0710897 fix: fix channel not updating on new messages 2021-01-20 17:36:42 -05:00
Jonathan Rainville 444072f599 feat: call getPreviewData (url unfurling) in a separate thread
Fixes #1678
2021-01-19 16:51:59 -05:00
Malik Al-Jabr 3ad3739218 fix: gas estimate error
fixes #935
A bug occurs when someone requests a large amount of funds from you since the gas estimation will fail and there isn't a way of handling errors in the source yet.

This PR handles the error appropriatley for both `estimateGas` and `estimateTokenGas` where the response is only converted from hex to int if the RPC call was successful. Otherwise return the error message as the response and let the UI decide how to display it.

Currently the error for gas estimation in transaction bubbles is displayed in a popup however, ive come to realize that 2 popups open instead of one. This is a new bug of which I can't pinpoint the root cause at the moment and have opted to file a separate issue for it.
2021-01-19 16:11:06 -05:00
Jonathan Rainville 3f012dbf00 fix: fix clearing history removing the fake messages 2021-01-18 17:50:45 -05:00
Michael Bradley, Jr 05f38fa966 chore: refactor prod/dev app icon and related logic for macOS 2021-01-15 19:12:42 -05:00
Jonathan Rainville 76688733f5 feat: add muted states for channel
Fixes #1615
2021-01-15 13:52:50 -05:00
Richard Ramos efc1feb2fa feat: add custom mailserver 2021-01-15 13:51:31 -05:00
Pascal Precht 840a6189eb fix: don't show backup message when mnemonic was imported
As reported in #1584 the message that asks users to backup their seed phrase
is shown even when the seed phrase was imported in the first place, implying that
the mnemonic is already backed (it has to come from somewhere, right?).

This commit introduces a new `appSettings` property that is temporarily set to
determine whether or not the backup message should be shown.

It's set only temporarily because we actualy determine whether we want to show the
backup message, by checking if the account's mnemonic is still stored in the settings.
When a backup is done, Status removes the mnemonic from the profile settings.

So in order to get the right behaviour we need to make sure to remove the mnemonic
from the profile settings after the account has logged-in and originated from
an imported seed phrase. This is done by setting the mentioned property.

Closes #1584
2021-01-15 13:51:20 -05:00
Pascal Precht 7102596b3f fix(Timeline): make reactions works
This commit makes reactions in the status timeline work.
There are two things prior to this commit that are broken:

1. The logic that opens the reaction context menu always expects
   and instance of `chatsView` because it tries to calculate a users
   nickname. Such an instance isn't always available in that context, so
   the nickname logic has been moved to `appMain` for now, removing that
   dependency and therefore making it work in both, the chat view as well
   as the status view.
2. While 1) makes the context menu work, it turns out that adding and
   removing reactions inside the status timeline is still not working.
   The reason for that is, that the reactions component maintains its own
   `messageList`, which isn't aware of the fact that reactions for messages
   coming from chats of `ChatType.Profile`, need to go into a dedicated
   message list for `ChatType.Timeline`.

In other words, reactions are sent and removed from message in messagelists
that don't actually exist.

This commit fixes both of these things by ensuring the message lists
maintained by reactions are timeline aware. Also ensuring updates are
done correctly.
2021-01-14 15:33:46 -05:00
Jonathan Rainville a5fce2b7de fix: fix chat not scrolling because the signal was not called 2021-01-13 16:27:13 -05:00
Richard Ramos 6b1cef9235 List custom networks and allow selecting them 2021-01-12 13:26:39 -05:00
Richard Ramos 0acc959e4d Save new networks 2021-01-12 13:26:39 -05:00
Jonathan Rainville e747ed8f1b fix: pending transactions crashing on infura issues 2021-01-12 12:40:51 -05:00
Richard Ramos 4b72e5dde0 fix: pinned mailserver default value 2021-01-11 14:51:08 -05:00
Richard Ramos 199d5a0342 use mailserver cycle or specific mailserver depending on settings 2021-01-11 14:01:17 -05:00
Richard Ramos 2a6eb20094 pin selected mailserver 2021-01-11 14:01:17 -05:00
Pascal Precht b0cd49b111 fix(Timeline): ensure messagesList QtProperty is notified for rendering
The `messageList` model used for rendering messages gets notified by the
`activeChannelChanged()` signal. That signal is not immediately emitted inside
the timeline when new messages are received.

This causes the underlying view data to be out of sync with the model,
causing UI bugs, such as rendering the `EmptyTimeline` component when in fact,
the timeline is not empty.

To fix this, there are two options:

1. Change the signal from `activeChannelChanged` to `messagePushed` signal, which
is for sure emitted when messages are received
2. Ensure `activeChannelChanged` is emitted when messages are pushed and the
active channel is indeed the timeline

Since the application has been relying on `activeChannelChanged` so far, I decided
to go with option 2 as I'm not sure whether option 1 would introduce other unwanted
side effects.
2021-01-11 13:59:23 -05:00
Jonathan Rainville 0ff5fa32f0 fix: fix channels reordering and messing up the profile image 2021-01-11 13:57:35 -05:00
Jonathan Rainville 7b03da2967 feat: enable removing member and fix invites 2021-01-11 13:57:35 -05:00
Jonathan Rainville b3844d4012 fix missing function 2021-01-11 13:57:35 -05:00
Jonathan Rainville d48043ee22 chore: cleanup community code 2021-01-11 13:57:35 -05:00
Jonathan Rainville a90a30af11 add import for a community 2021-01-11 13:57:35 -05:00
Jonathan Rainville 82405cc425 add export function and button 2021-01-11 13:57:35 -05:00
Jonathan Rainville a22c5942ff chore: update member variable name to memeberPubKey 2021-01-11 13:57:35 -05:00
Richard Ramos 78e7fa380c feat: display a community's member list 2021-01-11 13:57:35 -05:00
Jonathan Rainville a06dd403a4 fix: fix fetching messages for community chats 2021-01-11 13:57:35 -05:00
Jonathan Rainville 8c258b528b fix: fix community messages appearing in the normal chat list 2021-01-11 13:57:35 -05:00
Richard Ramos 2ed3261170 Minor UI changes for communities 2021-01-11 13:57:35 -05:00
Jonathan Rainville 2d3a870f60 wip community invitatations and more 2021-01-11 13:57:35 -05:00
Jonathan Rainville ce3252fb8f wip community 2021-01-11 13:57:35 -05:00
Jonathan Rainville a0c1b1552d fix: fix leaving a channel with no messages 2021-01-04 15:23:23 -05:00
Pascal Precht 0767ce2443 feat: introduce timeline
Closes #1489 #1490 #1491
2021-01-04 15:16:37 -05:00
Jonathan Rainville 6afe9088e9 fix: show notification if the window isn't focused 2020-12-28 14:29:54 -05:00
emizzle 7e1d7be314 feat: load installed stickers while offline
When the network connection is changed, the sticker packs are cleared and then re-loaded (either loading the offline (installed) sticker packs, or all the sticker packs from the network).

Stickers can be sent while offline, though the sticker images do not load once offline (this is likely a side effect of the bug described below).

There is a known bug in QNetworkAccessManager (https://bugreports.qt.io/browse/QTBUG-55180) that was re-introduced in 5.14.1 that does not allow us to download resources if we go offline then come back online. The workaround employed in this PR manually sets the NetworkAccessible property of QNetworkAccessManager once we have been connected back online. The NetworkAccessible property is marked as obsolete and will be removed in Qt6, so it is something that we need to be aware of when we upgrade. However the hope is that the bug has been fixed.

Close StickersPopup when disconnected from network (so that re-loading of sticker packs doesn't look out of place).

fix: set network status correctly at load

feat: stickers gas estimate async

feat: When network re-connected, any http images that were not properly loaded in an ImageLoader component will automatically be reloaded.

fix: Sticker button loading icon

chore: Bump nimqml and dotherside

NOTE: This PR uses an updated nimqml and dotherside. The respective changes should be merged first, and the commit hash should be bumped in this PR prior to merging. Relevant PRs:

[https://github.com/status-im/dotherside/pull/20](https://github.com/status-im/dotherside/pull/20)

[https://github.com/status-im/nimqml/pull/17](https://github.com/status-im/nimqml/pull/17)
2020-12-28 14:29:38 -05:00
Richard Ramos ac32cb9d67 chore: remove unused imports and change mailserver verification log level to trace 2020-12-22 16:08:01 -05:00
Pascal Precht 3e5047cfaf feat: introduce isStatusUpdate flag in sendMessage APIs
When sending a profile status update, the message has to be sent to
a specific channel that has the id `@PUBKEY`.

This commit introduces a flag that controls whether the message is
sent to the currently active channel, or tot he profile status channel.

The same is done for the `sendImage` API.
2020-12-21 14:14:48 -05:00
emizzle 6a0a75888b feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.

Two sites have been added to the whitelist: giphy.com and tenor.com.

`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.

The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.

feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.

fix: height on settings update issue

feat: move date/time of message below links

fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`

feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-21 14:14:32 -05:00
Pascal Precht 810ce12a56 feat: make saveChat API more flexible by taking a ChatType
Previously, this API would take a flag `oneToOne` and would use it to determine
whether the chat type is going to be `1` or `2`. However, there are many more chat
types, so it's important this API supports all of them.

Since we already have an enum in place, I'm changing this function to take it instead.

In addition, it also gets a `profile` parameter which is needed to implement
the status timeline functionality.
2020-12-18 15:39:46 -05:00
Pascal Precht d91d41cffa feat: introduce getAllContacts and getAddedContacts APIs
Primary motivator here was that the current `getContacts` APIs requries
a `ContactModel` which isn't always around. In fact, there's actually
no particular reason this APIs has to live on a model object.

However, to not break existing APIs I'm introducing a `getAllContacts`
API that returns all contacts as profiles, just like `contacts.getContacts`
does, without it being dependent on a `ContactModel`.

The same function is then used to add an API for returning all *added*
contacts as profiles.
2020-12-18 15:39:37 -05:00
Michael Bradley, Jr 13daa540e4 build: use a different colored app icon and a non-default STATUS_PORT for dev builds
By default the desktop app uses port 30305, unless a value is specifically set
in environment variable `STATUS_PORT`. For convenience of those developing the
app and running development builds, while simultaneously running production
builds (a.k.a. packaged builds, whether built locally or in CI), have `make
run` invoke `bin/nim_status_client` with `STATUS_PORT=30306`. That value can
still be overriden by manually invoking `make run` with a different value,
e.g. `make STATUS_PORT=30307 run` and `STATUS_PORT=30307 make run` are both
valid and achieve the same effect. NOTE: the port "sticks" in the database
after the first clean run, so when changing ports developers will need to
delete the data dir within their local repository, else the existing database
for dev builds will be stuck using whatever port was used previously. In the
future, we can figure out a means to always update the port setting in the
database just after the login event (but see #1505).

Also, for development builds use an icon (for the running app) that is
orangered (`#ff4500`) instead of the official blue color. This makes it much
easier to select between a running production instance and development instance
when Cmd-Tab'ing (on macOS, or equiv on Linux and Windows) through open
applications. Not all icons displayed at runtime have been changed in this
manner for development builds, just the main application icon, and that seems
to be sufficient to achieve the desired effect; though in the future we could
do similar for notification icon, menu bar icon, etc.
2020-12-18 15:37:06 -05:00
emizzle ba48b266a9 chore: re-add sticker loading UI
The sticker loading UI was removed when the StatusChatInput and friends were added in. This PR re-adds the sticker loading UI introduced in PR# 955 (https://github.com/status-im/nim-status-client/pull/955).
2020-12-18 15:34:31 -05:00
Pascal Precht 4354ee15ed fix: introduce chat types for Timeline and Profile
When dealing with Timeline and Profile chat data, the `HEAD~1` would break
because we're trying to access `ChatType(4)` inside our `toChat` API.

To fix this issue, we have to make `ChatType` aware of `4` and `5` which are
`Profile` and `Timeline` respectively.
2020-12-18 15:20:20 -05:00
Richard Ramos 3258ac8f9c feat: disconnect accounts in browser 2020-12-17 16:44:50 -05:00
Jonathan Rainville 5dcd401cd5 fix: fix images sometimes being null 2020-12-17 16:44:25 -05:00
Jonathan Rainville d5f3cf71a2 Apply suggestions from code review
Co-authored-by: RichΛrd <info@richardramos.me>
2020-12-17 16:44:25 -05:00
Jonathan Rainville d01c9fef79 feat: add profile pic support 2020-12-17 16:44:25 -05:00
Michael Bradley, Jr d618d0cc53 fix: newline replacement with `<br/>` should replace Windows `\r\n` line endings also 2020-12-15 13:16:10 -05:00
Michael Bradley, Jr 1ea4af17af fix: in renderInline after escaping html replace all newlines with `<br/>` 2020-12-15 13:00:03 -05:00
Michael Bradley, Jr d20f5a55eb fix: import status/libstatus/types in src/app/chat/view.nim 2020-12-11 10:09:01 -06:00
emizzle 5953031bfc fix: YouTube unfurling
YouTube link unfurling was not working for a couple reasons.

There were two main parts fixed:
1. QML context for messages pertaining to linkUrls and imageUrls was changed from implicit to explicit. By this, I mean that any time we referenced linkUrls/imageUrls, we were relying on the knowledge that those values would be populated by some parent context several levels up. Now, we are referring to properties that have been explicitly defined on the components. This offers the ability to reuse components, and makes reading the code and debugging much easier.
2. Error handling has been added to getting link preview data. An unhandled "error" was thrown each time a link that wasn't whitelisted was passed in, causing the app to crash. For example, when a link to a tenor gif was posted in the chat, that URL was not whitelisted, causing the app to crash.
2020-12-10 14:45:48 -05:00
Michael Bradley, Jr 8de3a3f48f refactor: in Windows packaged build fleets.json should be in resources/
In the context of Windows packaged builds, this is consistent with other
resources needed by the application; organizing them in this way keeps the
top-level directory of Windows packaged builds clear of files that most users
should never have to see or think about.
2020-12-10 12:03:39 -06:00
Pascal Precht e11139df12 feat: make `UserNameLabel` render local nick names and ENS names
In timeline status update messages we want to render the ENS name next to a
local nickname in case it exists. This commit extends the `UsernameLabel` to do
just that.

Closes #1488
2020-12-10 12:30:31 +01:00
Richard Ramos 16ae26aa62 fix: remove invalid condition from sendTransaction 2020-12-09 16:38:23 -04:00
Richard Ramos cc9830268a fix: deploy contracts in browser 2020-12-09 14:19:35 -05:00
RichΛrd 87a34104c2 Update src/app/wallet/view.nim
Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2020-12-09 14:19:26 -05:00
Richard Ramos b0829a4615 fix: account selector in browser 2020-12-09 14:19:26 -05:00
Richard Ramos 239b95e9a2 fix: initialize wallet paths and types, and disable deletion of non-watch accounts 2020-12-09 14:18:45 -05:00
Richard Ramos 92bd8a1b96 fix: trigger changes in membership verification on chat update 2020-12-09 14:18:40 -05:00
Michael Bradley, Jr 10d82124fe refactor: embed Infura key at compile time
Allow environmental override at runtime. Also, in the Makefile set a free-tier
default token so that setting up an Infura account isn't strictly necessary for
community contributors to build the app, even though in our docs it should be
recommended they do so.

Core contributors should setup their own free-tier Infura account, create a
key, and set it in the environment variable INFURA_TOKEN in their environment
used to build the desktop app locally.

There is one aspect of this work that is incomplete. Ideally, in the handler
for the `login` event the relevant settings in the database should always be
updated with the resolved Infura key. However, when calling
`getSetting[string](Setting.Networks_Networks)` in the handler it causes a
segfault every time. Neither the reason for the crash nor a workaround have
been worked out at this time.
2020-12-09 12:10:12 -06:00
Richard Ramos ae30d04010 refactor: ProfileView 2020-12-08 17:01:22 -05:00
Richard Ramos 426fe504b4 refactor: move `generateIdenticon` to utils 2020-12-08 17:01:14 -05:00
Richard Ramos ae83818eed refactor: chats view
Extract private groups, reactions, stickers and transactions procs to individual view files
2020-12-08 17:01:14 -05:00
hydrogen f69da599ae fix: update chat view after user is blocked 2020-12-04 15:52:04 -05:00
Richard Ramos 1e245a3375 fix: don't allow importing existing seed phrases / private keys in wallet and clean error messages when opening popup 2020-12-02 14:44:49 -05:00
Richard Ramos cfb17cd85c fix: remove duplicated SNT in token list and add mouse cursor to wallet list 2020-12-02 14:35:07 -05:00
Jonathan Rainville 6e7bb6ba1c code review 2020-12-01 14:07:31 -05:00
Jonathan Rainville 6098a3e4af chore: update status-go to merged develop 2020-12-01 14:07:31 -05:00
Jonathan Rainville 724b73072f refactor: get the bookmark image from status-go instead 2020-12-01 14:07:31 -05:00
Jonathan Rainville ea436e79c6 feat: put favicon urls in the settings when we fetch them 2020-12-01 14:07:31 -05:00
Jonathan Rainville f7cc0cf78d feat: add popup menu to add favorites on sites themselves 2020-12-01 14:07:31 -05:00
Jonathan Rainville a13f1f2043 feat: add basic bookmark support 2020-12-01 14:07:31 -05:00
hydrogen ff5b972139 fix: stop crash by showing error message
fix #898

The segmentation fault occured because the RPC response returned json with an error message as oppossed to the usual data required to update the chat. Since the section of the code didn't handle this error message it caused the app to crash. I've handled this error to show an error alert box by emitting a  event
2020-12-01 13:40:49 -05:00
Richard Ramos b9d59f44cc feat: show loading indicator on login when requesting mailserver messages 2020-12-01 13:32:39 -05:00
Richard Ramos a0c4839d48 fix: code review 2020-12-01 13:31:30 -05:00
Richard Ramos c405029e37 fix: wallet derivation paths for generated accounts , imported seed phrases and private keys 2020-12-01 13:31:30 -05:00
Jonathan Rainville 95fcee2d00 feat: support italic-bold in messages 2020-11-27 15:19:09 -05:00
Jonathan Rainville b536707646 fix: fix notification banner showing the pubkey of group chats 2020-11-27 15:15:26 -05:00
Richard Ramos b372d8047e
fix: remove echo 2020-11-26 18:33:42 -04:00
Richard Ramos 124ce83ba7 fix: show local nicknames 2020-11-26 13:23:42 -05:00
Richard Ramos a5b9511a55 fix: show ens usernames when creating a 1:1 chat 2020-11-26 13:23:42 -05:00
Richard Ramos 971dca5fb8 fix: request mailserver messages for group and 1:1 chats 2020-11-26 11:44:59 -05:00
Richard Ramos 159c82c329 feat: choose network 2020-11-26 11:44:49 -05:00
Richard Ramos 4e27983047 feat: use cache for network requests 2020-11-26 11:44:09 -05:00
emizzle 417194e7b4 feat: Keyboard shortcuts
Add keyboard shortcuts according to https://notes.status.im/02cfVf1KQLeQU2SqrIi9tw

fix: update chat message bubbles
- Align emojis to middle of text
- Add line-height as per design
- Properly support RTL languages (right-aligned) and LTR languages (left-aligned)
- Remove unneeded non-breaking space at the beginning of current user messages
- Properly support markdown for bold, strikethrough, and italic
- Fix text being removed when in between strikethrough markdown (~~)

fix: emoji resolution update for high resolution monitors
- Emojis now use the 72x72 original set, but are down-scaled to 20x20 (in chat bubbles) or 22x22 in other places, effectively tripling their pixel density

feat: handle new lines in blockquote

Handle new lines in blockquote so that messages display correctly.

Also, add functionality when a new line is entered in to the chat input, if it's inside a blockquote, a new ">" will be added automatically. This is also handled when backspace is entered.

feat: update xss to support full qt html4 table and table-cell attributes
2020-11-26 11:33:32 -05:00
emizzle e0e1487643 refactor: replace transaction modal `reset` functionality
The transaction component's `reset` functionality was meant ot reset a form when the modal was closed. It was difficult to manage and added extra overhead for each additional transaction modal created.

Instead of using reset functions, we can use Loaders to load and destroy the modal's as they are opened and closed. We do not need to keep them in memory and then also reset their functions. It creates a smaller memory footprint to destroy the object and reload on open.

feat: load gas prediction prices asynchronously
2020-11-26 11:17:24 -05:00
Richard Ramos d2ec9854ad fix: transaction dialog not showing up due to missing slot 2020-11-26 10:50:47 -04:00
Pascal Precht af1f03dc7c
feat: allow users to list muted chats and contacts
Partially fixes #1280
2020-11-24 11:17:18 +01:00
Pascal Precht db0b765d74 feat(Notifications): allow users to turn of notifications for non-contacts
Partially fixes #1280
2020-11-24 11:16:02 +01:00
Jonathan Rainville d49be78417 feat: show nickname if there is one in the mentions 2020-11-19 17:00:28 -05:00
Jonathan Rainville 299496a871 fix: remove errors on collectibles rpc errors 2020-11-19 16:58:07 -05:00
Jonathan Rainville 880d97dea0 fix: do not strip spaces from the parts of messages
this caused spaces to disappear when using markdown
2020-11-19 16:54:24 -05:00
Richard Ramos e4b4bf9900 fix: code review 2020-11-19 16:54:09 -05:00
Richard Ramos 997e34ed8a fix: app crashes when adding a contact and getContactById is nil 2020-11-19 16:54:09 -05:00
Jonathan Rainville c10e0a8503 fix: ensure html is escaped in the notification window 2020-11-19 16:53:33 -05:00
Jonathan Rainville 553ff2e915 fix: fix putting a single @ putting a random mention 2020-11-19 13:54:17 -05:00
Richard Ramos 950a7a4241 Set mailserverfleet on init 2020-11-11 15:16:37 -04:00
Richard Ramos f467461ae5 fix: obtain mailservers from fleet config 2020-11-11 12:13:34 -05:00
Pascal Precht fc6c68232b validation and ens resolution fixes 2020-11-11 12:01:38 -05:00
emizzle 76e7897e8d fix: 1-on-1 send tx recipient show in tx preview
We were previously displaying an address in the "to" field for TransactionPreview. Instead, this is meant to be a contact view.
- Fix ContactSelector to trigger selectedContactChanged
- Fix RecipientSelector > ContactSelector to trigger resolveEns from outside call to prevent infinite loop from the above fix
- Add alias to pre-selected contact for the Contact view of TransactionPreview
- Add option to change debounce delay so that when values are pre-selected (readonly), there is no delay before resolution.
- Fix missing tx data param in walletModel.estimateGas
2020-11-11 12:01:38 -05:00
Richard Ramos 97c6abbb05 fix: code review 2020-11-06 16:22:07 -05:00
Richard Ramos ea02c7f0b5 feat: choose fleet 2020-11-06 16:22:07 -05:00
Richard Ramos 3e4e2dae0d fix: code review 2020-11-06 16:21:57 -05:00
Richard Ramos bba08d87b8 feat: populate token details from contract address 2020-11-06 16:21:57 -05:00
emizzle bc1525f513 feat: 1-on-1 chat command ENS flow
1-on-1 chat command to send and request a transaction to/from a contact with ENS enabled.
2020-11-05 11:25:45 -05:00
Iuri Matias 326c6bb6c3 re-add uniswap, compound, balancer, akropolis, orchid tokens 2020-11-05 11:25:33 -05:00
Jonathan Rainville b583a4d4bf feat: show unfurled youtube links 2020-11-05 11:25:22 -05:00
Jonathan Rainville a679758230 feat: show whitelistable sites in the settings and set in qt settings 2020-11-05 11:25:22 -05:00
Richard Ramos 9d771b53dc feat: show tokens details
Fixes #910
2020-11-05 10:55:39 -05:00
Richard Ramos 1122b33ff8 feat: support Swarm and IPNS ENS contenthashes 2020-11-05 10:55:13 -05:00
RichΛrd 86bc8a894b Update src/status/libstatus/accounts.nim
Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2020-11-05 10:52:56 -05:00
Richard Ramos aec77b65df feat: use fleets.json to set the node config 2020-11-05 10:52:56 -05:00
emizzle e455586990
refactor: remove wei2Token in favour of wei2Eth. Essentially de-duplicated very similar procs and lessened errors
fix: SignTransactionModal - set default focused account when none is found

refactor: move token lookup from QML to nim in the toMessage procedure.

fix: 1:1 tx requests - handle case where token contract is not found (ie sending SNT from mainnet and receiving message on testnet)

feat: error checking for building a token transaction

feat: TransactionPreview - add a validation check that disallows continuation if the selected "from" account has insufficient funds
2020-10-28 11:07:22 +01:00
emizzle 423882df89
fix: 1:1 chat command transactions "intrinsic gas too low"
I noticed that the 1:1 chat commands were not able to send token transactions due to "intrinsic gas too low" error. I quickly realised there there were a few components missing, which have been fixed.

*feat: update the 1:1 chat commands transaction modal to allow editing of the from account and network fee*

The TransactionStackGroup was updated slightly to allow manual control of back/next actions.

Fixes #870.

*fix: Create distinct modal transaction actions*

Previously, adding `Connection`s for the  `walletModel.transactionWasSent` signal in different dialogs would cause the signal to be handled in the wrong dialog. The solution was to pass a `uuid` from the requesting dialog, and include the `uuid` in the response, so that only requests that were requested from the dialog would be handled.

*fix: update 1:1 translations*
All the translations were not being translated for me. I noticed that they did not exist in the `.ts` translation files either.
2020-10-28 11:07:21 +01:00
Richard Ramos 0a13940742 fix: signatures 2020-10-27 19:55:50 -04:00
Richard Ramos 5461d6f93c feat: remove seed phrase 2020-10-27 19:32:54 -04:00
Richard Ramos 6c641eff42 feat: identify if a token is being approved and estimate gas for contract trxs 2020-10-27 17:13:11 -04:00
Richard Ramos 5ff809b6b8 fix: code review 2020-10-27 17:13:11 -04:00
Richard Ramos 11ae6529e2 feat: dapps permissions 2020-10-27 17:13:11 -04:00
Richard Ramos 7af4f0fd8f feat: dapp browser privileges
- Create privilege dialogs dynamically for each privilege requested
- Check if a privilege has been granted before to determine if dialog must be shown or not
- If dapp is allowed to use privilege, save it in the settings
2020-10-27 17:13:11 -04:00
Richard Ramos 0d717d7919 refactor: improve and simplify mailserver logic to make it thread safe 2020-10-27 17:12:35 -04:00
Jonathan Rainville 84ff2b21a9 fix: fix a couple of QML warnings 2020-10-27 10:23:40 -04:00
Richard Ramos c68498fcfe fix: support downloads in browser 2020-10-20 14:42:36 -04:00
Richard Ramos b18a1d6b4d feat: support message signing 2020-10-20 14:42:36 -04:00
Richard Ramos 37e213e89b feat: dapps permissions 2020-10-20 14:42:36 -04:00
Jonathan Rainville 70177b803a feat: enable sending contract calls from the browser 2020-10-20 14:42:36 -04:00
Jonathan Rainville 0c1156b33c feat: reuse signtxModal and show success and failure 2020-10-20 14:42:36 -04:00
Jonathan Rainville 56d6ece3e9 feat: enable sending an ETH transaction from the browser 2020-10-20 14:42:36 -04:00
Richard Ramos bf5e988cb9 fix: adding a default color to account selector, and changing attribute to result from payload 2020-10-20 14:42:36 -04:00
Richard Ramos 117f4bb6c8 feat: browser account selector 2020-10-20 14:42:36 -04:00
Richard Ramos e512768dc0 fix: replace URL in address bar by ens 2020-10-20 14:42:36 -04:00
Richard Ramos e8183f3a9f feat: use base32 + status infura ipfs for ens contenthash 2020-10-20 14:42:36 -04:00
Richard Ramos ca2fef7c28 feat: resolve ens addresses pointing to IPFS 2020-10-20 14:42:36 -04:00
Richard Ramos f85216e7f7 feat: dapp browser privileges
- Create privilege dialogs dynamically for each privilege requested
- Check if a privilege has been granted before to determine if dialog must be shown or not
- If dapp is allowed to use privilege, save it in the settings
2020-10-20 14:42:36 -04:00
Richard Ramos b6066ef1dd feat: address bar, tabs support and nav buttons 2020-10-20 14:42:36 -04:00
Richard Ramos 3326c8b5f5 feat: ask for user approval for API requests 2020-10-20 14:42:36 -04:00
Richard Ramos 02a7abf864 fix: QWebChannel not available 2020-10-20 14:42:36 -04:00
Richard Ramos b650fa75d5 feat: ethereum.enable(), api: contact-code and readOnly RPC method support on browser 2020-10-20 14:42:36 -04:00
Richard Ramos c2567232b1 feat: injecting scripts needed for communicating from browser to nim
- Changed WebView to WebEngineView
- Created a new controller/view for the web3 provider
- Created a private profile
- Created a channel for comms browser - qml
2020-10-20 14:42:36 -04:00
Pascal Precht 3d0f50a5b3 feat: allow users to configure notification settings
Can choose between all, just mentions, or nothing
2020-10-20 13:50:49 -04:00
emizzle d76667f345 feat: Add warning if sending tokens directly to contract
Fixes #936.

![imgur](https://imgur.com/XuzmdRs.png)
2020-10-19 11:45:59 -04:00
emizzle e58f5b03eb refactor: make event emitter threadsafe 2020-10-16 10:45:24 -04:00
Pascal Precht 9ce0ae08a1 fix: ensure chats are ordered by last message timestamp
Fixes #1146
2020-10-16 10:44:50 -04:00
Pascal Precht 8bf82e1dd6 feat: allow for fetching messages older than 24 hours 2020-10-16 10:43:38 -04:00
Iuri Matias 5b8e3156aa re-update infura key 2020-10-12 11:30:26 -04:00
emizzle 08efd6fc08 refactor: combine list of tokens with contracts
All tokens are now implemented as a strongly-typed Contract, Erc20Contract, or Erc721Contract. This prevents having two separate lists of overlapping tokens/contracts and normalises how to retreive the current SNT contract (depending on the network).
2020-10-09 12:08:25 -04:00
Pascal Precht 1c2a7b0569 fix(Chat): ensure local nicknames are propagated properly
Fixes #1120
2020-10-09 12:06:01 -04:00
Iuri Matias ac3f1e9096 update infura token 2020-10-06 10:14:55 -04:00
Richard Ramos 2da4abf8eb fix: "Contact / Not a contact" indicator was not being updated when an user was added/removed as contact 2020-10-05 10:56:38 -04:00
hydr063n 7a5060da32 feat: load more transactions with a button
use qstrid; trx width and heights; add positionViewEnd; fix some qt rules;

missing semi colons
2020-10-05 10:50:35 -04:00
hydr063n 3229fc06e6 feat: beautify the hex values in transaction history
beautify nonce too

ammend the code to call conversion functions from qt instead

move to utils

var to let
2020-10-05 10:46:00 -04:00
emizzle 6d5bd52d0a fix: Estimating gas prevents transaction modal continue
Fixes: #926.

Gas estimations were not being decoded correctly (indicated with "error getting gas price predictions" in the console) and were preventing transaction dialogs from continuing past the step containing the GasSelector component. This affected mainnet only, because in testnet we have hardcoded gas prices (for when the gas prices on mainnet are insane) which is why it was not apparent in testnet.

fix: Contract address not showing correctly
This was caused by `getStickerMarketContractAddress` being moved to `utilsView` but not updated in QML
2020-10-02 12:33:28 -04:00
Jonathan Rainville 8bac59e98c feat: show the error when sendImage fails
Plus improve toastMessage to better handle wide messages
2020-10-02 12:28:41 -04:00
Jonathan Rainville f9a84c51bb fix: fix windows file upload because of path starting with a slash 2020-10-02 12:28:41 -04:00
emizzle 64b0a11757 feat: add sticker loading UI
Closes: #586

Previously, loading sticker packs and stickers would show a lot of blank and non-interactive content.

Now, stickers and sticker packs have grey circles to indicate loading. Additionally, the sticker market button (+) shows a loading indicator until the sticker packs are loaded.
2020-09-29 15:19:42 -04:00
Jonathan Rainville 8480c4f3da chore: fix typo in collectibles.nim
Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2020-09-29 14:44:10 -04:00
Jonathan Rainville f19bfb7ca7 chore: cleanup collectibles file
Co-authored-by: RichΛrd <info@richardramos.me>
2020-09-29 14:44:10 -04:00
Jonathan Rainville 42102bdae4 feat: limit number of collectibles to 200 to avoid explosions 2020-09-29 14:44:10 -04:00
Jonathan Rainville 51e1ba6f38 feat: enable loading all the cryptokitties assets with recursion 2020-09-29 14:44:10 -04:00
Jonathan Rainville 1dfd16f83d fix: missing type and missing id 2020-09-29 14:34:26 -04:00
Jonathan Rainville 6a57eeccb2 feat: implement new design for the nickname popup 2020-09-29 14:04:32 -04:00
Richard Ramos 2068e85e47 fix: spacing around links 2020-09-29 14:01:51 -04:00
Jonathan Rainville dad1dcf2c5 fix: fix eth2Wei returning a bad string 2020-09-29 14:01:44 -04:00
emizzle c236e01fc8 feat: Support system dark mode theme
Supports system dark mode. Changes the user appearance setting to a 3-way setting of System, Light, Dark.

New accounts will have their appearance setting set to "System", which uses the system setting to determine if dark mode should be applied.

Breaking change: Users who had their settings on Light Theme, will now get the system theme (light or dark). Users who had their theme set to Dark, will now get the Light theme.

At startup, the onboarding screens will have the system-level setting of dark mode applied or not. Once, logged in, the user settings will be applied.

## Note
An appearance setting of "System" is not dynamic to the system-level setting. This means that if a user has "System" set for their appearance (and ie, the user has light mode set), and then user then changes their system setting from light to dark, the app will not respond until it is restarted. This is due to a limitation of Qt not having a reliable way to propagate these changes to QML.
2020-09-29 13:30:13 -04:00
emizzle 7f0720608e fix: total wallet balance not displaying
Fixes: #929.

Calculates total wallet balance when it is requested.
2020-09-29 13:29:18 -04:00
emizzle 078e9758f0 refactor: use nim-web3 library
Use nim-web3 library and remove internal encoding funcs that were copied from nim-web3.

Remove all instances of EthAddress (and therefore eth/common/eth_types imports)
2020-09-29 13:28:08 -04:00
hydr063n 968923e8be chore: refactor ensRegisterAddress too and update the ui to use utilsModel 2020-09-28 10:38:23 -04:00
hydr063n 7e344b0d49 chore: refactor function to UtilsView 2020-09-28 10:38:23 -04:00
chainvisions a0606a169e Added UNI, COMP, BAL, AKRO, and OXT 2020-09-28 10:33:11 -04:00
Michael Bradley, Jr e3dc0469e2 chore: discard instead of echo'ing output of callPrivateRPC("requestMessages", ...) 2020-09-23 16:24:56 -04:00
Richard Ramos 16468960f7 fix: code review 2020-09-22 09:37:41 -04:00
Richard Ramos efac44057a fix: rebase gone wrong 2020-09-22 09:37:41 -04:00
Richard Ramos 346e98c81a feat: Add transaction modal when changing the pubkey 2020-09-22 09:37:41 -04:00
Richard Ramos ca0416dd30 fix: code review and style changes 2020-09-21 15:03:17 -04:00
Richard Ramos 2fb8f2ea55 fix: join/decline group 2020-09-21 15:03:17 -04:00
Jonathan Rainville fd93650b23 refactor: remove duplicated methods in chatModel and use profileModel 2020-09-21 12:52:05 -04:00
Jonathan Rainville 0c0baf29e8 fix: small fixes to the profile popup 2020-09-21 12:52:05 -04:00
Jonathan Rainville 6e357cb5e2 feat: show nickname in the modal from the contact list 2020-09-21 12:52:05 -04:00
Jonathan Rainville bc3b7a5533 feat: enable setting a nickname to a contact 2020-09-21 12:52:05 -04:00
Michael Bradley, Jr dcd5766205
fix: on macOS use status-icon.icns instead of status.svg when setting app.icon() 2020-09-17 15:11:31 -05:00
hydr063n 572e0c3e4c fix: call wakuext_contacts RPC once
include make proposed fix

remove more lines that are already included in `setActiveChannel`
2020-09-17 15:17:42 -04:00
Pascal Precht 02dcc106e4 uiux(Contacts): add loading indicator when searching for contacts to add 2020-09-17 15:16:24 -04:00
Pascal Precht 9c1613acf8 uiux(Wallet): improve readability of high value balances
Uses `toLocaleString()` polyfill to insert `.` and/or `,` as
needed based on currently selected locale.

Closes #845
2020-09-17 15:16:16 -04:00
emizzle 7b0d3c496c fix: exception handling in mutli-threaded transactions
Currently, exceptions thrown during transactions or gas estimation that were spawned in another thread are not being propagated, due to a limitation in nim (see https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn).

This means any exceptions from status-go were not propagated correctly and would cause the app to crash. This includes entering the wrong password when trying to send a transaction.

The issue was addressed by passing a `success` variable by reference, which is set to false if an exception was thrown by status-go.
2020-09-17 12:21:29 -04:00
Jonathan Rainville bcbcd13611 refactor: use profileSettingsFile QtProperty instead of profile directly 2020-09-16 16:58:55 -04:00
Jonathan Rainville db9472bc0b refactor: change settings to use a filename instead 2020-09-16 16:58:55 -04:00
Jonathan Rainville 23ca5f9930 feat: make settings user dependant and clean settings uses 2020-09-16 16:58:55 -04:00
Jonathan Rainville cebd889fd6 fix: fix assets not updating in views when getting new balance 2020-09-16 16:58:36 -04:00
Richard Ramos e4ffc897d7 fix: code review + reset sticker pack pending state 2020-09-16 14:22:29 -04:00
Richard Ramos d0bca7afa6 fix: show stickers as pending while trx is being mined
Fixes #885
2020-09-16 14:22:29 -04:00
Richard Ramos e46ab433f4 feat: transaction dialog for registering ENS name 2020-09-16 14:22:29 -04:00
Richard Ramos 83b0c8057e fix: code review 2020-09-16 14:22:29 -04:00
Richard Ramos 0091fded3a feat: toast messages for sticker and ens trxs 2020-09-16 14:22:29 -04:00
Jonathan Rainville 17aa8d274e fix: fix defaultTokenList use in QML 2020-09-14 14:54:17 -04:00
Jonathan Rainville 103f02b289 feat: show toast message for transaction status changes 2020-09-14 14:48:26 -04:00
Jonathan Rainville b0c9155e70 feat: track pending transactions for wallet transfers 2020-09-14 14:48:26 -04:00
Jonathan Rainville 22d9c3be5d refactor: use wallet model instead of lib status 2020-09-11 16:55:36 -04:00
Jonathan Rainville ad00709104 feat: show loading image on the button when sending 2020-09-11 16:55:36 -04:00
Pascal Precht 361c563a4b fix(Wallet): derive accounts from imported mnemonic and store correctly
This commit address two bugs:

1. When importing a mnemonic, the resulting "master" account and its address
  was used as account to be stored as opposed to its derived default account
2. The account was stored in the wrong path, resulting in status not being able
  to locate accounts when sending transactions.

Fixes #787
2020-09-11 14:41:24 -04:00
emizzle 19e801bba8 fix: remove spaces from sticker hashes
Looks like this may have ended up in the codebase unintentionally.
2020-09-11 14:41:01 -04:00
Iuri Matias 212f33b3c0 filter out watch only accounts in account list for sending transactions 2020-09-11 14:40:31 -04:00
Richard Ramos f2a56c70e1 fix: rebase gone wrong 2020-09-11 13:25:55 -04:00
Richard Ramos 2f1416e042 feat: check if a transaction is confirmed before installing a sticker pack 2020-09-11 12:46:13 -04:00
emizzle 80f0f9466b refactor: move stickers to own model
Remove from ChatModel and add StickerModel

# Conflicts:
#	src/app/chat/view.nim
#	src/status/chat.nim
#	src/status/libstatus/contracts.nim
2020-09-11 12:46:13 -04:00
emizzle 366fdc15a1 feat: show stickers purchased from non-main account
Fixes: #815

Previously, only stickers purchased from the main status account were shown. Now, stickers purchased from any of the accounts are shown.

Accounts include any accounts returned by `accounts_getAccounts` and are non-chat accounts.
2020-09-11 12:01:08 -04:00
emizzle 2a36bcc762 change dynamicbytes to be more dynamic
![more dynamicer](https://tenor.com/view/more-cowbell-cowbell-snl-reaction-mrw-gif-14076918.gif)
2020-09-11 12:01:08 -04:00
emizzle 2c7dd929ad feat: enable token transactions
Fixes #788.
Fixes #853.
Fixes #856.

refactor: gas estimation and transaction sends have been abstracted to  allow calling `estimateGas`, `send`, and `call` on the contract method (similar to the web3 API).

Moved sticker pack gas estimation and purchase tx over to the new API

*Sticker purchase:*
 - gas estimate is done using new API and debounced using a timer

*Wallet send transaction:*
 - tokens can now be sent
 - gas is estimated correctly for a token tx, and debounced using a timer

***NOTE***
1. If attempting to send tokens on testnet, you must use a custom token as the token addresses in the pre-built list are for mainnet and will not work on testnet.
2. The new API should support all existing gas estimates, send txs, and calls. The loading of sticker pack data, balance, count, purchased sticker packs, etc, can be moved over to the new API. Almost all of the `eth_sendTransaction`, `eth_gasEstimate`, and `eth_call` could be move over as well (that's the idea at least).
2020-09-11 12:01:08 -04:00
emizzle 4f0cdad8c7 refactor: move stickers to own model
Remove from ChatModel and add StickerModel
2020-09-11 12:01:08 -04:00
Pascal Precht 729a2781f0 feat(TransactionModal): introduce async validation for ENS names
This commit extends the AddressInput to perform ENS lookups when valid
ENS values are entered. The lookup happens asynchronously, so we show a loading
indicator as the request is happening.

Closes #790
2020-09-10 13:40:42 -04:00
Richard Ramos 24212a63e9 feat: testnet tokens 2020-09-09 16:35:51 -04:00
Richard Ramos 27abf30fc8 feat: list, toggle and remove custom tokens 2020-09-09 16:10:51 -04:00
Jonathan Rainville f3f27a5e59 fix: address more comments about the chat commands 2020-09-09 15:03:45 -04:00
Jonathan Rainville 348e0a9bdc fix: address review comments for the send forms 2020-09-09 15:03:45 -04:00
Jonathan Rainville 6b3cac31bc feat: enable sending chat requests 2020-09-09 15:03:45 -04:00
Jonathan Rainville 60492b4db1 feat: add chat command bubbles for received txs 2020-09-09 15:03:45 -04:00
Iuri Matias aeb8d2958d display first menu option; include channel id 2020-09-09 14:08:19 -04:00
Pascal Precht 4bea011417 uiux(Chat): show loading indicator when fetching more messages 2020-09-08 14:09:09 -04:00
Iuri Matias f573574d9a fix addresses of some tokens 2020-09-07 16:37:06 -04:00
Richard Ramos 98aaa69e9d fix: transaction history handling
- Determine if the recent transaction history is being fetched or available before obtaining the first 20 transactions
- On account change, reset the selected tab to show the asset list
- Collectibles were kinda pixelated/blurry (not anymore)

Fixes #806
2020-09-07 12:54:59 -04:00
Pascal Precht 1481f2648f feat: introduce "fetch more messages" button to request old messages
Closes #149
2020-09-07 10:20:17 -04:00
hydr063n 3ea3b618a0 change title from Nim Status Client to Status Desktop 2020-09-07 09:30:02 -04:00
Richard Ramos 057cdc08da feat: update balances when receiving a transaction 2020-09-04 17:21:40 -04:00
Richard Ramos d4e0ef6619 feat: receive wallet events and bump nim-status 2020-09-04 17:21:40 -04:00
Richard Ramos e52d287cf9 refactor: move signals to status and generate events 2020-09-04 16:42:26 -04:00
Richard Ramos 9ef82a2d7a fix: token decimals and returning no collectibles when there's no contract for a collectible on the current network
Fixes #773
2020-09-04 16:36:20 -04:00
emizzle d8b0145eb3 feat: Add Sticker purchase transaction modal
Add gas estimate for sticker pack purchase.

Update transaction for sticker pack purchase.

Add GasValidator component which validates gas is selected correctly and displays an error message if not. This component is not visible until it is not valid (at which point the valdiation error message is displayed).

In a future PR, need to:
1. estimate gas for token txfer (sendTransaction) via a normalised method for estimating gas for EthSend
2. move sticker pack purchase to use an EthSend object so gas can be estimated and tx sent
2020-09-04 16:13:33 -04:00
Richard Ramos 374da83cff feat: receive wallet events and bump nim-status 2020-09-04 15:57:29 -04:00
Richard Ramos 0b6643ac2d feat: show SNT by default in the token list, and STT in ropsten
fixes #805
2020-09-03 16:06:20 -04:00
Pascal Precht addd1d9c3e chore(chat): request mailserver messages since last request
Prior to this commit, the app would request messages from the last
24 hours for all joined channels.
The changes made here ensure that messages since the *last* request
are requested. The last request for each topic/chat is stored in the
nodes mailserver topics.

When no channels are joined, the default is still 24 hours, however,
as soon as a channel is joined, the last request time will be updated
and honored in the next request.
2020-09-03 15:58:49 -04:00
Richard Ramos 782e89508c fix: escape html in messages 2020-09-03 15:47:05 -04:00
emizzle 1e020a203c feat(tx-comps): Send transaction modal
Fixes #669.

Composes all tx components to create a send transaction modal for the wallet.

1. Add a reusable TransactionStackView component that wraps a StackView component to show the screens of the Send Tx modal and handles back/forward/reset functionality.
2. Add a reusable TransactionStackGroup which holds tx components and allows modal header and button text to be defined and handles validation for all child components.
3. Add an isValid property to all tx comps for pristine validation state.
4. Reset all components in modal once modal is closed. This consists of a `resetInternal` function that each component should implement to reinstate its original starting state, and a `reset` function that parent components can use to reinstate the overridden properties.
5. Tx error handling to display either a StatusGo error message in the dialog, or wrong password in the TransactionSigner.
6. Fix ReceiveModal to allow for pre-selected account based on current wallet account.
7. Add focused border colour to Input component.
8. Fix issue with last TransactionStackGroup input not being able to obtain focus.
9. Fix fiatBalance not appearing on initial load on AccountSelector.
10. Fix selected asset updated properly when assets changed in the AssetSelector component.
11. AccountSelector is pre-populated with selected wallet account. Supporting work on the components has been done to suppor this.
12. Changing accounts in the "from account" updates the asset balances in the AssetAndAmountInput component.
13. Move validation from ContactSelector to the Select component.

1. Test sending of tokens. This requires that tokens contracts are setup on testnet. Right now, they are set up for contract addresses on mainnet.
2. Loading state once transaction is sent. Button in modal needs to move to a loading state and the "toast" messages in the wallet need to appear informaing user of tx progress.
3. Need to clarify (and implement?) support of ENS names in the AddressInput. It appears that ENS names could be resolved. This would be a long operation and require some kind of UI loading indication.
4. Wallet balances need to be updated on every block, so for example, sending funds between accounts I should be able to see the balance updated in real time.

1. Sending to a contact currently doesn't work because the ContactSelector component selects the Contact's whipser key, instead of his/her wallet address. May need to figure out how this is done in status-react. As it stands, attempting to send to a contact will crash the app.
2. Sending *from* an imported account does not work, with an error from StatusGo `cannot locate account for address: 0x123...`
2020-09-03 15:32:55 -04:00
Pascal Precht fb83886086 fix(Chat): ensure only mentions with leading whitespace are replaced 2020-09-01 11:54:44 +02:00
Richard Ramos 84df214f6f fix: handle message reactions for old messages not loaded 2020-08-28 13:38:54 -04:00
Richard Ramos d134ef8e45 fix: disable on testnet 2020-08-28 11:31:35 -04:00
Richard Ramos 8bf2e394c6 fix: update contract address on ropsten and use label instead of namehash 2020-08-28 11:31:35 -04:00
Richard Ramos 7d4c4ac4c7 feat: change pubkeys for already owned ens usernames 2020-08-28 11:31:35 -04:00
Richard Ramos 7df357dcf7 feat: show terms and conditions, add ens registry contract, and determine if you have enough SNT balance. 2020-08-28 11:31:35 -04:00
Richard Ramos 8f1f01b6a0 feat: register status ens usernames 2020-08-28 11:31:35 -04:00
Richard Ramos ce8cd4183f feat: show terms and conditions, add ens registry contract, and determine if you have enough SNT balance. 2020-08-28 11:06:12 -04:00
Jonathan Rainville fef2e6651d feat: add stickers to collectibles 2020-08-28 11:05:19 -04:00
Pascal Precht bdfdf263cc fix(Chat): Allow for case insensitive pubkey replacement
When entering a user name like `@Pascal` it wouldn't be properly replaced
with the pubKey of `pascal.stateofus.eth` since it was comparing to `@pascal`

This commit ensures simple user name mentions are properly matched against
their ens names regardles of their case.

Fixes part of #769
2020-08-27 17:38:32 -04:00
Jonathan Rainville d19f15bb84 fix: fix chat links in a couple of ways
- link color in compact mode
- channel links did not have a #
- clicking on a mention should show that profile
- The AddChat button image didn't reposition when closing
2020-08-27 17:09:04 -04:00
Pascal Precht f47fda6d68 fix(Chat): ensure new active channel messages are marked as seen
Also, selecting a channel with unread messages marks them as seen as well

Closes #738
2020-08-27 17:00:08 -04:00
Jonathan Rainville 22a86b939f refactor: do not cache the mnemonic in settings 2020-08-27 16:42:25 -04:00