Commit Graph

56 Commits

Author SHA1 Message Date
Eric Dvorsak bb339dc39b
refactor login flow
simplified flow:

- event `:ui/login` is dispatched
- node is initialized with user config or default config
- `node.started` signal is received, applying `:login` fx
- `:callback/login` event is dispatched, account is changed
in datastore, web-data is cleared
- `:init/initialize-account` event is dispatched

replace event dispatches by function composition

fix bug in universal links where url to be processed after login
was never removed

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-08-28 14:46:33 +02:00
Eric Dvorsak dacfe97a58
refactor events and fns to dedicated namespaces
- move init events and fns to dedicated namespace
- move web3 events and fns to dedicated namespaces
- move signal events and fns to dedicated namespace
- move notifications events and fns to dedicated namespace
- cosmetic fixes
- remove print statements
- fix formating
- remove unused imports
2018-08-28 14:44:55 +02:00
Eric Dvorsak 002f3e73d1
refactor :initialize-account into single event
fix tests for :initialize-account refactoring
fix destructuring typo
2018-08-28 14:44:55 +02:00
Andrea Maria Piana 3754e1dbae
[Fixes #5130] Select mailserver round-robin on connection failure
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-07-17 08:49:24 +02:00
Andrea Maria Piana b34744133b
[fixes #4745] Don't query mailserver on restored account
When creating a new account / recovery we don't poll the mailserver anymore for historic messages, which solves the immediate issue of fetching only received messages

Handle messages sent from a different device in public chat / restore history. The message will be added, shown correctly as sent by the user, and the status will be set as sent ( need to check for seen race condition, as messages will now be added twice). This means that multidevice should now work for public chats.

Move contact updates to discovery topic. This is necessary as there is a pre-existing bug whereby contact updates would not work anymore after wallet recovery, as the code relies on the initial contact request being stored on the mailserver, which we cannot guarantee (we only pull 7 days of data). Not pulling history anymore exacerbate the problems but does not introduce it.
To make sure that contact updates will work after wallet recovery, we also need to consider a ContactUpdate in the same way we consider a ContactRequest (the other peer has no idea that the user has recovered the wallet). This does not change any behaviour in terms of obscurity/security as ContactRequest are automatically processed (in both case the contact will be set as pending?, not as accepted)
At this stage ContactRequest, ContactRequestConfirmed, ContactUpdate have all the same logic, i.e. update the contact information, leave the pending flag alone.

Only 1 day of history is fetched for newly joined chats, if catching up 7 days is the cap as before.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-07-03 17:21:59 +02:00
Andrea Maria Piana 42509e8fb6
Dont query mailserver when from is greater than to
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-07-02 12:21:43 +02:00
Andrea Maria Piana a313557694
Cap maximum number of days requested to mailserver
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-06-19 20:13:19 +02:00
Eric Dvorsak b40b042b67
[fix 4212] update profiles with concurrent contact-requests 2018-06-15 20:14:52 +03:00
Andrea Maria Piana 2d54c3e2cc
Select random ms until users explicitictly choose one
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-06-14 15:02:15 +02:00
Andrea Maria Piana c66c457bbb
Default to value if key is nil
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-06-13 13:39:04 +02:00
janherich 4ba78de407
Faster seen marking
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-06-11 12:16:42 +02:00
Andrea Maria Piana 608c64e88d
Dont run receive-whisper-messages if the user is logged out
This handles a bug whereby we'd run receive-whisper-messages
when the user is logged out.

I could not replicate locally, but a few issues are apparent from
just inspecting the code:

1) there are some race-conditions on logout as we don't wait for all
the filters to be removed. Changing this behaviour is non trivial and
not sure if we can actually handle this completely
(status-go-has-a-message->remove-filter->logout->status-go-deliver-message).
2) no error handling is made in receive-whisper-messages.

This PR defensively handles both cases.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-06-07 14:16:35 +02:00
Pedro Pombeiro d3202dffa7
Disable group chats even in dev mode. Closes #4506 2018-06-06 08:59:41 +03:00
Andrea Maria Piana 75d1c04412
Allow for different password on different mailservers
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-06-04 14:28:43 +02:00
Eric Dvorsak 8782ecc06d
[fix 4574] do not send updates to pending contacts
fixes #4574

