fix: registration + add captcha support (#227)

* fix: registration + update mobile version

* feat: add captcha support for registration

* fix: jid protocol address missing device

* fix: linting errors
This commit is contained in:
Samuel Scheit
2023-08-10 11:15:12 +02:00
committed by GitHub
parent 30b96c528b
commit 49ab16f592
5 changed files with 43 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ import { GroupCipher, GroupSessionBuilder, SenderKeyDistributionMessage, SenderK
import { SignalAuthState } from '../Types'
import { SignalRepository } from '../Types/Signal'
import { generateSignalPubKey } from '../Utils'
import { jidDecode } from '../WABinary'
export function makeLibSignalRepository(auth: SignalAuthState): SignalRepository {
const storage = signalStorage(auth)
@@ -76,10 +77,9 @@ export function makeLibSignalRepository(auth: SignalAuthState): SignalRepository
}
}
const jidToSignalAddress = (jid: string) => jid.split('@')[0]
const jidToSignalProtocolAddress = (jid: string) => {
return new libsignal.ProtocolAddress(jidToSignalAddress(jid), 0)
const { user, device } = jidDecode(jid)!
return new libsignal.ProtocolAddress(user, device || 0)
}
const jidToSignalSenderKeyName = (group: string, user: string): string => {