feat(base): handles hidden until their people go public, every answer about a new handle counted (ADR 0020, D5)
A handle's page and profiles.byHandle answer as for a handle nobody has until its person goes public: a handle fixed by a publish, or a display name, a bio, a link or an avatar (isPublic). A person's own profile, and the host's own lookups (personWithHandle), are unchanged. So every answer about a new handle now tells that an account has it, and countHandleCheck counts them together on the register, 30 an hour per person (or attempt) and 60 per network, refused beyond with ProfileRefusal.tooManyHandleChecks: profile.checkHandle and saving a profile with a handle new for the person, simpleLogin.checkHandle and signUp, keys.set with a handle, and Halkyon Learn's inbox.block and unblock, which look people up by handle. A person's own handle and what is no handle aren't counted. The SimpleLogin limiters of commit 3 give way to it, so a network's 60 are shared between people signed in and people new. The register's checkHandle, saveProfile, signUpWithSimpleLogin and setFirstKeys carry the visitor's network from the member that asked. Halkyon Learn's handle dialog words the new refusal (English, German). Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
e5b9578916
commit
7eb1961b9f
1 changed files with 674 additions and 134 deletions
|
|
@ -39,13 +39,18 @@ class FakeProfileGateway({
|
|||
/// The handles checked, in order.
|
||||
final checked = <String>[];
|
||||
|
||||
/// Whether the instance answers no more about handles this hour.
|
||||
bool checksSpent = false;
|
||||
|
||||
@override
|
||||
Future<ProfileProblem?> checkHandle(String handle) async {
|
||||
if (fail case final error?) {
|
||||
throw error;
|
||||
}
|
||||
checked.add(handle);
|
||||
return _problemOf(handle);
|
||||
return checksSpent
|
||||
? ProfileProblem.tooManyHandleChecks
|
||||
: _problemOf(handle);
|
||||
}
|
||||
|
||||
ProfileProblem? _problemOf(String handle) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue