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

Method defaultPhoneCode

app/src/utils/settings.ts:312–318  ·  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

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