Improve logging
This commit is contained in:
@@ -79,7 +79,6 @@ abstract class NostrNip17Dao(
|
||||
giftWrapEvent: GiftWrapEvent,
|
||||
receiverPublicKey: PTag
|
||||
) {
|
||||
|
||||
val nostrEvent = NostrEvent(
|
||||
id = giftWrapEvent.id,
|
||||
content = giftWrapEvent.content,
|
||||
@@ -89,6 +88,7 @@ abstract class NostrNip17Dao(
|
||||
tags = giftWrapEvent.tags,
|
||||
kind = giftWrapEvent.kind
|
||||
)
|
||||
logger.d("NostrEvent: $nostrEvent")
|
||||
|
||||
|
||||
database.nostrEventDao().insert(nostrEvent)
|
||||
@@ -120,17 +120,18 @@ abstract class NostrNip17Dao(
|
||||
)
|
||||
)
|
||||
|
||||
val giftWrapSeal = GiftWrapSeal(
|
||||
id = sealedRumorEvent.id,
|
||||
publicKey = sealedRumorEvent.pubKey,
|
||||
content = sealedRumorEvent.content,
|
||||
kind = sealedRumorEvent.kind,
|
||||
tags = sealedRumorEvent.tags,
|
||||
signature = sealedRumorEvent.sig,
|
||||
giftWrapMessageId = giftWrapEvent.id
|
||||
database.giftWrapSealDao().upsert(
|
||||
GiftWrapSeal(
|
||||
id = sealedRumorEvent.id,
|
||||
publicKey = sealedRumorEvent.pubKey,
|
||||
content = sealedRumorEvent.content,
|
||||
kind = sealedRumorEvent.kind,
|
||||
tags = sealedRumorEvent.tags,
|
||||
signature = sealedRumorEvent.sig,
|
||||
giftWrapMessageId = giftWrapEvent.id
|
||||
)
|
||||
)
|
||||
|
||||
database.giftWrapSealDao().upsert(giftWrapSeal)
|
||||
logger.d("persistAndBroadcastGiftWrap done")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -107,8 +107,10 @@ class DatabaseChatRepository(
|
||||
tags = giftWrapPayload.tags,
|
||||
content = giftWrapPayload.content
|
||||
)
|
||||
logger.d("GiftWrap Payload Event: ${giftWrapPayloadEvent.toJson()}")
|
||||
|
||||
giftWrapPayload.tags.taggedUsers().forEachIndexed { index, receiverPublicKey ->
|
||||
logger.d("Seal to $receiverPublicKey")
|
||||
val payload = giftWrapPayloadEvent.toJson()
|
||||
|
||||
val sealedRumorEvent = nostrSignerSync.signNormal<SealedRumorEvent>(
|
||||
@@ -120,6 +122,7 @@ class DatabaseChatRepository(
|
||||
toPublicKey = receiverPublicKey.pubKey
|
||||
)
|
||||
)
|
||||
logger.d("SealedRumorEvent: ${sealedRumorEvent.toJson()}")
|
||||
|
||||
val giftWrapEvent = nostrSignerSync.signNormal<GiftWrapEvent>(
|
||||
createdAt = TimeUtils.randomWithTwoDays(),
|
||||
@@ -132,6 +135,7 @@ class DatabaseChatRepository(
|
||||
toPublicKey = receiverPublicKey.pubKey
|
||||
)
|
||||
)
|
||||
logger.d("giftWrapEvent: ${giftWrapEvent.toJson()}")
|
||||
|
||||
database.nostrNip17Dao().persistAndBroadcastGiftWrap(
|
||||
sealedRumorEvent = sealedRumorEvent,
|
||||
@@ -146,6 +150,7 @@ class DatabaseChatRepository(
|
||||
giftWrapSealId = sealedRumorEvent.id
|
||||
)
|
||||
)
|
||||
logger.d("GiftWrap now sealed: ${giftWrapPayload.id}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user