MCPcopy Create free account
hub / github.com/Roy3838/Observer / defaultPhoneCode

Method defaultPhoneCode

app/src/utils/settings.ts:311–317  ·  view source on GitHub ↗

* The user's code for a phone tool (whatsapp when unspecified), generating one if needed. A call * reuses whichever code they already have, WhatsApp first, before minting a new WhatsApp one.

(channel?: WhitelistChannel)

Source from the content-addressed store, hash-verified

309 * reuses whichever code they already have, WhatsApp first, before minting a new WhatsApp one.
310 */
311 public defaultPhoneCode(channel?: WhitelistChannel): string {
312 if (channel === 'sms') return this.ensurePhoneCode('sms');
313 if (channel === 'voice') {
314 return this.getPhoneCode('whatsapp') ?? this.getPhoneCode('sms') ?? this.ensurePhoneCode('whatsapp');
315 }
316 return this.ensurePhoneCode('whatsapp');
317 }
318
319 /** The persisted Telegram code, generating and storing one on first use. */
320 public ensureTelegramCode(): string { return this.ensureCode(this.TELEGRAM_CODE_KEY); }

Callers 4

WhitelistModalFunction · 0.80
CheckWhitelistGateFunction · 0.80
PhoneSetupFunction · 0.80
registry.tsFile · 0.80

Calls 2

ensurePhoneCodeMethod · 0.95
getPhoneCodeMethod · 0.95

Tested by

no test coverage detected