Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-qt
Commits
dc28cd5d
Commit
dc28cd5d
authored
Jun 20, 2022
by
Sébastien Blin
Browse files
conversationmodel: do not recreate non swarm conversation if removed
Change-Id: Ibc769db225bf9baa47b01b86c1eec4468b23786a GitLab:
#757
parent
357c814c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libclient/conversationmodel.cpp
View file @
dc28cd5d
...
...
@@ -821,7 +821,7 @@ ConversationModel::removeConversation(const QString& uid, bool banned)
ConfigurationManager
::
instance
().
removeConversation
(
owner
.
id
,
uid
);
// Still some other conversation, do nothing else
if
(
!
banned
&&
getConversationForPeerUri
(
peers
.
front
())
!=
std
::
nullopt
)
if
(
!
banned
)
return
;
}
...
...
@@ -2577,23 +2577,20 @@ ConversationModelPimpl::slotConversationRemoved(const QString& accountId,
auto
&
conversation
=
getConversationForUid
(
conversationId
).
get
();
auto
&
peers
=
peersForConversation
(
conversation
);
// if swarm conversation removed but we still have contact we create non swarm conversation.
// we should create non swarm conversation only for removed one-to-one conversation.
if
(
conversation
.
mode
==
conversation
::
Mode
::
ONE_TO_ONE
)
{
if
(
peers
.
isEmpty
())
{
removeConversation
();
return
;
}
auto
contact
Id
=
peers
.
first
();
auto
contact
Uri
=
peers
.
first
();
removeConversation
();
auto
conv
=
storage
::
getConversationsWithPeer
(
db
,
contactId
);
if
(
conv
.
empty
())
{
conv
.
push_back
(
storage
::
beginConversationWithPeer
(
db
,
contactId
));
}
addConversationWith
(
conv
[
0
],
contactId
,
false
);
Q_EMIT
linked
.
newConversation
(
conv
[
0
]);
// If it's a 1:1 conversation and we don't have any more conversation
// we can remove the contact
auto
conv
=
storage
::
getConversationsWithPeer
(
db
,
contactUri
);
if
(
conv
.
empty
())
linked
.
owner
.
contactModel
->
removeContact
(
contactUri
,
true
);
}
else
{
removeConversation
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment