diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-07-04 04:24:28 +0200 |
---|---|---|
committer | CH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com> | 2020-07-30 22:10:27 +0530 |
commit | 08028d5c57d134fb3d0ca9004730f0b2c99e5e67 (patch) | |
tree | 1268c0d9fdfd47966fb386028098ce6634195479 /resources/qml/TimelineView.qml | |
parent | Some issue with UserProfile (diff) | |
download | nheko-08028d5c57d134fb3d0ca9004730f0b2c99e5e67.tar.xz |
Refactor UserProfile
Diffstat (limited to 'resources/qml/TimelineView.qml')
-rw-r--r-- | resources/qml/TimelineView.qml | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 3618140a..ec634878 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -106,17 +106,23 @@ Page { } Connections { target: TimelineManager - onNewDeviceVerificationRequest: { + function onNewDeviceVerificationRequest(flow) { flow.userId = userId; flow.sender = false; flow.deviceId = deviceId; flow.tranId = transactionId; deviceVerificationList.add(flow.tranId); - var dialog = deviceVerificationDialog.createObject(timelineRoot, - {flow: flow}); + var dialog = deviceVerificationDialog.createObject(timelineRoot, {flow: flow}); dialog.show(); } } + Connections { + target: TimelineManager.timeline + function onOpenProfile(profile) { + var userProfile = userProfileComponent.createObject(timelineRoot,{profile: profile}); + userProfile.show(); + } + } Label { visible: !TimelineManager.timeline && !TimelineManager.isInitialSync @@ -293,10 +299,7 @@ Page { MouseArea { anchors.fill: parent - onClicked: { - userProfile = userProfileComponent.createObject(timelineRoot,{user_data: modelData,avatarUrl:chat.model.avatarUrl(modelData.userId)}); - userProfile.show(); - } + onClicked: chat.model.openUserProfile(modelData.userId) cursorShape: Qt.PointingHandCursor propagateComposedEvents: true } @@ -311,10 +314,7 @@ Page { MouseArea { anchors.fill: parent Layout.alignment: Qt.AlignHCenter - onClicked: { - userProfile = userProfileComponent.createObject(timelineRoot,{user_data: modelData,avatarUrl:chat.model.avatarUrl(modelData.userId)}); - userProfile.show(); - } + onClicked: chat.model.openUserProfile(modelData.userId) cursorShape: Qt.PointingHandCursor propagateComposedEvents: true } |