mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix creating DMs from pasting an mxid
This commit is contained in:
parent
4c34f4bfee
commit
47da48f6f2
1 changed files with 3 additions and 2 deletions
|
@ -77,7 +77,8 @@ ApplicationWindow {
|
||||||
label: qsTr("User to invite")
|
label: qsTr("User to invite")
|
||||||
placeholderText: qsTr("@user:server.tld")
|
placeholderText: qsTr("@user:server.tld")
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
if(isValidMxid) {
|
// we can't use "isValidMxid" here, since the property might only be reevaluated after this change handler.
|
||||||
|
if(text.match("@.+?:.{3,}")) {
|
||||||
profile = TimelineManager.getGlobalUserProfile(text);
|
profile = TimelineManager.getGlobalUserProfile(text);
|
||||||
} else
|
} else
|
||||||
profile = null;
|
profile = null;
|
||||||
|
@ -106,7 +107,7 @@ ApplicationWindow {
|
||||||
Button {
|
Button {
|
||||||
text: "Start Direct Chat"
|
text: "Start Direct Chat"
|
||||||
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
|
||||||
enabled: userID.isValidMxid
|
enabled: userID.isValidMxid && profile
|
||||||
}
|
}
|
||||||
onRejected: createDirectRoot.close();
|
onRejected: createDirectRoot.close();
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
|
Loading…
Reference in a new issue