diff --git a/src/model/group.cpp b/src/model/group.cpp index f0224163e..83f62b612 100644 --- a/src/model/group.cpp +++ b/src/model/group.cpp @@ -62,7 +62,6 @@ void Group::updatePeer(int peerId, QString name) peers[peerId] = f->getDisplayedName(); toxids[peerPk] = f->getDisplayedName(); } else { - chatForm->onUserListChanged(); emit userListChanged(groupId, toxids); } } @@ -110,7 +109,6 @@ void Group::regeneratePeerList() } } - chatForm->onUserListChanged(); emit userListChanged(groupId, toxids); } diff --git a/src/widget/form/groupchatform.cpp b/src/widget/form/groupchatform.cpp index 7e23a1c98..8b7b189df 100644 --- a/src/widget/form/groupchatform.cpp +++ b/src/widget/form/groupchatform.cpp @@ -110,6 +110,7 @@ GroupChatForm::GroupChatForm(Group* chatGroup) chatGroup->setName(newName); } }); + connect(group, &Group::userListChanged, this, &GroupChatForm::onUserListChanged); setAcceptDrops(true); Translator::registerHandler(std::bind(&GroupChatForm::retranslateUi, this), this); diff --git a/src/widget/form/groupchatform.h b/src/widget/form/groupchatform.h index e7e705f22..9e39dbe04 100644 --- a/src/widget/form/groupchatform.h +++ b/src/widget/form/groupchatform.h @@ -38,7 +38,6 @@ public: explicit GroupChatForm(Group* chatGroup); ~GroupChatForm(); - void onUserListChanged(); void peerAudioPlaying(int peer); private slots: @@ -46,6 +45,7 @@ private slots: void onMicMuteToggle(); void onVolMuteToggle(); void onCallClicked(); + void onUserListChanged(); protected: virtual GenericNetCamView* createNetcam() final override;