Read group avatar metadata separately from image bytes

This commit is contained in:
evgeny committed 2026-10-06 13:43:49 +02:00
1 parent 56897368b3
commit a816b842e5
3 files changed
+19 -4

No files matched your search

+3 -3
View File
@@ -173,7 +173,7 @@ static int ga_allowed(struct UTUN_INSTANCE* inst, uint64_t group, uint64_t peer)
if (!member_files_member(inst, group, inst->node_id, 0) || !member_files_member(inst, group, peer, 0)) return 0;
struct TOPO_GROUP* g = topo_groups_find(inst->topo_groups, group);
for (struct ll_entry* e = g && g->senders_list ? g->senders_list->head : NULL; e; e = e->next) {
struct TOPO_GROUP_CONN_ITEM* item = e->data;
struct TOPO_GROUP_CONN_ITEM* item = (struct TOPO_GROUP_CONN_ITEM*)e->data;
if (item && item->node_id == peer && item->conn && item->ready_notified && !item->transport_down) return 1;
}
return 0;
@@ -340,9 +340,9 @@ static void ga_tick(void* arg) {
for (struct ga_peer* p = ctx->peers; p; p = p->next) p->seen = 0;
for (struct ll_entry* ge = ctx->inst->topo_groups->group_list->head; ge; ge = ge->next) {
struct TOPO_GROUP* group = (struct TOPO_GROUP*)ge;
if (group->group_type != TOPO_GROUP_TYPE_CHAT) continue;
if (group->group_type != TOPO_GROUP_TYPE_CHAT || !group->senders_list) continue;
for (struct ll_entry* e = group->senders_list->head; e; e = e->next) {
struct TOPO_GROUP_CONN_ITEM* item = e->data;
struct TOPO_GROUP_CONN_ITEM* item = (struct TOPO_GROUP_CONN_ITEM*)e->data;
if (!item || !item->conn || !item->ready_notified || item->transport_down || !ga_allowed(ctx->inst, group->group_id, item->node_id)) continue;
struct ga_peer* p = ga_find(ctx, group->group_id, item->node_id, 1); if (!p) continue;
p->seen = 1;