Commit Graph

1453 Commits

Author SHA1 Message Date
Jonathan Rainville 825097f007 feat: add channel switcher when hitting CTRL+K 2020-12-30 15:01:51 -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
emizzle b82540fcb7 chore: bump nimqml and dotherside 2020-12-22 16:08:09 -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 ad8f713f1d fix(StatusChatInput): fix sending messages by adding missing parameter to sendMessage 2020-12-22 15:13:24 -05:00
Jonathan Rainville cbbe2b46fc fix: fix generate keys identicons being all the same 2020-12-21 14:19:34 -05:00
Pascal Precht 90dfa94805 refactor: move getProfileImage API to appMain
Prior to this commit, the function was expected on a `chatView` QML object.
This has worked out so far because the places where the API is used were always
living inside `ChatLayout`.

With the new timeline however, this is no longer the case so we have to make sure
that the API is available to other views as well.
2020-12-21 14:15:08 -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
Pascal Precht 400b020118 fix(StatusChatInput): ensure send button is disabled when message limit is exceeded
This was missing in the previous work we've done to make the `StatusChatInput` work
as a status timeline update component.

This commit also adds an event handler which was missing to trigger the `onMessage`
event when the send button is clicked.
2020-12-21 14:14:48 -05:00
Pascal Precht 8a1a265036 fix(StatusUpdate): ensure hover effect is working properly
This commit introduces some `MouseArea`s so components inside the
`StatusUpdate` component cancel it out by having a higher `z`.

Also, in some cases we need to conditionally set the `root.hovered` property
to ensure the values get inverted correctly, otherwise it causes undesired
flicker effects.
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
Jonathan Rainville 4f2a1b5e73 fix: fix scroll going back down when hitting images 2020-12-18 15:39:16 -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 eebd831c5d chore: update to the merged version of status-go 2020-12-17 16:44:25 -05:00
Jonathan Rainville d01c9fef79 feat: add profile pic support 2020-12-17 16:44:25 -05:00
Richard Ramos 43d9d5184d feat: close image popup on click 2020-12-16 09:17:04 -05:00
Michael Bradley, Jr b524c3b423 fix: restore z-index to root Item of ChatText.qml 2020-12-16 09:16:50 -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
Pascal Precht 344880b3a3
fix: remove explicit properties in usernamelabel 2020-12-14 14:18:46 +01:00
Pascal Precht 743858837a uiux(StatusUpdate): add separator and fine-tune margins 2020-12-14 12:36:49 +01:00
Pascal Precht f512d5063c feat: introduce StatusUpdateChatInput variation
This commit changes the `StatusChatInput` component to also be a `StatusUpdateInput`.
The latter isn't an actual new type or component, it's just a visual variation of the already
existing status chat input. That's my most of the changes are `isStatusUpdateInput` conditions
sprinkled here and there.

In addition, this commit introduces a new `chatType` which is passed to `StatusChatInput` later
in the timeline view, so it knows it has to render like a status update input.
2020-12-14 12:36:49 +01:00
Pascal Precht 8cd95d5bfd feat: introduce StatusUpdate component
This is a new MessageComponent type that will be used in the timeline status updates
view.
2020-12-14 12:36:49 +01:00
Pascal Precht bb6bcc640a chore(MessageContextMenu): ensure chat tab is activated when attempting to send message
This is needed when accessing the context menu from the timeline status updates.
Previously, it'd only change the active channel because it assumed the user is already
in the chat view. This is no longer the case when in timeline view, so we need to make sure
we first navigate to the chat view.
2020-12-14 12:36:49 +01:00
Richard Ramos c2f2b7e6cd fix: default value for trx data 2020-12-11 14:04:25 -05:00
Richard Ramos 4d2e396b7f fix: display transaction data 2020-12-11 14:04:25 -05:00
Richard Ramos e37cba7edd fix: etherscan link 2020-12-11 14:04:16 -05:00
Richard Ramos 02867d8627 fix: newlines on chat input 2020-12-11 14:04:06 -05:00
Richard Ramos a901351e7e fix: chat reply width when content is smaller than author 2020-12-11 13:56:04 -05:00
Richard Ramos 5ad54b057b fix: missing username 2020-12-11 13:47:51 -05:00
Iuri Matias 334d538700 update intro and keys screen to use dark theme setttings correctly 2020-12-11 12:22:23 -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
Pascal Precht 04bf8e7a03 fix(StatusButton): make icon color same as button label color 2020-12-10 14:40:35 -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 c9f7928956 fix(Usernamelabel): ensure message time is positioned correctly 2020-12-10 12:30:31 +01: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
Pascal Precht 066fd9f7e5 feat: allow message context menu to render emojis only
Closes #1492
2020-12-10 12:30:31 +01:00
Pascal Precht 2baf56f505 refactor(Chat): move suggestions ListModel into StatusChatInput
StatusChatInput was relying on the suggestions ListModel, even though there was
no guarantee that it would exist. This is more apparent when using the component
in different context (e.g. Timeline/Status Updates). QML will throw a reference
error in this case.
2020-12-10 12:30:31 +01:00
Pascal Precht 9745205302 refactor(Chat): move send message logic out of status chat input
`StatusChatInput` ideally shouldn't rely on chatsModel and other global
objects at all. Also, when using the component in different places, it can cause
accidental sending of message when testing the component (because all the logic is already
wired up)
2020-12-10 12:30:31 +01:00
Iuri Matias 0293f3eac1 update mailserver fleet port to 443; 30504 was causing issues for some people 2020-12-09 16:55:59 -05:00
Richard Ramos 16ae26aa62 fix: remove invalid condition from sendTransaction 2020-12-09 16:38:23 -04:00