Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
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
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
savoirfairelinux
jami-client-qt
Commits
1355111e
Commit
1355111e
authored
3 years ago
by
Sébastien Blin
Committed by
Andreas Traczyk
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
swarm: add sync window
Change-Id: I0727737c8a9c4998ed66065fb1011389a502b0f9
parent
4797d7d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/messagesadapter.cpp
+24
-8
24 additions, 8 deletions
src/messagesadapter.cpp
src/messagesadapter.h
+5
-1
5 additions, 1 deletion
src/messagesadapter.h
with
29 additions
and
9 deletions
src/messagesadapter.cpp
+
24
−
8
View file @
1355111e
...
...
@@ -77,8 +77,10 @@ MessagesAdapter::setupChatView(const QString& convUid)
auto
&
accountInfo
=
lrcInstance_
->
accountModel
().
getAccountInfo
(
selectedAccountId
);
lrc
::
api
::
contact
::
Info
contactInfo
;
QString
bestName
;
try
{
contactInfo
=
accountInfo
.
contactModel
->
getContact
(
contactURI
);
bestName
=
accountInfo
.
contactModel
->
bestNameForContact
(
contactURI
);
}
catch
(...)
{
}
...
...
@@ -87,8 +89,18 @@ MessagesAdapter::setupChatView(const QString& convUid)
QMetaObject
::
invokeMethod
(
qmlObj_
,
"setSendContactRequestButtonVisible"
,
Q_ARG
(
QVariant
,
isPending
));
QMetaObject
::
invokeMethod
(
qmlObj_
,
"setMessagingHeaderButtonsVisible"
,
Q_ARG
(
QVariant
,
!
(
convInfo
.
mode
!=
lrc
::
api
::
conversation
::
Mode
::
NON_SWARM
&&
(
convInfo
.
isRequest
||
convInfo
.
needsSyncing
))));
setMessagesVisibility
(
false
);
setInvitation
(
convInfo
.
isRequest
or
convInfo
.
needsSyncing
,
bestName
,
contactURI
,
convInfo
.
mode
!=
lrc
::
api
::
conversation
::
Mode
::
NON_SWARM
,
convInfo
.
needsSyncing
);
// Type Indicator (contact). TODO: Not shown when invitation request?
contactIsComposing
(
convInfo
.
uid
,
""
,
false
);
...
...
@@ -457,9 +469,11 @@ MessagesAdapter::setConversationProfileData(const lrc::api::conversation::Info&
try
{
auto
&
contact
=
accInfo
->
contactModel
->
getContact
(
contactUri
);
auto
bestName
=
accInfo
->
contactModel
->
bestNameForContact
(
contactUri
);
setInvitation
(
con
tact
.
profileInfo
.
type
==
lrc
::
api
::
profile
::
Type
::
PENDING
,
setInvitation
(
con
vInfo
.
isRequest
or
convInfo
.
needsSyncing
,
bestName
,
contactUri
);
contactUri
,
convInfo
.
mode
!=
lrc
::
api
::
conversation
::
Mode
::
NON_SWARM
,
convInfo
.
needsSyncing
);
if
(
!
contact
.
profileInfo
.
avatar
.
isEmpty
())
{
setSenderImage
(
contactUri
,
contact
.
profileInfo
.
avatar
);
}
else
{
...
...
@@ -524,13 +538,15 @@ MessagesAdapter::requestSendMessageContent()
}
void
MessagesAdapter
::
setInvitation
(
bool
show
,
const
QString
&
contactUri
,
const
QString
&
contactId
)
MessagesAdapter
::
setInvitation
(
bool
show
,
const
QString
&
contactUri
,
const
QString
&
contactId
,
bool
isSwarm
,
bool
needsSyncing
)
{
QString
s
=
show
?
QString
::
fromLatin1
(
"showInvitation(
\"
%1
\"
,
\"
%2
\"
)"
).
arg
(
contactUri
).
arg
(
contactId
)
:
QString
::
fromLatin1
(
"showInvitation()"
);
QString
s
=
show
?
QString
::
fromLatin1
(
"showInvitation(
\"
%1
\"
,
\"
%2
\"
, %3, %4)"
)
.
arg
(
contactUri
)
.
arg
(
contactId
)
.
arg
(
isSwarm
)
.
arg
(
needsSyncing
)
:
QString
::
fromLatin1
(
"showInvitation()"
);
QMetaObject
::
invokeMethod
(
qmlObj_
,
"webViewRunJavaScript"
,
Q_ARG
(
QVariant
,
s
));
}
...
...
This diff is collapsed.
Click to expand it.
src/messagesadapter.h
+
5
−
1
View file @
1355111e
...
...
@@ -75,7 +75,11 @@ protected:
// Run corrsponding js functions, c++ to qml.
void
setMessagesVisibility
(
bool
visible
);
void
requestSendMessageContent
();
void
setInvitation
(
bool
show
,
const
QString
&
contactUri
=
{},
const
QString
&
contactId
=
{});
void
setInvitation
(
bool
show
,
const
QString
&
contactUri
=
{},
const
QString
&
contactId
=
{},
bool
isSwarm
=
false
,
bool
needsSyncing
=
false
);
void
clear
();
void
printHistory
(
ConversationModel
&
conversationModel
,
MessagesList
interactions
);
void
updateHistory
(
ConversationModel
&
conversationModel
,
...
...
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