Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,23 @@ class CommunityTokenIonConnectService {

if (isOwnToken) {
await _ionConnectNotifier.sendEvent(tokenDefinitionFirstBuyEvent);
return;
} else {
await _ionConnectNotifier
.sendEvent(
tokenDefinitionFirstBuyEvent,
actionSource: ActionSource.user(communityTokenDefinition.masterPubkey),
metadataBuilders: [_userEventsMetadataBuilder],
// Since we're sending this event only to the token owner, if owner shares
// relays with the current user, we need to retry the sending to the current
// user's relays in case of is-relay-authoritative error.
ignoreAuthoritativeErrors: false,
)
.catchError(
(_) => _ionConnectNotifier.sendEvent(tokenDefinitionFirstBuyEvent),
test: RelayAuthService.isRelayAuthoritativeError,
);
}

await _ionConnectNotifier
.sendEvent(
tokenDefinitionFirstBuyEvent,
actionSource: ActionSource.user(communityTokenDefinition.masterPubkey),
metadataBuilders: [_userEventsMetadataBuilder],
// Since we're sending this event only to the token owner, if owner shares
// relays with the current user, we need to retry the sending to the current
// user's relays in case of is-relay-authoritative error.
ignoreAuthoritativeErrors: false,
)
.catchError(
(_) => _ionConnectNotifier.sendEvent(tokenDefinitionFirstBuyEvent),
test: RelayAuthService.isRelayAuthoritativeError,
);

await _cacheTokenDefinitionFirstBuyReference(
tokenDefinitionFirstBuyEvent: tokenDefinitionFirstBuyEvent,
);
Expand Down