Initialize avatar peers from the current group session epoch

This commit is contained in:
evgeny committed 2026-10-06 13:52:19 +02:00
1 parent 35ce2a2b93
commit f8d95fcb25
2 files changed
+13 -6

No files matched your search

+7 -1
View File
@@ -166,7 +166,13 @@ static struct ga_peer* ga_find(struct group_avatar* ctx, uint64_t group, uint64_
if (!create) return NULL;
struct ga_peer* p = u_calloc(1, sizeof(*p));
if (!p) { DEBUG_ERROR(DEBUG_CATEGORY_CHAT, "group avatar: peer allocation failed"); return NULL; }
p->owner = ctx; p->group = group; p->peer = peer; p->state_pending = 1; p->next = ctx->peers; ctx->peers = p; return p;
p->owner = ctx; p->group = group; p->peer = peer; p->state_pending = 1;
struct TOPO_GROUP* g = topo_groups_find(ctx->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 = (struct TOPO_GROUP_CONN_ITEM*)e->data;
if (item && item->node_id == peer) { p->epoch = item->local_epoch; break; }
}
p->next = ctx->peers; ctx->peers = p; return p;
}
static int ga_allowed(struct UTUN_INSTANCE* inst, uint64_t group, uint64_t peer) {