[network/kaidan] src/qml/elements: ContactAdditionContent: Fix opening chat with existing contact

Melvin Keskin <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit bd81418dba94d9dd79ba2d06116394bccfa4992e by Melvin Keskin.
Committed on 25/07/2026 at 15:11.
Pushed by melvo into branch 'master'.

ContactAdditionContent: Fix opening chat with existing contact

M  +8    -1    src/qml/elements/ContactAdditionContent.qml

https://invent.kde.org/network/kaidan/-/commit/bd81418dba94d9dd79ba2d06116394bccfa4992e

diff --git a/src/qml/elements/ContactAdditionContent.qml b/src/qml/elements/ContactAdditionContent.qml
index 71446481b..898cd5eac 100644
--- a/src/qml/elements/ContactAdditionContent.qml
+++ b/src/qml/elements/ContactAdditionContent.qml
@@ -54,7 +54,14 @@ ConfirmationArea {
 				case RosterController.ContactAdditionWithUriResult.ContactExists:
 					break
 				case RosterController.ContactAdditionWithUriResult.InvalidUri:
-					account.rosterController.addContact(jid, name)
+					const accountJid = account.settings.jid
+
+					if (RosterModel.hasItem(accountJid, jid)) {
+						MainController.openChatPageRequested(accountJid, jid)
+					} else {
+						account.rosterController.addContact(jid, name)
+					}
+
 					break
 				}
 			} else {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.