Wire radio invitation revocation into group admission changes
This commit is contained in:
1 parent
b245988ffa
commit
8b9adff206
2 files changed
+6
-2
No files matched your search
@@ -190,6 +190,7 @@ static void rc_aggregate(struct radio_call_context* ctx, struct radio_call_sessi
|
||||
void radio_call_revalidate_members(struct UTUN_INSTANCE* inst, uint64_t group) {
|
||||
struct radio_call_context* ctx = inst ? inst->radio_call : NULL;
|
||||
if (!ctx || ctx->stopping) return;
|
||||
int any_changed = 0;
|
||||
for (unsigned i = 0; i < RC_SLOTS; i++) {
|
||||
struct radio_call_session* s = &ctx->sessions[i];
|
||||
if (!s->id || (group && s->group != group)) continue;
|
||||
@@ -197,7 +198,7 @@ void radio_call_revalidate_members(struct UTUN_INSTANCE* inst, uint64_t group) {
|
||||
if ((s->state != RADIO_CALL_FINISHED || s->awaiting_ack) && !topo_group_chat_allowed(inst, s->group, s->peer)) {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "radio call revoke incoming group=%llx peer=%llx id=%llx",
|
||||
(unsigned long long)s->group, (unsigned long long)s->peer, (unsigned long long)s->id);
|
||||
s->awaiting_ack = 0; rc_finish(ctx, s, RADIO_CALL_UNAVAILABLE, 0);
|
||||
any_changed = 1; s->awaiting_ack = 0; rc_finish(ctx, s, RADIO_CALL_UNAVAILABLE, 0);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -210,10 +211,11 @@ void radio_call_revalidate_members(struct UTUN_INSTANCE* inst, uint64_t group) {
|
||||
t->state = RADIO_CALL_FINISHED; t->reason = RADIO_CALL_UNAVAILABLE; t->ended = get_time_tb(); t->awaiting_ack = 0;
|
||||
selected_lost |= t->peer == s->selected; changed = 1;
|
||||
}
|
||||
any_changed |= changed;
|
||||
if (selected_lost) rc_finish(ctx, s, RADIO_CALL_UNAVAILABLE, 0);
|
||||
else if (changed) rc_aggregate(ctx, s, RADIO_CALL_UNAVAILABLE);
|
||||
}
|
||||
rc_schedule(ctx);
|
||||
if (any_changed) rc_schedule(ctx);
|
||||
}
|
||||
|
||||
static void rc_transmit(struct radio_call_context* ctx, struct radio_call_session* s) {
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "broadcast.h"
|
||||
#include "multicast.h"
|
||||
#include "../radio/radio.h"
|
||||
#include "../radio/radio_call.h"
|
||||
#include "../stream/stream.h"
|
||||
#include "../chat/chat_setting.h"
|
||||
#include "../chat/group_avatar.h"
|
||||
@@ -442,6 +443,7 @@ void topo_group_revalidate_members(struct TOPO_GROUP* group) {
|
||||
etcp_router_revalidate_group(group->instance, group->group_id);
|
||||
conn_mgr_revalidate_members(group->conn_mgr);
|
||||
radio_revalidate_members(group);
|
||||
radio_call_revalidate_members(group->instance, group->group_id);
|
||||
member_files_revalidate_members(group->instance, group->group_id);
|
||||
group_avatar_revalidate_members(group->instance, group->group_id);
|
||||
/* Удаление вызывает callbacks и меняет список; каждый раз ищем следующего заново. */
|
||||
|
||||
Reference in new issue
Block a user