SHA256
Поправил пуши для личных сообщений
This commit is contained in:
@@ -10,11 +10,10 @@ function normLogin(value) {
|
||||
const FAMILY_ROLES = ['parent', 'child', 'spouse', 'sibling'];
|
||||
|
||||
function relationTypeFromRelation(relation) {
|
||||
const explicit = String(relation?.mark?.relationType || '').trim().toLowerCase();
|
||||
if (explicit === 'close_friend' || explicit === 'friend' || explicit === 'contact') return explicit;
|
||||
const role = relation?.role;
|
||||
if (FAMILY_ROLES.includes(role)) return 'family';
|
||||
if (role === 'friend') return 'friend';
|
||||
// Тип отношения выбирает владелец рассматриваемого графа.
|
||||
const ownType = String(relation?.relationType || '').trim().toLowerCase();
|
||||
if (ownType === 'close_friend' || ownType === 'friend') return ownType;
|
||||
if (relation?.role === 'friend') return 'friend';
|
||||
return 'contact';
|
||||
}
|
||||
|
||||
@@ -24,7 +23,7 @@ function relationTypeFromRelation(relation) {
|
||||
// - взаимные дружеские связи ближе односторонних.
|
||||
function deriveStrength(relation) {
|
||||
if (relation.isRelative) return 0.9;
|
||||
if (relation?.mark?.relationType === 'close_friend') return 0.9;
|
||||
if (relation?.relationType === 'close_friend') return 0.9;
|
||||
if (relation.role === 'contact') return 0.4;
|
||||
if (relation.forward && relation.backward) return 0.8;
|
||||
return 0.55;
|
||||
@@ -69,6 +68,7 @@ export function engineModelFromGraphModel(graphModel) {
|
||||
shining: Boolean(r?.mark?.shine),
|
||||
official: Boolean(r?.mark?.official),
|
||||
tier: 1,
|
||||
mutual: Boolean(r?.forward && r?.backward),
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user