Browse Source

Notify profile changes with actual member properties

master
evgeny 2 weeks ago
parent
commit
1988afa84d
  1. 5
      src/chat/member_sync.c
  2. 1
      tools/chatgui/src/avatars/avatarmanager.h
  3. 1
      tools/chatgui/src/mainwindow.cpp

5
src/chat/member_sync.c

@ -706,10 +706,10 @@ static int member_apply_record(struct UTUN_INSTANCE* inst, const char* ch_id,
static void member_committed(struct UTUN_INSTANCE* inst, const char* ns, uint64_t node_id) {
merkle_sync_changed(inst, ns);
_fire_props_changed(inst, node_id, NULL, ns);
struct TOPO_GROUP* g = inst->topo_groups ? topo_groups_find(inst->topo_groups, strtoull(ns, NULL, 10)) : NULL;
struct ETCP_CONN* conn = instance_find_conn(inst, node_id);
if (g && g->group_type == TOPO_GROUP_TYPE_CHAT) {
_ms_on_bgp_node(g, node_id, 0, inst);
/* Существующий UP сохраняем; новый транспорт выбирает только автопланировщик. */
if (conn && conn->links_up && !conn->close_requested && topo_group_new_conn(g, conn) < 0)
DEBUG_WARN(DEBUG_CATEGORY_MEMBER_SYNC, "%s: cannot attach UP member channel=%s node=%016llx", MS_ID, ns,
@ -980,7 +980,8 @@ static int _member_apply_items(void* ctx, const char* ns, uint64_t from_peer, co
if (member_decode(data + off, len - off, &w, &used) < 0) { rc = MT_ERR_DATA; break; }
if (changed[i]) {
member_committed(inst, ns, w.rec.node_id);
_fire_props_changed(inst, w.rec.node_id, w.tags[0] ? w.tags : NULL, ns);
if (!inst->topo_groups || !topo_groups_find(inst->topo_groups, strtoull(ns, NULL, 10)))
_fire_props_changed(inst, w.rec.node_id, w.tags[0] ? w.tags : NULL, ns);
_fire_apply_cbk(inst, ns, w.rec.node_id, w.rec.x25519, w.rec.signed_by, w.rec.signature);
}
off += used;

1
tools/chatgui/src/avatars/avatarmanager.h

@ -4,6 +4,7 @@
#include <QObject>
#include <QCache>
#include <QHash>
#include <QMap>
#include <QQueue>
#include <QSet>
#include <QThreadPool>

1
tools/chatgui/src/mainwindow.cpp

@ -101,6 +101,7 @@ static void onChannelUpdatedCallback(const char* ch_id, int ch_id_len) {
Q_UNUSED(ch_id);
if (s_mainWindow)
s_mainWindow->reloadChannels();
if (AvatarManager::instance()) AvatarManager::instance()->refreshMembers();
}
static void onMemberListCallback(const uint8_t* data, int len) {

Loading…
Cancel
Save