Доделать профиль, связи и серверные миграции

This commit is contained in:
AidarKC
2026-09-01 18:14:55 +04:00
parent 632d56737b
commit c03d94105c
42 changed files with 1555 additions and 414 deletions
+28
View File
@@ -416,3 +416,31 @@
- `limit_too_large`
- `channel_name_already_exists`
- `internal_error`
---
## Profile public-channel lists (v18)
### `ListUserProfileChannels`
Returns lightweight public-channel cards for profile counters. `mode` is `owned` or `following`; only `channel_type_code=1` is returned.
```json
{
"op": "ListUserProfileChannels",
"requestId": "profile-ch-1",
"payload": { "login": "Alice", "mode": "owned", "limit": 100, "offset": 0 }
}
```
Channel items contain `ownerLogin`, `slug`, `displayName`, `avatarAr`, `ownerBlockchainName`, `rootBlockNumber`, and `rootBlockHashHex`.
## Qualified likes (v18)
Channel/message responses expose three counters:
- `likesCount` — all active likes;
- `primaryLikesCount` — likes from users whose current `account_role=primary`;
- `shiningLikesCount` — likes from users who are currently both `primary` and `shining`.
Changing `account_role` or `shine` does not alter the raw reaction. The two qualified counters are recalculated from `reactions_state`; therefore old likes automatically enter or leave qualified counters when the actor's current status changes.
+42 -5
View File
@@ -132,8 +132,6 @@
"login": "Alice",
"outFriends": ["Bob"],
"inFriends": ["Kate"],
"outCloseFriends": [],
"inCloseFriends": [],
"outContacts": [],
"inContacts": [],
"outFollows": [],
@@ -148,8 +146,6 @@
"inSiblings": [],
"outKnownPersons": [],
"inKnownPersons": [],
"outOfficialAccounts": [],
"inOfficialAccounts": [],
"outShineConfirmed": [],
"inShineConfirmed": [],
"outShineSeen": [],
@@ -175,7 +171,6 @@
### Примечание
Поля `known_person`, `shine_confirmed`, `shine_seen` в UI считаются недопроверенной зоной проекта; при изменениях этой логики нужна ручная end-to-end проверка.
`outCloseFriends` / `inCloseFriends` возвращают близких друзей, а `outOfficialAccounts` / `inOfficialAccounts` - подтверждённые официальные аккаунты.
---
@@ -210,3 +205,45 @@
}
}
```
---
## 5. Profile relation lists (v18)
### `ListUserProfileRelations`
Lightweight paged lists used by clickable counters in a user profile. Supported `listType` values:
- `friends`
- `close_friends`
- `primary_received`
- `primary_given`
- `shine_received`
- `shine_given`
Request:
```json
{
"op": "ListUserProfileRelations",
"requestId": "profile-rel-1",
"payload": { "login": "Alice", "listType": "friends", "limit": 100, "offset": 0 }
}
```
Each item contains a ready-to-render user card: `login`, `firstName`, `lastName`, `avatarAr`, `accountRole`, `shineStatus`, effective `relationType`, `primaryConfirmed`, `shineConfirmed`, plus received primary/shine confirmation counters.
Effective relation priority is `close_friend > friend > contact > none`. Effective `70/80` confirmations are filtered by current voting/status rules; raw blockchain connections are not deleted when temporarily ineffective.
### Voting rules
- new `80` requires the actor to have `account_role=primary`;
- `80` cannot be added to a target with `account_role=non_voting`;
- new `70` requires actor `account_role=primary` and `shine=shining` (legacy `shine=yes` is normalized to `shining`);
- `70` cannot be added to a target with `shine=not_interested`;
- a `non_voting` target may still receive `70` if its shine status allows it;
- old raw `70/80` remain in `connections_state`, but are excluded from effective lists/counts while either side is ineligible. They become effective again automatically if statuses permit later.
### `ListContacts` additions (v18)
Every dialog item now also carries `firstName`, `lastName`, `avatarAr`, `accountRole`, and `shineStatus`. `relationFlag` priority is now `close_friend > friend > contact > none`.