Commit Graph

7 Commits

Author SHA1 Message Date
63c5f7e723 fix clippy issues
Signed-off-by: William Casarin <jb55@jb55.com>
2025-02-11 10:48:54 -08:00
bfcc6e27e9 rustfmt
Signed-off-by: William Casarin <jb55@jb55.com>
2024-12-09 09:35:34 -08:00
88939ba2d1 Better mute handling
This commit improves the robustness of mute list handling:
1. It listens to new mute lists from the relay interface, and saves them whenever there is a new one
2. It uses the user's own relay lists to fetch events (such as mute lists), helping to ensure we get their mute lists even when they are not stored in the Damus relay
3. It saves events it sees when fetching them from the network, if applicable

Changelog-Changed: Improved robustness of mute handling
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2024-12-09 13:49:08 +09:00
71258e3736 Add Nostr event cache
This commit adds a simple in-memory Nostr Event cache, to reduce the
amount of bandwidth used as well as to improve performance.

Testing
-------

Setup:
  - Two iPhone simulators running Damus and on different accounts
  - Damus version: 774da239b92ed630fbf91fce42d9e233661c0d7f
  - Notepush: This commit
  - Push notifications turned on, setup to connect to localhost, and configured to receive DM notifications
  - Run Notepush with `RUST_LOG=DEBUG` env variable for debug logging
Steps:
1. Send a DM from one account to another.
  - Push notification should arrive with a few seconds delay
  - Push notification logs should mention that the event was cached
2. Send a DM again.
  - Push notification should arrive immediately
3. Wait for more than a minute
4. Send a DM again.
  - Push notification should take a few seconds again
  - Push notification logs should mention that the cache item expired and was deleted

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/notepush/issues/3
2024-08-05 18:01:52 -07:00
3ca3a83257 Add support to "only notifications from following" setting
Testing
-------

PASS

Devices: Mix of iPhone simulators and real devices
notepush: This commit
Damus: 4ea6c360e6e33747cb09ecf085049948ec1dadd1 (WIP change from GH issue #2360)
Setup:
  - Account A with push notifications enabled, DM notifications enabled,
    and "only notifications from following enabled"
  - Account A follows B but not C
Steps:
1. Send DM to A from B. Push notification appears
2. Send DM to A from C. Push notification does not appear

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Closes: https://github.com/damus-io/damus/issues/2360
2024-08-04 11:57:43 -07:00
36cc9f8742 run cargo fmt --all
we should try to stick to rustfmt style, many editors save it like this
by default.

Signed-off-by: William Casarin <jb55@jb55.com>
2024-07-31 17:44:48 -07:00
e11c636ce3 Initial draft commit 2024-07-11 09:53:43 -07:00