updates were sent to all pending contacts
fixes that by filtering on the pending? key
2018-06-02 08:31:24 +03:00
Roman Volosovskyi 5d41cdda0c
[#4551] fix error on fetching history for removed chat 2018-06-01 16:25:50 +03:00
Eric Dvorsak 68eb36f7b1
[fix] support offline contact request, confirmation and update
- fix a bug in profile where app would was returning directly to profile
screen after photo capture, showing updating to user but not actually saving
and broadcasting it
- adds support for offline contact request, confirmation and updates by
leveraging the :sent and :not-sent signal from status-go. Each chat
in the protocol layer uses a `resend?` field to keep track of the current
state of the contact, between `nil`, `contact-request`,
`contact-request-confirmation` and `contact-update`. There is no case
were it can be more than one case because if `contact-request` or
`contact-request-confirmation` was not sent yet `contact-update` is not
necessary as the latest contact infos will be sent with the request/confirmation

Signed-off-by: Eric Dvorsak <eric@status.im>
2018-05-31 17:43:37 +02:00
Eric Dvorsak ee7895fe43
[fix 4387] query mailserver in batches of 24 hours 2018-05-31 16:58:53 +03:00
janherich 874e88fc38
Fix seen statuses
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-05-29 14:48:27 +02:00
Eric Dvorsak 203f399aca
use from parameter for mailserver requests
Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-29 10:19:08 +02:00
Eric Dvorsak 3430bfe61e
Update last-received everytime a message is received from inbox 2018-05-29 09:58:32 +02:00
Andrea Maria Piana 9cfb591068
Remove chat / clear history
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-05-28 16:28:16 +02:00
Eric Dvorsak 21f9aa1b10
[fix 4466] improve peer-summary-change-fx
do not request messages from inbox everytime a peer is added or removed

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-28 15:31:16 +02:00
janherich e1da12d8a2
Fast message grouping/sorting
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-05-24 13:38:40 +02:00
janherich 84208aeb85
Correct :shh/post accumulation
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-05-23 19:55:27 +02:00
Eric Dvorsak 50072ffe3f
[fix 4177] handle discovery signals
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-05-23 17:01:57 +02:00
Andrea Maria Piana 735a5b403d
Add custom mailservers feature-toggled
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-05-23 15:35:25 +02:00
Roman Volosovskyi dcefb0795d
Activate whisper envelope deduplication (performance).
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-05-22 16:55:20 +02:00
Eric Dvorsak 1d94a4d1cb
[fix] mailbox get-current-wnode-address
wrong symbol was introduced in recent PR

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-18 16:37:40 +02:00
Roman Volosovskyi 9b5058d632
handle multiple incoming messages at once 2018-05-18 14:12:46 +03:00
Connor Christie 24d5fabe2e
Add support for custom network upstreams
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2018-05-18 11:25:21 +03:00
Eric Dvorsak 225d2e2ec0
[fix] request the right topic from inbox when adding new key
Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-15 10:24:25 +02:00
Eric Dvorsak baa471a929
remove message cache
message cache was initialized when logging-in so it was basically useless
it was causing a bug when switching account and getting a contact request
from the same user in 2 accounts without killing the app because the cache
was not reset and the subsequent contact requests were ignored

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-05-14 14:45:49 +02:00
Dmitry Novotochinov cd41cefa96
Handle mailserver connection error
* Do not try to reconnect when offline
* If online, but mailserver is disconnected, show notification
* Tap on notification starts reconnecting process

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-14 11:25:45 +02:00
Eric Dvorsak a0a79595ce
Rename multi-send-with-pubkey into multi-send-by-pub-key
previous naming was confusing because it actually sends using
the symkey of each chat whose simkey is passed as an argument

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-12 11:52:47 +02:00
Andrey Shovkoplyas 94becb5094
updated status-go to latest
Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-11 15:42:16 +02:00
janherich 62a9f26e30
First stage of realm transactions 2018-05-10 17:21:23 +02:00
Andrea Maria Piana 291932db08
publish using pk in 1-to-1
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-05-09 20:26:41 +02:00
Eric Dvorsak b7ab49d305
[fix] recover lost contact requests and following messages
- Fetch discovery topic from offline inboxing
- Send ContactRequestResponse on discovery channel with new-key message
for recovery of invited contacts

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-05-09 18:57:47 +02:00
Dmitry Novotochinov 428f1d47ee
Request offline message when app returns from background
* Add "connecting" mailserver status
* Send push notification when "envelope.sent" signal received

Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
2018-05-09 15:29:27 +03:00
Roman Volosovskyi 8c1cd9d3d4
reformat remaining namespaces 2018-05-08 11:36:32 +03:00
Eric Dvorsak f8e535f9bc
[fix 3843] query mailserver when going back online
Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
2018-05-03 22:40:59 +02:00
Andrey Shovkoplyas de03fc2d6a
fixed error on invalid utf-8 from dapp
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2018-05-03 15:32:30 +03:00
Roman Volosovskyi e830183011
track sent/received events;
force sent/received ratio tracking;
send mixpanel events when state is changed to online;
2018-05-01 19:25:25 +02:00
Roman Volosovskyi 8cd77653f4
fix cyclic deps related to status-im.transport.message.v1.* namespaces;
move account-update to sparate ns;
fix a few more cyclic deps;
2018-05-01 19:25:24 +02:00
psdp ef0024c5dc
Replace accounts/accounts by account/account in app-db [#3907]
Signed-off-by: Goran Jovic <goranjovic@gmail.com>
2018-05-01 16:40:36 +02:00
Dmitry Novotochinov a8a03067a1
Add resend and delete message actions
* Set message status based on signal from Go
* Set status as "not-sent" on app start if no signal received

Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
2018-04-27 11:03:42 +03:00
Roman Volosovskyi 6b073fe350
move merge-fx to separate ns 2018-04-25 11:33:48 +02:00
Andrea Maria Piana baf211e1f3
Send signed transaction to deleted chats 2018-04-25 08:55:39 +02:00
Andrey Shovkoplyas 55d3095b7a
[#3888] [#2704] added personal_sign and CallPrivateRPC methods support
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
2018-04-19 17:43:50 +03:00