Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
9ccbd52d
Commit
9ccbd52d
authored
May 30, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(src/components/call/CallModel): coding style
parent
35828719
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
34 deletions
+32
-34
CallModel.cpp
linphone-desktop/src/components/call/CallModel.cpp
+28
-30
CallModel.hpp
linphone-desktop/src/components/call/CallModel.hpp
+2
-2
Incall.qml
linphone-desktop/ui/views/App/Calls/Incall.qml
+2
-2
No files found.
linphone-desktop/src/components/call/CallModel.cpp
View file @
9ccbd52d
...
...
@@ -496,10 +496,15 @@ void CallModel::sendDtmf (const QString &dtmf) {
// -----------------------------------------------------------------------------
void
CallModel
::
verifyAuthenticationToken
(
bool
verify
)
{
mCall
->
setAuthenticationTokenVerified
(
verify
);
emit
securityUpdated
();
}
// -----------------------------------------------------------------------------
CallModel
::
CallEncryption
CallModel
::
getEncryption
()
const
{
shared_ptr
<
const
linphone
::
CallParams
>
params
=
mCall
->
getCurrentParams
();
linphone
::
MediaEncryption
encryption
=
params
->
getMediaEncryption
();
switch
(
encryption
)
{
switch
(
mCall
->
getCurrentParams
()
->
getMediaEncryption
())
{
case
linphone
:
:
MediaEncryptionSRTP
:
return
CallEncryptionSRTP
;
case
linphone
:
:
MediaEncryptionZRTP
:
...
...
@@ -507,41 +512,30 @@ CallModel::CallEncryption CallModel::getEncryption () const {
case
linphone
:
:
MediaEncryptionDTLS
:
return
CallEncryptionDTLS
;
case
linphone
:
:
MediaEncryptionNone
:
default:
return
CallEncryptionNone
;
break
;
}
return
CallEncryptionNone
;
}
bool
CallModel
::
isSecured
()
const
{
shared_ptr
<
const
linphone
::
CallParams
>
params
=
mCall
->
getCurrentParams
();
linphone
::
MediaEncryption
encryption
=
params
->
getMediaEncryption
();
return
(
encryption
==
linphone
::
MediaEncryptionZRTP
&&
mCall
->
getAuthenticationTokenVerified
())
||
encryption
==
linphone
::
MediaEncryptionSRTP
||
encryption
==
linphone
::
MediaEncryptionDTLS
;
return
(
encryption
==
linphone
::
MediaEncryptionZRTP
&&
mCall
->
getAuthenticationTokenVerified
()
)
||
encryption
==
linphone
::
MediaEncryptionSRTP
||
encryption
==
linphone
::
MediaEncryptionDTLS
;
}
QString
CallModel
::
getLocalSAS
()
const
{
QString
token
=
mCall
->
getAuthenticationToken
().
c_str
();
linphone
::
CallDir
direction
=
mCall
->
getDir
();
if
(
direction
==
linphone
::
CallDirIncoming
)
{
return
token
.
left
(
2
).
toUpper
();
}
else
{
return
token
.
right
(
2
).
toUpper
();
}
}
// -----------------------------------------------------------------------------
QString
CallModel
::
getRemoteSAS
()
const
{
QString
token
=
mCall
->
getAuthenticationToken
().
c_str
();
linphone
::
CallDir
direction
=
mCall
->
getDir
();
if
(
direction
==
linphone
::
CallDirIncoming
)
{
return
token
.
right
(
2
).
toUpper
();
}
else
{
return
token
.
left
(
2
).
toUpper
();
}
QString
CallModel
::
getLocalSAS
()
const
{
QString
token
=
::
Utils
::
coreStringToAppString
(
mCall
->
getAuthenticationToken
());
return
mCall
->
getDir
()
==
linphone
::
CallDirIncoming
?
token
.
left
(
2
).
toUpper
()
:
token
.
right
(
2
).
toUpper
();
}
void
CallModel
::
verifyAuthenticationToken
(
bool
verify
)
{
mCall
->
setAuthenticationTokenVerified
(
verify
);
emit
securityUpdated
();
QString
CallModel
::
getRemoteSAS
()
const
{
QString
token
=
::
Utils
::
coreStringToAppString
(
mCall
->
getAuthenticationToken
()
);
return
mCall
->
getDir
()
!=
linphone
::
CallDirIncoming
?
token
.
left
(
2
).
toUpper
()
:
token
.
right
(
2
).
toUpper
();
}
// -----------------------------------------------------------------------------
...
...
@@ -554,6 +548,8 @@ QVariantList CallModel::getVideoStats () const {
return
mVideoStats
;
}
// -----------------------------------------------------------------------------
inline
QVariantMap
createStat
(
const
QString
&
key
,
const
QString
&
value
)
{
QVariantMap
m
;
m
[
"key"
]
=
key
;
...
...
@@ -579,13 +575,13 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
switch
(
callStats
->
getIpFamilyOfRemote
())
{
case
linphone
:
:
AddressFamilyInet
:
family
=
"IPv4"
;
family
=
QStringLiteral
(
"IPv4"
)
;
break
;
case
linphone
:
:
AddressFamilyInet6
:
family
=
"IPv6"
;
family
=
QStringLiteral
(
"IPv6"
)
;
break
;
default:
family
=
"Unknown"
;
family
=
QStringLiteral
(
"Unknown"
)
;
break
;
}
...
...
@@ -630,6 +626,8 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
}
}
// -----------------------------------------------------------------------------
QString
CallModel
::
iceStateToString
(
linphone
::
IceState
state
)
const
{
switch
(
state
)
{
case
linphone
:
:
IceStateNotActivated
:
...
...
linphone-desktop/src/components/call/CallModel.hpp
View file @
9ccbd52d
...
...
@@ -114,7 +114,7 @@ public:
Q_INVOKABLE
void
sendDtmf
(
const
QString
&
dtmf
);
Q_INVOKABLE
void
verifyAuthenticationToken
(
bool
verify
);
Q_INVOKABLE
void
verifyAuthenticationToken
(
bool
verify
);
signals:
void
callErrorChanged
(
const
QString
&
callError
);
...
...
@@ -164,6 +164,7 @@ private:
CallEncryption
getEncryption
()
const
;
bool
isSecured
()
const
;
QString
getLocalSAS
()
const
;
QString
getRemoteSAS
()
const
;
...
...
@@ -171,7 +172,6 @@ private:
QVariantList
getVideoStats
()
const
;
void
updateStats
(
const
std
::
shared_ptr
<
const
linphone
::
CallStats
>
&
callStats
,
QVariantList
&
statsList
);
QString
iceStateToString
(
linphone
::
IceState
state
)
const
;
bool
mIsInConference
=
false
;
...
...
linphone-desktop/ui/views/App/Calls/Incall.qml
View file @
9ccbd52d
...
...
@@ -107,7 +107,7 @@ Rectangle {
id
:
callSecure
icon
:
incall
.
call
.
isSecured
?
'
call_chat_secure
'
:
'
call_chat_unsecure
'
onClicked
:
incall
.
call
.
encryption
===
CallModel
.
CallEncryptionZRTP
?
zrtp
.
visible
=
true
:
zrtp
.
visible
=
false
onClicked
:
zrtp
.
visible
=
(
incall
.
call
.
encryption
===
CallModel
.
CallEncryptionZRTP
)
}
}
...
...
@@ -235,7 +235,7 @@ Rectangle {
Camera
{
call
:
incall
.
call
height
:
zrtp
.
visible
?
container
.
height
-
zrtp
.
height
:
container
.
height
height
:
container
.
height
width
:
container
.
width
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment