SHA256
HEADER v3, primary аккаунты и подтверждения
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// Только явно заявленный Primary может участвовать в официальных подтверждениях.
|
||||
export function accountRoleFromHeader(accountType) {
|
||||
return accountType === 1 ? 'primary' : accountType === 0 ? 'non_voting' : '';
|
||||
}
|
||||
|
||||
export function confirmationRights(actor, target) {
|
||||
const a = String(actor?.login || '').trim().toLowerCase();
|
||||
const b = String(target?.login || '').trim().toLowerCase();
|
||||
const primary = Boolean(a && b && a !== b && actor?.accountRole === 'primary' && target?.accountRole === 'primary');
|
||||
return { primary, shine: primary && actor?.shineStatus === 'shining' && target?.shineStatus !== 'not_interested' };
|
||||
}
|
||||
Reference in New Issue
Block a user