Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add canMessage(address) to Client #30

Merged
merged 1 commit into from
Jan 4, 2023
Merged

Conversation

dmccartney
Copy link
Contributor

This makes it easier to check if an address can receive a message.

@dmccartney dmccartney requested review from elisealix22 and a team January 3, 2023 22:53
@dmccartney dmccartney force-pushed the daniel-can-message branch 2 times, most recently from b0fc83d to 31fa3d3 Compare January 3, 2023 22:55
@dmccartney dmccartney marked this pull request as ready for review January 3, 2023 22:56
Comment on lines -30 to +32
if (_contacts.containsKey(walletAddress)) {
return _contacts[walletAddress].toList();
var cached = _contacts[walletAddress].toList();
if (cached.isNotEmpty) {
return cached;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously we were caching empty lookup results -- so once a lookup returned no contacts for an address, it would stop checking. This changes things so we only cache contact lookups that find results.

Copy link
Contributor

@nplasterer nplasterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for adding this so quickly.

@dmccartney dmccartney merged commit 39e7308 into main Jan 4, 2023
@dmccartney dmccartney deleted the daniel-can-message branch January 4, 2023 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants