Bug fix on sending welcomingEvent to self

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

View File

@@ -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

View File

@@ -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(