Skip to content

Commit

Permalink
chore: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Jan 2, 2025
1 parent 075b101 commit 4601a5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nip47/nip47_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/getAlby/hub/config"
"github.com/getAlby/hub/events"
"github.com/getAlby/hub/lnclient"
"github.com/getAlby/hub/nip47/cipher"
"github.com/getAlby/hub/nip47/notifications"
"github.com/getAlby/hub/nip47/permissions"
nostrmodels "github.com/getAlby/hub/nostr/models"
Expand All @@ -32,7 +33,7 @@ type Nip47Service interface {
GetNip47Info(ctx context.Context, relay *nostr.Relay, appWalletPubKey string) (*nostr.Event, error)
PublishNip47Info(ctx context.Context, relay nostrmodels.Relay, appWalletPubKey string, appWalletPrivKey string, lnClient lnclient.LNClient) (*nostr.Event, error)
PublishNip47InfoDeletion(ctx context.Context, relay nostrmodels.Relay, appWalletPubKey string, appWalletPrivKey string, infoEventId string) error
CreateResponse(initialEvent *nostr.Event, content interface{}, tags nostr.Tags, ss []byte, ck [32]byte, walletPrivKey string) (result *nostr.Event, err error)
CreateResponse(initialEvent *nostr.Event, content interface{}, tags nostr.Tags, cipher *cipher.Nip47Cipher, walletPrivKey string) (result *nostr.Event, err error)
}

func NewNip47Service(db *gorm.DB, cfg config.Config, keys keys.Keys, eventPublisher events.EventPublisher) *nip47Service {
Expand Down
3 changes: 1 addition & 2 deletions nip47/notifications/nip47_notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,13 @@ func (notifier *Nip47Notifier) notifySubscriber(ctx context.Context, app *db.App
event := &nostr.Event{
PubKey: appWalletPubKey,
CreatedAt: nostr.Now(),
Kind: models.NOTIFICATION_KIND,
Tags: allTags,
Content: msg,
}

if version == "0.0" {
event.Kind = models.LEGACY_NOTIFICATION_KIND
} else {
event.Kind = models.NOTIFICATION_KIND
}

err = event.Sign(appWalletPrivKey)
Expand Down

0 comments on commit 4601a5e

Please sign in to comment.