Bug fix on sending welcomingEvent to self

This commit is contained in:
Kgothatso Ngako committed 2026-07-08 16:43:17 +02:00
1 parent 519c32918b
commit f0412a3d74
2 files changed
+3 -2

No files matched your search

@@ -129,6 +129,7 @@ abstract class MarmotOutboundDao(
relays: List<String> = Relays.DefaultDMRelayList.map { it.url },
isOneMemberInitialGroupCreation: Boolean
) {
logger.d("inviteMember: $peerPublicKey")
val keyPackage = MlsKeyPackage.decodeTls(
TlsReader(
peerKeyPackage.tlsEncodedMarmotKeyPackage
@@ -245,8 +245,8 @@ class DatabaseChatRepository(
nostrSignerSync: NostrSignerSync
) {
database.participantDao().findParticipantsByChatRoomId(giftWrapPayload.chatRoomId).forEachIndexed { index, participant ->
if (giftWrapPayload.kind == WelcomeEvent.KIND && giftWrapPayload.publicKey != participant.participantPublicKey) {
logger.w("We shouldn't be gift wrapping welcome event to anyone but the intended public key (${giftWrapPayload.id}).")
if (giftWrapPayload.kind == WelcomeEvent.KIND && nostrSignerSync.pubKey == participant.participantPublicKey) {
logger.w("We shouldn't be gift wrapping welcome event to ourselves (${nostrSignerSync.pubKey}).")
} else {
val wrapperKeyPair = KeyPair()
val wrapperSigner = NostrSignerSync(