requestDirectChat
Use Quotient::connection::requestDirectChat directly as it can already handle all the conditions.
This commit is contained in:
@@ -255,9 +255,6 @@ Kirigami.ApplicationWindow {
|
||||
Connections {
|
||||
target: root.connection
|
||||
|
||||
function onDirectChatAvailable(directChat) {
|
||||
RoomManager.resolveResource(directChat.id);
|
||||
}
|
||||
function onNewKeyVerificationSession(session) {
|
||||
root.pageStack.pushDialogLayer(Qt.createComponent("org.kde.neochat", "KeyVerificationDialog"), {
|
||||
session: session
|
||||
|
||||
@@ -38,7 +38,7 @@ Kirigami.Dialog {
|
||||
text: i18n("OK")
|
||||
icon.name: "dialog-ok"
|
||||
onTriggered: {
|
||||
root.connection.openOrCreateDirectChat(userIdText.text);
|
||||
root.connection.requestDirectChat(userIdText.text);
|
||||
root.accept();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ Kirigami.Dialog {
|
||||
text: root.connection.directChatExists(root.user) ? i18nc("%1 is the name of the user.", "Chat with %1", root.room ? root.room.member(root.user.id).htmlSafeDisplayName : QmlUtils.escapeString(root.user.displayName)) : i18n("Invite to private chat")
|
||||
icon.name: "document-send"
|
||||
onTriggered: {
|
||||
root.connection.openOrCreateDirectChat(root.user.id);
|
||||
root.connection.requestDirectChat(root.user.id);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ SearchPage {
|
||||
text: displayName
|
||||
|
||||
onClicked: {
|
||||
root.connection.openOrCreateDirectChat(userDelegate.userId);
|
||||
root.connection.requestDirectChat(userDelegate.userId);
|
||||
root.closeDialog();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user