mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-30 18:39:23 +00:00
fix chat room creation inserted twice in list
This commit is contained in:
parent
ec3125e8a5
commit
21312c99db
2 changed files with 10 additions and 2 deletions
|
|
@ -175,7 +175,11 @@ void ChatList::setSelf(QSharedPointer<ChatList> me) {
|
|||
[this, addChatToList](const std::shared_ptr<linphone::Core> &core,
|
||||
const std::shared_ptr<linphone::ChatRoom> &chatRoom, linphone::ChatRoom::State state) {
|
||||
if (state == linphone::ChatRoom::State::Created) {
|
||||
if (chatRoom->getAccount() != core->getDefaultAccount()) {
|
||||
auto chatAccount = chatRoom->getAccount();
|
||||
auto defaultAccount = core->getDefaultAccount();
|
||||
if (!chatAccount || !defaultAccount) return;
|
||||
if (!chatAccount->getParams()->getIdentityAddress()->weakEqual(
|
||||
defaultAccount->getParams()->getIdentityAddress())) {
|
||||
qWarning() << log().arg("Chatroom does not refer to current account, return");
|
||||
return;
|
||||
}
|
||||
|
|
@ -203,6 +207,10 @@ int ChatList::findChatIndex(ChatGui *chatGui) {
|
|||
|
||||
bool ChatList::addChatInList(QSharedPointer<ChatCore> chatCore) {
|
||||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||
if (chatCore->getIdentifier().isEmpty()) {
|
||||
qWarning() << "ChatRoom with invalid identifier cannot be added to the list, return";
|
||||
return false;
|
||||
}
|
||||
auto chatList = getSharedList<ChatCore>();
|
||||
auto it = std::find_if(chatList.begin(), chatList.end(), [chatCore](const QSharedPointer<ChatCore> item) {
|
||||
return item && chatCore && item->getIdentifier() == chatCore->getIdentifier();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
|||
RowLayout {
|
||||
id: mainItem
|
||||
height: Utils.getSizeWithScreenRatio(40)
|
||||
visible: eventLogCore.handled
|
||||
visible: eventLogGui.core.handled
|
||||
property EventLogGui eventLogGui
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue