Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
838cf635
Commit
838cf635
authored
2 years ago
by
Malte E
Browse files
Options
Downloads
Patches
Plain Diff
direct chat creator can now create direct chats
parent
5384ab37
No related branches found
No related tags found
No related merge requests found
Pipeline
#2888
failed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/dialogs/CreateDirect.qml
+25
-13
25 additions, 13 deletions
resources/qml/dialogs/CreateDirect.qml
src/timeline/TimelineViewManager.cpp
+8
-0
8 additions, 0 deletions
src/timeline/TimelineViewManager.cpp
src/timeline/TimelineViewManager.h
+1
-0
1 addition, 0 deletions
src/timeline/TimelineViewManager.h
with
34 additions
and
13 deletions
resources/qml/dialogs/CreateDirect.qml
+
25
−
13
View file @
838cf635
...
...
@@ -8,29 +8,38 @@ import QtQuick 2.15
import
QtQuick
.
Window
2.13
import
QtQuick
.
Layouts
1.3
import
QtQuick
.
Controls
2.3
import
QtQml
.
Models
2.15
import
im
.
nheko
1.0
ApplicationWindow
{
id
:
createDirectRoot
title
:
qsTr
(
"
Create Direct Chat
"
)
property
var
profile
:
null
property
var
profile
property
bool
otherUserHasE2ee
:
profile
?
dMod
.
count
>
0
:
true
minimumHeight
:
layout
.
implicitHeight
+
2
*
layout
.
anchors
.
margins
+
footer
.
height
minimumWidth
:
footer
.
width
DelegateModel
{
id
:
dMod
model
:
profile
?
profile
.
deviceList
:
undefined
}
ColumnLayout
{
id
:
layout
anchors.fill
:
parent
anchors.margins
:
Nheko
.
paddingSmall
MatrixTextField
{
id
:
userID
property
bool
isValidMxid
:
text
.
match
(
"
@.+?:.{3,}
"
)
Layout.fillWidth
:
true
focus
:
true
placeholderText
:
qsTr
(
"
Name
"
)
/*
onTextChanged: {
if(isValidMxid
(text))
profile =
get
Profile(text);
else
onTextChanged
:
{
if
(
isValidMxid
)
{
profile
=
TimelineManager
.
getGlobalUser
Profile
(
text
);
}
else
profile
=
null
;
}
*/
}
}
GridLayout
{
...
...
@@ -39,21 +48,20 @@ ApplicationWindow {
columns
:
2
rowSpacing
:
Nheko
.
paddingSmall
columnSpacing
:
Nheko
.
paddingMedium
anchors.centerIn
:
parent
Avatar
{
Layout.rowSpan
:
2
Layout.preferredWidth
:
Nheko
.
avatarSize
Layout.preferredHeight
:
Nheko
.
avatarSize
Layout.alignment
:
Qt
.
AlignLeft
userid
:
profile
.
mxid
url
:
profile
.
avatarUrl
.
replace
(
"
mxc://
"
,
"
image://MxcImage/
"
)
displayName
:
profile
.
displayName
userid
:
profile
?
profile
.
mxid
:
""
url
:
profile
?
profile
.
avatarUrl
.
replace
(
"
mxc://
"
,
"
image://MxcImage/
"
)
:
null
displayName
:
profile
?
profile
.
displayName
:
""
enabled
:
false
}
Label
{
Layout.fillWidth
:
true
text
:
"
John Smith
"
//
profile.displayName
text
:
profile
?
profile
.
displayName
:
""
color
:
TimelineManager
.
userColor
(
userID
.
text
,
Nheko
.
colors
.
window
)
font.pointSize
:
fontMetrics
.
font
.
pointSize
}
...
...
@@ -76,7 +84,7 @@ ApplicationWindow {
ToggleButton
{
Layout.alignment
:
Qt
.
AlignRight
id
:
encryption
checked
:
tru
e
checked
:
otherUserHasE2e
e
}
}
}
...
...
@@ -85,8 +93,12 @@ ApplicationWindow {
Button
{
text
:
"
Start Direct Chat
"
DialogButtonBox.buttonRole
:
DialogButtonBox
.
AcceptRole
enabled
:
userID
.
isValidMxid
}
onRejected
:
createDirectRoot
.
close
();
//onAccepted: createRoom(newRoomName.text, newRoomTopic.text, newRoomAlias.text, newRoomVisibility.index, newRoomPreset.index)
onAccepted
:
{
profile
.
startChat
()
createDirectRoot
.
close
()
}
}
}
This diff is collapsed.
Click to expand it.
src/timeline/TimelineViewManager.cpp
+
8
−
0
View file @
838cf635
...
...
@@ -199,6 +199,14 @@ TimelineViewManager::openGlobalUserProfile(QString userId)
emit
openProfile
(
profile
);
}
UserProfile
*
TimelineViewManager
::
getGlobalUserProfile
(
QString
userId
)
{
UserProfile
*
profile
=
new
UserProfile
{
QString
{},
userId
,
this
};
QQmlEngine
::
setObjectOwnership
(
profile
,
QQmlEngine
::
JavaScriptOwnership
);
return
(
profile
);
}
void
TimelineViewManager
::
setVideoCallItem
()
{
...
...
This diff is collapsed.
Click to expand it.
src/timeline/TimelineViewManager.h
+
1
−
0
View file @
838cf635
...
...
@@ -67,6 +67,7 @@ public:
Q_INVOKABLE
void
openRoomSettings
(
QString
room_id
);
Q_INVOKABLE
void
openInviteUsers
(
QString
roomId
);
Q_INVOKABLE
void
openGlobalUserProfile
(
QString
userId
);
Q_INVOKABLE
UserProfile
*
getGlobalUserProfile
(
QString
userId
);
Q_INVOKABLE
void
focusMessageInput
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment