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
61ce19b9
Commit
61ce19b9
authored
Feb 05, 2018
by
François Grisez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusts Linphone Qt's code to fit the new API of Liblinphone
parent
762e3ab8
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
249 additions
and
249 deletions
+249
-249
Logger.cpp
src/app/logger/Logger.cpp
+1
-1
AssistantModel.cpp
src/components/assistant/AssistantModel.cpp
+37
-37
AssistantModel.hpp
src/components/assistant/AssistantModel.hpp
+1
-1
CallModel.cpp
src/components/call/CallModel.cpp
+82
-82
CallModel.hpp
src/components/call/CallModel.hpp
+6
-6
CallsListModel.cpp
src/components/calls/CallsListModel.cpp
+7
-7
CallsListModel.hpp
src/components/calls/CallsListModel.hpp
+1
-1
ChatModel.cpp
src/components/chat/ChatModel.cpp
+22
-22
ChatModel.hpp
src/components/chat/ChatModel.hpp
+12
-12
ContactsListModel.cpp
src/components/contacts/ContactsListModel.cpp
+1
-1
CoreHandlers.cpp
src/components/core/CoreHandlers.cpp
+27
-27
CoreHandlers.hpp
src/components/core/CoreHandlers.hpp
+5
-5
CoreManager.cpp
src/components/core/CoreManager.cpp
+4
-4
CoreManager.hpp
src/components/core/CoreManager.hpp
+1
-1
Presence.hpp
src/components/presence/Presence.hpp
+4
-4
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+8
-8
SettingsModel.cpp
src/components/settings/SettingsModel.cpp
+3
-3
SettingsModel.hpp
src/components/settings/SettingsModel.hpp
+7
-7
SipAddressesModel.cpp
src/components/sip-addresses/SipAddressesModel.cpp
+14
-14
SipAddressesModel.hpp
src/components/sip-addresses/SipAddressesModel.hpp
+1
-1
LinphoneUtils.cpp
src/utils/LinphoneUtils.cpp
+4
-4
linphone
submodules/linphone
+1
-1
No files found.
src/app/logger/Logger.cpp
View file @
61ce19b9
...
...
@@ -20,7 +20,7 @@
* Author: Ronan Abhamon
*/
#include <
bctoolbox/logging.
h>
#include <
linphone++/linphone.h
h>
#include <linphone/linphonecore.h>
#include <QDateTime>
#include <QThread>
...
...
src/components/assistant/AssistantModel.cpp
View file @
61ce19b9
...
...
@@ -48,15 +48,15 @@ private:
void
onCreateAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
linphone
::
AccountCreatorStatus
status
,
linphone
::
AccountCreator
::
Status
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreator
Status
AccountCreated
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
AccountCreated
)
emit
mAssistant
->
createStatusChanged
(
QString
(
""
));
else
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestFailed
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestFailed
)
emit
mAssistant
->
createStatusChanged
(
tr
(
"requestFailed"
));
else
if
(
status
==
linphone
::
AccountCreator
Status
ServerError
)
else
if
(
status
==
linphone
::
AccountCreator
::
Status
::
ServerError
)
emit
mAssistant
->
createStatusChanged
(
tr
(
"cannotSendSms"
));
else
emit
mAssistant
->
createStatusChanged
(
tr
(
"accountAlreadyExists"
));
...
...
@@ -65,14 +65,14 @@ private:
void
onIsAccountExist
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
linphone
::
AccountCreatorStatus
status
,
linphone
::
AccountCreator
::
Status
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreator
StatusAccountExist
||
status
==
linphone
::
AccountCreatorStatus
AccountExistWithAlias
)
{
if
(
status
==
linphone
::
AccountCreator
::
Status
::
AccountExist
||
status
==
linphone
::
AccountCreator
::
Status
::
AccountExistWithAlias
)
{
createProxyConfig
(
creator
);
emit
mAssistant
->
loginStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestFailed
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestFailed
)
emit
mAssistant
->
loginStatusChanged
(
tr
(
"requestFailed"
));
else
emit
mAssistant
->
loginStatusChanged
(
tr
(
"loginWithUsernameFailed"
));
...
...
@@ -81,19 +81,19 @@ private:
void
onActivateAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
linphone
::
AccountCreatorStatus
status
,
linphone
::
AccountCreator
::
Status
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreator
Status
AccountActivated
||
status
==
linphone
::
AccountCreator
Status
AccountAlreadyActivated
status
==
linphone
::
AccountCreator
::
Status
::
AccountActivated
||
status
==
linphone
::
AccountCreator
::
Status
::
AccountAlreadyActivated
)
{
if
(
creator
->
getEmail
().
empty
())
createProxyConfig
(
creator
);
emit
mAssistant
->
activateStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestFailed
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestFailed
)
emit
mAssistant
->
activateStatusChanged
(
tr
(
"requestFailed"
));
else
emit
mAssistant
->
activateStatusChanged
(
tr
(
"smsActivationFailed"
));
...
...
@@ -102,14 +102,14 @@ private:
void
onIsAccountActivated
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
creator
,
linphone
::
AccountCreatorStatus
status
,
linphone
::
AccountCreator
::
Status
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreator
Status
AccountActivated
)
{
if
(
status
==
linphone
::
AccountCreator
::
Status
::
AccountActivated
)
{
createProxyConfig
(
creator
);
emit
mAssistant
->
activateStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestFailed
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestFailed
)
emit
mAssistant
->
activateStatusChanged
(
tr
(
"requestFailed"
));
else
emit
mAssistant
->
activateStatusChanged
(
tr
(
"emailActivationFailed"
));
...
...
@@ -118,15 +118,15 @@ private:
void
onRecoverAccount
(
const
shared_ptr
<
linphone
::
AccountCreator
>
&
,
linphone
::
AccountCreatorStatus
status
,
linphone
::
AccountCreator
::
Status
status
,
const
string
&
)
override
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestOk
)
{
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestOk
)
{
emit
mAssistant
->
recoverStatusChanged
(
QString
(
""
));
}
else
{
if
(
status
==
linphone
::
AccountCreator
Status
RequestFailed
)
if
(
status
==
linphone
::
AccountCreator
::
Status
::
RequestFailed
)
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"requestFailed"
));
else
if
(
status
==
linphone
::
AccountCreator
Status
ServerError
)
else
if
(
status
==
linphone
::
AccountCreator
::
Status
::
ServerError
)
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"cannotSendSms"
));
else
emit
mAssistant
->
recoverStatusChanged
(
tr
(
"loginWithPhoneNumberFailed"
));
...
...
@@ -243,12 +243,12 @@ void AssistantModel::setEmail (const QString &email) {
QString
error
;
switch
(
mAccountCreator
->
setEmail
(
::
Utils
::
appStringToCoreString
(
email
)))
{
case
linphone
:
:
AccountCreator
EmailStatus
Ok
:
case
linphone
:
:
AccountCreator
::
EmailStatus
::
Ok
:
break
;
case
linphone
:
:
AccountCreator
EmailStatus
Malformed
:
case
linphone
:
:
AccountCreator
::
EmailStatus
::
Malformed
:
error
=
tr
(
"emailStatusMalformed"
);
break
;
case
linphone
:
:
AccountCreator
EmailStatus
InvalidCharacters
:
case
linphone
:
:
AccountCreator
::
EmailStatus
::
InvalidCharacters
:
error
=
tr
(
"emailStatusMalformedInvalidCharacters"
);
break
;
}
...
...
@@ -267,19 +267,19 @@ void AssistantModel::setPassword (const QString &password) {
QString
error
;
switch
(
mAccountCreator
->
setPassword
(
::
Utils
::
appStringToCoreString
(
password
)))
{
case
linphone
:
:
AccountCreator
PasswordStatus
Ok
:
case
linphone
:
:
AccountCreator
::
PasswordStatus
::
Ok
:
break
;
case
linphone
:
:
AccountCreator
PasswordStatus
TooShort
:
case
linphone
:
:
AccountCreator
::
PasswordStatus
::
TooShort
:
error
=
tr
(
"passwordStatusTooShort"
).
arg
(
config
->
getInt
(
"assistant"
,
"password_min_length"
,
1
));
break
;
case
linphone
:
:
AccountCreator
PasswordStatus
TooLong
:
case
linphone
:
:
AccountCreator
::
PasswordStatus
::
TooLong
:
error
=
tr
(
"passwordStatusTooLong"
).
arg
(
config
->
getInt
(
"assistant"
,
"password_max_length"
,
-
1
));
break
;
case
linphone
:
:
AccountCreator
PasswordStatus
InvalidCharacters
:
case
linphone
:
:
AccountCreator
::
PasswordStatus
::
InvalidCharacters
:
error
=
tr
(
"passwordStatusInvalidCharacters"
)
.
arg
(
::
Utils
::
coreStringToAppString
(
config
->
getString
(
"assistant"
,
"password_regex"
,
""
)));
break
;
case
linphone
:
:
AccountCreator
PasswordStatus
MissingCharacters
:
case
linphone
:
:
AccountCreator
::
PasswordStatus
::
MissingCharacters
:
error
=
tr
(
"passwordStatusMissingCharacters"
)
.
arg
(
::
Utils
::
coreStringToAppString
(
config
->
getString
(
"assistant"
,
"missing_characters"
,
""
)));
break
;
...
...
@@ -310,18 +310,18 @@ void AssistantModel::setPhoneNumber (const QString &phoneNumber) {
QString
error
;
switch
(
mAccountCreator
->
setPhoneNumber
(
::
Utils
::
appStringToCoreString
(
phoneNumber
),
::
Utils
::
appStringToCoreString
(
mCountryCode
)))
{
case
linphone
:
:
AccountCreatorPhoneNumberStatusOk
:
case
int
(
linphone
:
:
AccountCreator
::
PhoneNumberStatus
::
Ok
)
:
break
;
case
linphone
:
:
AccountCreatorPhoneNumberStatusInvalid
:
case
int
(
linphone
:
:
AccountCreator
::
PhoneNumberStatus
::
Invalid
)
:
error
=
tr
(
"phoneNumberStatusInvalid"
);
break
;
case
linphone
:
:
AccountCreatorPhoneNumberStatusTooShort
:
case
int
(
linphone
:
:
AccountCreator
::
PhoneNumberStatus
::
TooShort
)
:
error
=
tr
(
"phoneNumberStatusTooShort"
);
break
;
case
linphone
:
:
AccountCreatorPhoneNumberStatusTooLong
:
case
int
(
linphone
:
:
AccountCreator
::
PhoneNumberStatus
::
TooLong
)
:
error
=
tr
(
"phoneNumberStatusTooLong"
);
break
;
case
linphone
:
:
AccountCreatorPhoneNumberStatusInvalidCountryCode
:
case
int
(
linphone
:
:
AccountCreator
::
PhoneNumberStatus
::
InvalidCountryCode
)
:
error
=
tr
(
"phoneNumberStatusInvalidCountryCode"
);
break
;
default:
...
...
@@ -393,24 +393,24 @@ void AssistantModel::setConfigFilename (const QString &configFilename) {
// -----------------------------------------------------------------------------
QString
AssistantModel
::
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreatorUsernameStatus
status
)
const
{
QString
AssistantModel
::
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreator
::
UsernameStatus
status
)
const
{
shared_ptr
<
linphone
::
Config
>
config
=
CoreManager
::
getInstance
()
->
getCore
()
->
getConfig
();
QString
error
;
switch
(
status
)
{
case
linphone
:
:
AccountCreator
UsernameStatus
Ok
:
case
linphone
:
:
AccountCreator
::
UsernameStatus
::
Ok
:
break
;
case
linphone
:
:
AccountCreator
UsernameStatus
TooShort
:
case
linphone
:
:
AccountCreator
::
UsernameStatus
::
TooShort
:
error
=
tr
(
"usernameStatusTooShort"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_min_length"
,
1
));
break
;
case
linphone
:
:
AccountCreator
UsernameStatus
TooLong
:
case
linphone
:
:
AccountCreator
::
UsernameStatus
::
TooLong
:
error
=
tr
(
"usernameStatusTooLong"
).
arg
(
config
->
getInt
(
"assistant"
,
"username_max_length"
,
-
1
));
break
;
case
linphone
:
:
AccountCreator
UsernameStatus
InvalidCharacters
:
case
linphone
:
:
AccountCreator
::
UsernameStatus
::
InvalidCharacters
:
error
=
tr
(
"usernameStatusInvalidCharacters"
)
.
arg
(
::
Utils
::
coreStringToAppString
(
config
->
getString
(
"assistant"
,
"username_regex"
,
""
)));
break
;
case
linphone
:
:
AccountCreator
UsernameStatus
Invalid
:
case
linphone
:
:
AccountCreator
::
UsernameStatus
::
Invalid
:
error
=
tr
(
"usernameStatusInvalid"
);
break
;
}
...
...
src/components/assistant/AssistantModel.hpp
View file @
61ce19b9
...
...
@@ -94,7 +94,7 @@ private:
QString
getConfigFilename
()
const
;
void
setConfigFilename
(
const
QString
&
configFilename
);
QString
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreatorUsernameStatus
status
)
const
;
QString
mapAccountCreatorUsernameStatusToString
(
linphone
::
AccountCreator
::
UsernameStatus
status
)
const
;
QString
mCountryCode
;
QString
mConfigFilename
;
...
...
src/components/call/CallModel.cpp
View file @
61ce19b9
This diff is collapsed.
Click to expand it.
src/components/call/CallModel.hpp
View file @
61ce19b9
...
...
@@ -78,10 +78,10 @@ public:
Q_ENUM
(
CallStatus
);
enum
CallEncryption
{
CallEncryptionNone
=
linphone
::
MediaEncryptionNone
,
CallEncryptionDtls
=
linphone
::
MediaEncryptionDTLS
,
CallEncryptionSrtp
=
linphone
::
MediaEncryptionSRTP
,
CallEncryptionZrtp
=
linphone
::
MediaEncryptionZRTP
CallEncryptionNone
=
int
(
linphone
::
MediaEncryption
::
None
)
,
CallEncryptionDtls
=
int
(
linphone
::
MediaEncryption
::
DTLS
)
,
CallEncryptionSrtp
=
int
(
linphone
::
MediaEncryption
::
SRTP
)
,
CallEncryptionZrtp
=
int
(
linphone
::
MediaEncryption
::
ZRTP
)
};
Q_ENUM
(
CallEncryption
);
...
...
@@ -139,14 +139,14 @@ signals:
void
cameraFirstFrameReceived
(
unsigned
int
width
,
unsigned
int
height
);
private:
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
);
void
stopAutoAnswerTimer
()
const
;
CallStatus
getStatus
()
const
;
bool
isOutgoing
()
const
{
return
mCall
->
getDir
()
==
linphone
::
Call
Dir
Outgoing
;
return
mCall
->
getDir
()
==
linphone
::
Call
::
Dir
::
Outgoing
;
}
void
updateIsInConference
();
...
...
src/components/calls/CallsListModel.cpp
View file @
61ce19b9
...
...
@@ -172,23 +172,23 @@ static void joinConference (const shared_ptr<linphone::Call> &call) {
addModel
->
update
();
}
void
CallsListModel
::
handleCallStateChanged
(
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
void
CallsListModel
::
handleCallStateChanged
(
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
)
{
switch
(
state
)
{
case
linphone
:
:
Call
State
IncomingReceived
:
case
linphone
:
:
Call
::
State
::
IncomingReceived
:
addCall
(
call
);
::
joinConference
(
call
);
break
;
case
linphone
:
:
Call
State
OutgoingInit
:
case
linphone
:
:
Call
::
State
::
OutgoingInit
:
addCall
(
call
);
break
;
case
linphone
:
:
Call
State
End
:
case
linphone
:
:
Call
State
Error
:
case
linphone
:
:
Call
::
State
::
End
:
case
linphone
:
:
Call
::
State
::
Error
:
removeCall
(
call
);
break
;
case
linphone
:
:
Call
State
StreamsRunning
:
{
case
linphone
:
:
Call
::
State
::
StreamsRunning
:
{
int
index
=
::
findCallIndex
(
mList
,
call
);
emit
callRunning
(
index
,
&
call
->
getData
<
CallModel
>
(
"call-model"
));
}
break
;
...
...
@@ -221,7 +221,7 @@ bool CallsListModel::removeRows (int row, int count, const QModelIndex &parent)
// -----------------------------------------------------------------------------
void
CallsListModel
::
addCall
(
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
if
(
call
->
getDir
()
==
linphone
::
Call
Dir
Outgoing
)
if
(
call
->
getDir
()
==
linphone
::
Call
::
Dir
::
Outgoing
)
App
::
smartShowWindow
(
App
::
getInstance
()
->
getCallsWindow
());
CallModel
*
callModel
=
new
CallModel
(
call
);
...
...
src/components/calls/CallsListModel.hpp
View file @
61ce19b9
...
...
@@ -60,7 +60,7 @@ private:
bool
removeRow
(
int
row
,
const
QModelIndex
&
parent
=
QModelIndex
());
bool
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
=
QModelIndex
())
override
;
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
);
void
addCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
removeCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
...
...
src/components/chat/ChatModel.cpp
View file @
61ce19b9
...
...
@@ -180,7 +180,7 @@ private:
signalDataChanged
(
it
);
}
void
onMsgStateChanged
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
,
linphone
::
ChatMessageState
state
)
override
{
void
onMsgStateChanged
(
const
shared_ptr
<
linphone
::
ChatMessage
>
&
message
,
linphone
::
ChatMessage
::
State
state
)
override
{
if
(
!
mChatModel
)
return
;
...
...
@@ -189,7 +189,7 @@ private:
return
;
// File message downloaded.
if
(
state
==
linphone
::
ChatMessage
State
FileTransferDone
&&
!
message
->
isOutgoing
())
{
if
(
state
==
linphone
::
ChatMessage
::
State
::
FileTransferDone
&&
!
message
->
isOutgoing
())
{
::
createThumbnail
(
message
);
::
fillThumbnailProperty
((
*
it
).
first
,
message
);
...
...
@@ -201,7 +201,7 @@ private:
App
::
getInstance
()
->
getNotifier
()
->
notifyReceivedFileMessage
(
message
);
}
(
*
it
).
first
[
"status"
]
=
state
;
(
*
it
).
first
[
"status"
]
=
int
(
state
)
;
signalDataChanged
(
it
);
}
...
...
@@ -305,8 +305,8 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
// Old workaround.
// It can exist messages with a not delivered status. It's a linphone core bug.
if
(
message
->
getState
()
==
linphone
::
ChatMessage
State
InProgress
)
map
[
"status"
]
=
linphone
::
ChatMessageStateNotDelivered
;
if
(
message
->
getState
()
==
linphone
::
ChatMessage
::
State
::
InProgress
)
map
[
"status"
]
=
int
(
linphone
::
ChatMessage
::
State
::
NotDelivered
)
;
mEntries
<<
qMakePair
(
map
,
static_pointer_cast
<
void
>
(
message
));
}
...
...
@@ -435,7 +435,7 @@ void ChatModel::downloadFile (int id) {
shared_ptr
<
linphone
::
ChatMessage
>
message
=
static_pointer_cast
<
linphone
::
ChatMessage
>
(
entry
.
second
);
switch
(
message
->
getState
(
))
{
switch
(
int
(
message
->
getState
()
))
{
case
MessageStatusDelivered
:
case
MessageStatusDeliveredToUser
:
case
MessageStatusDisplayed
:
...
...
@@ -529,8 +529,8 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::
dest
[
"type"
]
=
EntryType
::
MessageEntry
;
dest
[
"timestamp"
]
=
QDateTime
::
fromMSecsSinceEpoch
(
message
->
getTime
()
*
1000
);
dest
[
"content"
]
=
::
Utils
::
coreStringToAppString
(
message
->
getText
());
dest
[
"isOutgoing"
]
=
message
->
isOutgoing
()
||
message
->
getState
()
==
linphone
::
ChatMessage
State
Idle
;
dest
[
"status"
]
=
message
->
getState
(
);
dest
[
"isOutgoing"
]
=
message
->
isOutgoing
()
||
message
->
getState
()
==
linphone
::
ChatMessage
::
State
::
Idle
;
dest
[
"status"
]
=
int
(
message
->
getState
()
);
shared_ptr
<
const
linphone
::
Content
>
content
=
message
->
getFileTransferInformation
();
if
(
content
)
{
...
...
@@ -547,8 +547,8 @@ void ChatModel::fillCallStartEntry (QVariantMap &dest, const shared_ptr<linphone
dest
[
"type"
]
=
EntryType
::
CallEntry
;
dest
[
"timestamp"
]
=
timestamp
;
dest
[
"isOutgoing"
]
=
callLog
->
getDir
()
==
linphone
::
Call
Dir
Outgoing
;
dest
[
"status"
]
=
callLog
->
getStatus
(
);
dest
[
"isOutgoing"
]
=
callLog
->
getDir
()
==
linphone
::
Call
::
Dir
::
Outgoing
;
dest
[
"status"
]
=
int
(
callLog
->
getStatus
()
);
dest
[
"isStart"
]
=
true
;
}
...
...
@@ -557,8 +557,8 @@ void ChatModel::fillCallEndEntry (QVariantMap &dest, const shared_ptr<linphone::
dest
[
"type"
]
=
EntryType
::
CallEntry
;
dest
[
"timestamp"
]
=
timestamp
;
dest
[
"isOutgoing"
]
=
callLog
->
getDir
()
==
linphone
::
Call
Dir
Outgoing
;
dest
[
"status"
]
=
callLog
->
getStatus
(
);
dest
[
"isOutgoing"
]
=
callLog
->
getDir
()
==
linphone
::
Call
::
Dir
::
Outgoing
;
dest
[
"status"
]
=
int
(
callLog
->
getStatus
()
);
dest
[
"isStart"
]
=
false
;
}
...
...
@@ -576,7 +576,7 @@ void ChatModel::removeEntry (ChatEntryData &pair) {
}
case
ChatModel
:
:
CallEntry
:
{
if
(
pair
.
first
[
"status"
].
toInt
()
==
linphone
::
CallStatusSuccess
)
{
if
(
pair
.
first
[
"status"
].
toInt
()
==
int
(
linphone
::
Call
::
Status
::
Success
)
)
{
// WARNING: Unable to remove symmetric call here. (start/end)
// We are between `beginRemoveRows` and `endRemoveRows`.
// A solution is to schedule a `removeEntry` call in the Qt main loop.
...
...
@@ -601,16 +601,16 @@ void ChatModel::removeEntry (ChatEntryData &pair) {
}
void
ChatModel
::
insertCall
(
const
shared_ptr
<
linphone
::
CallLog
>
&
callLog
)
{
linphone
::
CallStatus
status
=
callLog
->
getStatus
();
linphone
::
Call
::
Status
status
=
callLog
->
getStatus
();
switch
(
status
)
{
case
linphone
:
:
Call
Status
Aborted
:
case
linphone
:
:
Call
Status
EarlyAborted
:
case
linphone
:
:
Call
::
Status
::
Aborted
:
case
linphone
:
:
Call
::
Status
::
EarlyAborted
:
return
;
// Ignore aborted calls.
case
linphone
:
:
Call
Status
Success
:
case
linphone
:
:
Call
Status
Missed
:
case
linphone
:
:
Call
Status
Declined
:
case
linphone
:
:
Call
::
Status
::
Success
:
case
linphone
:
:
Call
::
Status
::
Missed
:
case
linphone
:
:
Call
::
Status
::
Declined
:
break
;
}
...
...
@@ -637,7 +637,7 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
auto
it
=
insertEntry
(
qMakePair
(
start
,
static_pointer_cast
<
void
>
(
callLog
)));
// Add end call. (if necessary)
if
(
status
==
linphone
::
Call
Status
Success
)
{
if
(
status
==
linphone
::
Call
::
Status
::
Success
)
{
QVariantMap
end
;
fillCallEndEntry
(
end
,
callLog
);
insertEntry
(
qMakePair
(
end
,
static_pointer_cast
<
void
>
(
callLog
)),
&
it
);
...
...
@@ -658,9 +658,9 @@ void ChatModel::insertMessageAtEnd (const shared_ptr<linphone::ChatMessage> &mes
// -----------------------------------------------------------------------------
void
ChatModel
::
handleCallStateChanged
(
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
)
{
void
ChatModel
::
handleCallStateChanged
(
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
)
{
if
(
(
state
==
linphone
::
Call
StateEnd
||
state
==
linphone
::
CallState
Error
)
&&
(
state
==
linphone
::
Call
::
State
::
End
||
state
==
linphone
::
Call
::
State
::
Error
)
&&
mChatRoom
==
CoreManager
::
getInstance
()
->
getCore
()
->
getChatRoom
(
call
->
getRemoteAddress
())
)
insertCall
(
call
->
getCallLog
());
...
...
src/components/chat/ChatModel.hpp
View file @
61ce19b9
...
...
@@ -52,22 +52,22 @@ public:
Q_ENUM
(
EntryType
);
enum
CallStatus
{
CallStatusDeclined
=
linphone
::
CallStatusDeclined
,
CallStatusMissed
=
linphone
::
CallStatusMissed
,
CallStatusSuccess
=
linphone
::
CallStatusSuccess
CallStatusDeclined
=
int
(
linphone
::
Call
::
Status
::
Declined
)
,
CallStatusMissed
=
int
(
linphone
::
Call
::
Status
::
Missed
)
,
CallStatusSuccess
=
int
(
linphone
::
Call
::
Status
::
Success
)
};
Q_ENUM
(
CallStatus
);
enum
MessageStatus
{
MessageStatusDelivered
=
linphone
::
ChatMessageStateDelivered
,
MessageStatusDeliveredToUser
=
linphone
::
ChatMessageStateDeliveredToUser
,
MessageStatusDisplayed
=
linphone
::
ChatMessageStateDisplayed
,
MessageStatusFileTransferDone
=
linphone
::
ChatMessageStateFileTransferDone
,
MessageStatusFileTransferError
=
linphone
::
ChatMessageStateFileTransferError
,
MessageStatusIdle
=
linphone
::
ChatMessageStateIdle
,
MessageStatusInProgress
=
linphone
::
ChatMessageStateInProgress
,
MessageStatusNotDelivered
=
linphone
::
ChatMessageStateNotDelivered
MessageStatusDelivered
=
int
(
linphone
::
ChatMessage
::
State
::
Delivered
)
,
MessageStatusDeliveredToUser
=
int
(
linphone
::
ChatMessage
::
State
::
DeliveredToUser
)
,
MessageStatusDisplayed
=
int
(
linphone
::
ChatMessage
::
State
::
Displayed
)
,
MessageStatusFileTransferDone
=
int
(
linphone
::
ChatMessage
::
State
::
FileTransferDone
)
,
MessageStatusFileTransferError
=
int
(
linphone
::
ChatMessage
::
State
::
FileTransferError
)
,
MessageStatusIdle
=
int
(
linphone
::
ChatMessage
::
State
::
Idle
)
,
MessageStatusInProgress
=
int
(
linphone
::
ChatMessage
::
State
::
InProgress
)
,
MessageStatusNotDelivered
=
int
(
linphone
::
ChatMessage
::
State
::
NotDelivered
)
};
Q_ENUM
(
MessageStatus
);
...
...
@@ -134,7 +134,7 @@ private:
void
insertCall
(
const
std
::
shared_ptr
<
linphone
::
CallLog
>
&
callLog
);
void
insertMessageAtEnd
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
);
void
handleIsComposingChanged
(
const
std
::
shared_ptr
<
linphone
::
ChatRoom
>
&
chatRoom
);
void
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
...
...
src/components/contacts/ContactsListModel.cpp
View file @
61ce19b9
...
...
@@ -140,7 +140,7 @@ ContactModel *ContactsListModel::addContact (VcardModel *vcardModel) {
if
(
mLinphoneFriends
->
addFriend
(
contact
->
mLinphoneFriend
)
!=
linphone
::
FriendList
Status
::
FriendListStatus
OK
linphone
::
FriendList
::
Status
::
OK
)
{
qWarning
()
<<
QStringLiteral
(
"Unable to add contact from vcard:"
)
<<
vcardModel
;
delete
contact
;
...
...
src/components/core/CoreHandlers.cpp
View file @
61ce19b9
...
...
@@ -88,12 +88,12 @@ void CoreHandlers::onAuthenticationRequested (
void
CoreHandlers
::
onCallStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
,
linphone
::
Call
::
State
state
,
const
string
&
)
{
emit
callStateChanged
(
call
,
state
);
if
(
call
->
getState
()
==
linphone
::
Call
State
IncomingReceived
)
if
(
call
->
getState
()
==
linphone
::
Call
::
State
::
IncomingReceived
)
App
::
getInstance
()
->
getNotifier
()
->
notifyReceivedCall
(
call
);
}
...
...
@@ -110,7 +110,7 @@ void CoreHandlers::onGlobalStateChanged (
linphone
::
GlobalState
gstate
,
const
string
&
)
{
if
(
gstate
==
linphone
::
GlobalStateOn
)
{
if
(
gstate
==
linphone
::
GlobalState
::
On
)
{
mCoreStartedLock
->
lock
();
Q_ASSERT
(
mCoreStarted
==
false
);
...
...
@@ -130,7 +130,7 @@ void CoreHandlers::onIsComposingReceived (
void
CoreHandlers
::
onLogCollectionUploadStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
linphone
::
CoreLogCollectionUploadState
state
,
linphone
::
Core
::
LogCollectionUploadState
state
,
const
string
&
info
)
{
emit
logsUploadStateChanged
(
state
,
info
);
...
...
@@ -190,46 +190,46 @@ void CoreHandlers::onRegistrationStateChanged (
void
CoreHandlers
::
onTransferStateChanged
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
linphone
::
Call
::
State
state
)
{
switch
(
state
)
{
case
linphone
:
:
Call
State
EarlyUpdatedByRemote
:
case
linphone
:
:
Call
State
EarlyUpdating
:
case
linphone
:
:
Call
State
Idle
:
case
linphone
:
:
Call
State
IncomingEarlyMedia
:
case
linphone
:
:
Call
State
IncomingReceived
:
case
linphone
:
:
Call
State
OutgoingEarlyMedia
:
case
linphone
:
:
Call
State
OutgoingRinging
:
case
linphone
:
:
Call
State
Paused
:
case
linphone
:
:
Call
State
PausedByRemote
:
case
linphone
:
:
Call
State
Pausing
:
case
linphone
:
:
Call
State
Referred
:
case
linphone
:
:
Call
State
Released
:
case
linphone
:
:
Call
State
Resuming
:
case
linphone
:
:
Call
State
StreamsRunning
:
case
linphone
:
:
Call
State
UpdatedByRemote
:
case
linphone
:
:
Call
State
Updating
:
case
linphone
:
:
Call
::
State
::
EarlyUpdatedByRemote
:
case
linphone
:
:
Call
::
State
::
EarlyUpdating
:
case
linphone
:
:
Call
::
State
::
Idle
:
case
linphone
:
:
Call
::
State
::
IncomingEarlyMedia
:
case
linphone
:
:
Call
::
State
::
IncomingReceived
:
case
linphone
:
:
Call
::
State
::
OutgoingEarlyMedia
:
case
linphone
:
:
Call
::
State
::
OutgoingRinging
:
case
linphone
:
:
Call
::
State
::
Paused
:
case
linphone
:
:
Call
::
State
::
PausedByRemote
:
case
linphone
:
:
Call
::
State
::
Pausing
:
case
linphone
:
:
Call
::
State
::
Referred
:
case
linphone
:
:
Call
::
State
::
Released
:
case
linphone
:
:
Call
::
State
::
Resuming
:
case
linphone
:
:
Call
::
State
::
StreamsRunning
:
case
linphone
:
:
Call
::
State
::
UpdatedByRemote
:
case
linphone
:
:
Call
::
State
::
Updating
:
break
;
// Nothing.
// 1. Init.
case
linphone
:
:
Call
State
OutgoingInit
:
case
linphone
:
:
Call
::
State
::
OutgoingInit
:
qInfo
()
<<
QStringLiteral
(
"Call transfer init."
);
break
;
// 2. In progress.
case
linphone
:
:
Call
State
OutgoingProgress
:
case
linphone
:
:
Call
::
State
::
OutgoingProgress
:
qInfo
()
<<
QStringLiteral
(
"Call transfer in progress."
);
break
;
// 3. Done.
case
linphone
:
:
Call
State
Connected
:
case
linphone
:
:
Call
::
State
::
Connected
:
qInfo
()
<<
QStringLiteral
(
"Call transfer succeeded."
);
emit
callTransferSucceeded
(
call
);
break
;
// 4. Error.
case
linphone
:
:
Call
State
End
:
case
linphone
:
:
Call
State
Error
:
case
linphone
:
:
Call
::
State
::
End
:
case
linphone
:
:
Call
::
State
::
Error
:
qWarning
()
<<
QStringLiteral
(
"Call transfer failed."
);
emit
callTransferFailed
(
call
);
break
;
...
...
@@ -242,7 +242,7 @@ void CoreHandlers::onVersionUpdateCheckResultReceived (
const
string
&
version
,
const
string
&
url
)
{
if
(
result
==
linphone
::
VersionUpdateCheckResultNewVersionAvailable
)
if
(
result
==
linphone
::
VersionUpdateCheckResult
::
NewVersionAvailable
)
App
::
getInstance
()
->
getNotifier
()
->
notifyNewVersionAvailable
(
::
Utils
::
coreStringToAppString
(
version
),
::
Utils
::
coreStringToAppString
(
url
)
...
...
src/components/core/CoreHandlers.hpp
View file @
61ce19b9
...
...
@@ -42,12 +42,12 @@ public:
signals:
void
authenticationRequested
(
const
std
::
shared_ptr
<
linphone
::
AuthInfo
>
&
authInfo
);
void
callStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
callStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
);
void
callTransferFailed
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
callTransferSucceeded
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
coreStarted
();
void
isComposingChanged
(
const
std
::
shared_ptr
<
linphone
::
ChatRoom
>
&
chatRoom
);
void
logsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
logsUploadStateChanged
(
linphone
::
Core
::
LogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
presenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
void
registrationStateChanged
(
const
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
&
proxyConfig
,
linphone
::
RegistrationState
state
);
...
...
@@ -69,7 +69,7 @@ private:
void
onCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
,
linphone
::
Call
::
State
state
,
const
std
::
string
&
message
)
override
;
...
...
@@ -92,7 +92,7 @@ private:
void
onLogCollectionUploadStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
linphone
::
CoreLogCollectionUploadState
state
,
linphone
::
Core
::
LogCollectionUploadState
state
,
const
std
::
string
&
info
)
override
;
...
...
@@ -130,7 +130,7 @@ private:
void
onTransferStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Core
>
&
core
,
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
linphone
::
Call
::
State
state
)
override
;
void
onVersionUpdateCheckResultReceived
(
...
...
src/components/core/CoreManager.cpp
View file @
61ce19b9
...
...
@@ -253,13 +253,13 @@ void CoreManager::iterate () {
// -----------------------------------------------------------------------------
void
CoreManager
::
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
string
&
info
)
{
void
CoreManager
::
handleLogsUploadStateChanged
(
linphone
::
Core
::
LogCollectionUploadState
state
,
const
string
&
info
)
{
switch
(
state
)
{
case
linphone
:
:
Core
LogCollectionUploadState
InProgress
:
case
linphone
:
:
Core
::
LogCollectionUploadState
::
InProgress
:
break
;
case
linphone
:
:
Core
LogCollectionUploadState
Delivered
:
case
linphone
:
:
Core
LogCollectionUploadState
NotDelivered
:
case
linphone
:
:
Core
::
LogCollectionUploadState
::
Delivered
:
case
linphone
:
:
Core
::
LogCollectionUploadState
::
NotDelivered
:
emit
logsUploaded
(
::
Utils
::
coreStringToAppString
(
info
));
break
;
}
...
...
src/components/core/CoreManager.hpp
View file @
61ce19b9
...
...
@@ -148,7 +148,7 @@ private:
void
iterate
();
void
handleLogsUploadStateChanged
(
linphone
::
CoreLogCollectionUploadState
state
,
const
std
::
string
&
info
);
void
handleLogsUploadStateChanged
(
linphone
::
Core
::
LogCollectionUploadState
state
,
const
std
::
string
&
info
);
static
QString
getDownloadUrl
();
...
...
src/components/presence/Presence.hpp
View file @
61ce19b9
...
...
@@ -36,10 +36,10 @@ class Presence : public QObject {
public:
enum
PresenceStatus
{
Online
=
linphone
::
ConsolidatedPresenceOnline
,
Busy
=
linphone
::
ConsolidatedPresenceBusy
,
DoNotDisturb
=
linphone
::
ConsolidatedPresenceDoNotDisturb
,
Offline
=
linphone
::
ConsolidatedPresenceOffline
Online
=
int
(
linphone
::
ConsolidatedPresence
::
Online
)
,
Busy
=
int
(
linphone
::
ConsolidatedPresence
::
Busy
)
,
DoNotDisturb
=
int
(
linphone
::
ConsolidatedPresence
::
DoNotDisturb
)
,
Offline
=
int
(
linphone
::
ConsolidatedPresence
::
Offline
)
};
Q_ENUM
(
PresenceStatus
);
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
61ce19b9
...
...
@@ -32,15 +32,15 @@ using namespace std;
static
inline
AccountSettingsModel
::
RegistrationState
mapLinphoneRegistrationStateToUi
(
linphone
::
RegistrationState
state
)
{
switch
(
state
)
{
case
linphone
:
:
RegistrationStateNone
:
case
linphone
:
:
RegistrationStateCleared
:
case
linphone
:
:
RegistrationStateFailed
:
case
linphone
:
:
RegistrationState
::
None
:
case
linphone
:
:
RegistrationState
::
Cleared
:
case
linphone
:
:
RegistrationState
::
Failed
:
return
AccountSettingsModel
::
RegistrationStateNotRegistered
;
case
linphone
:
:
RegistrationStateProgress
:
case
linphone
:
:
RegistrationState
::
Progress
:
return
AccountSettingsModel
::
RegistrationStateInProgress
;
case
linphone
:
:
RegistrationStateOk
:
case
linphone
:
:
RegistrationState
::
Ok
:
break
;
}
...
...
@@ -105,7 +105,7 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
map
[
"avpfInterval"
]
=
proxyConfig
->
getAvpfRrInterval
();
map
[
"registerEnabled"
]
=
proxyConfig
->
registerEnabled
();
map
[
"publishPresence"
]
=
proxyConfig
->
publishEnabled
();
map
[
"avpfEnabled"
]
=
proxyConfig
->
getAvpfMode
()
==
linphone
::
AVPFMode
::
AVPFMode
Enabled
;
map
[
"avpfEnabled"
]
=
proxyConfig
->
getAvpfMode
()
==
linphone
::
AVPFMode
::
Enabled
;
map
[
"registrationState"
]
=
::
mapLinphoneRegistrationStateToUi
(
proxyConfig
->
getState
());
return
map
;
...
...
@@ -168,8 +168,8 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
proxyConfig
->
enableRegister
(
data
[
"registerEnabled"
].
toBool
());
proxyConfig
->
enablePublish
(
data
[
"publishPresence"
].
toBool
());
proxyConfig
->
setAvpfMode
(
data
[
"avpfEnabled"
].
toBool
()
?
linphone
::
AVPFMode
::
AVPFMode
Enabled
:
linphone
::
AVPFMode
::
AVPFMode
Default
?
linphone
::
AVPFMode
::
Enabled
:
linphone
::
AVPFMode
::
Default
);
return
addOrUpdateProxyConfig
(
proxyConfig
);
...
...
src/components/settings/SettingsModel.cpp
View file @
61ce19b9
...
...
@@ -306,13 +306,13 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const {
shared_ptr
<
linphone
::
Core
>
core
=
CoreManager
::
getInstance
()
->
getCore
();
QVariantList
list
;
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryptionDTLS
))
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryption
::
DTLS
))
list
<<
::
buildEncryptionDescription
(
MediaEncryptionDtls
,
"DTLS"
);
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryptionSRTP
))
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryption
::
SRTP
))
list
<<
::
buildEncryptionDescription
(
MediaEncryptionSrtp
,
"SRTP"
);
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryptionZRTP
))
if
(
core
->
mediaEncryptionSupported
(
linphone
::
MediaEncryption
::
ZRTP
))
list
<<
::
buildEncryptionDescription
(
MediaEncryptionZrtp
,
"ZRTP"
);
return
list
;
...
...
src/components/settings/SettingsModel.hpp
View file @
61ce19b9
...
...
@@ -132,18 +132,18 @@ class SettingsModel : public QObject {
public:
enum
MediaEncryption
{
MediaEncryptionNone
=
linphone
::
MediaEncryptionNone
,
MediaEncryptionDtls
=
linphone
::
MediaEncryptionDTLS
,
MediaEncryptionSrtp
=
linphone
::
MediaEncryptionSRTP
,
MediaEncryptionZrtp
=
linphone
::
MediaEncryptionZRTP
MediaEncryptionNone
=
int
(
linphone
::
MediaEncryption
::
None
)
,
MediaEncryptionDtls
=
int
(
linphone
::
MediaEncryption
::
DTLS
)
,
MediaEncryptionSrtp
=
int
(
linphone
::
MediaEncryption
::
SRTP
)
,
MediaEncryptionZrtp
=
int
(
linphone
::
MediaEncryption
::
ZRTP
)
};
Q_ENUM
(
MediaEncryption
);
enum
LimeState
{
LimeStateDisabled
=
linphone
::
LimeStateDisabled
,
LimeStateMandatory
=
linphone
::
LimeStateMandatory
,
LimeStatePreferred
=
linphone
::
LimeStatePreferred
LimeStateDisabled
=
int
(
linphone
::
LimeState
::
Disabled
)
,
LimeStateMandatory
=
int
(
linphone
::
LimeState
::
Mandatory
)
,
LimeStatePreferred
=
int
(
linphone
::
LimeState
::
Preferred
)
};
Q_ENUM
(
LimeState
);
...
...
src/components/sip-addresses/SipAddressesModel.cpp
View file @
61ce19b9
...
...
@@ -136,13 +136,13 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress
return
QString
(
""
);
switch
(
address
->
getTransport
())
{
case
linphone
:
:
TransportTypeUdp
:
case
linphone
:
:
TransportType
::
Udp
:
return
QStringLiteral
(
"UDP"
);
case
linphone
:
:
TransportTypeTcp
:
case
linphone
:
:
TransportType
::
Tcp
:
return
QStringLiteral
(
"TCP"
);
case
linphone
:
:
TransportTypeTls
:
case
linphone
:
:
TransportType
::
Tls
:
return
QStringLiteral
(
"TLS"
);
case
linphone
:
:
TransportTypeDtls
:
case
linphone
:
:
TransportType
::
Dtls
:
return
QStringLiteral
(
"DTLS"
);
}
...
...
@@ -278,13 +278,13 @@ void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMe
void
SipAddressesModel
::
handleCallStateChanged
(
const
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
linphone
::
Call
::
State
state
)
{
// Ignore aborted calls.
if
(
call
->
getCallLog
()
->
getStatus
()
==
linphone
::
Call
Status
::
CallStatus
Aborted
)
if
(
call
->
getCallLog
()
->
getStatus
()
==
linphone
::
Call
::
Status
::
Aborted
)
return
;
if
(
state
==
linphone
::
Call
StateEnd
||
state
==
linphone
::
CallState
Error
)
if
(
state
==
linphone
::
Call
::
State
::
End
||
state
==
linphone
::
Call
::
State
::
Error
)
addOrUpdateSipAddress
(
::
Utils
::
coreStringToAppString
(
call
->
getRemoteAddress
()
->
asStringUriOnly
()),
call
);
...
...
@@ -297,16 +297,16 @@ void SipAddressesModel::handlePresenceReceived (
Presence
::
PresenceStatus
status
;
switch
(
presenceModel
->
getConsolidatedPresence
())
{
case
linphone
:
:
ConsolidatedPresenceOnline
:
case
linphone
:
:
ConsolidatedPresence
::
Online
:
status
=
Presence
::
PresenceStatus
::
Online
;
break
;
case
linphone
:
:
ConsolidatedPresenceBusy
:
case
linphone
:
:
ConsolidatedPresence
::
Busy
:
status
=
Presence
::
PresenceStatus
::
Busy
;
break
;
case
linphone
:
:
ConsolidatedPresenceDoNotDisturb
:
case
linphone
:
:
ConsolidatedPresence
::
DoNotDisturb
:
status
=
Presence
::
PresenceStatus
::
DoNotDisturb
;
break
;
case
linphone
:
:
ConsolidatedPresenceOffline
:
case
linphone
:
:
ConsolidatedPresence
::
Offline
:
status
=
Presence
::
PresenceStatus
::
Offline
;
break
;
}
...
...
@@ -392,7 +392,7 @@ void SipAddressesModel::addOrUpdateSipAddress (QVariantMap &map, ContactModel *c
void
SipAddressesModel
::
addOrUpdateSipAddress
(
QVariantMap
&
map
,
const
shared_ptr
<
linphone
::
Call
>
&
call
)
{
const
shared_ptr
<
linphone
::
CallLog
>
callLog
=
call
->
getCallLog
();
map
[
"timestamp"
]
=
callLog
->
getStatus
()
==
linphone
::
Call
Status
::
CallStatus
Success
map
[
"timestamp"
]
=
callLog
->
getStatus
()
==
linphone
::
Call
::
Status
::
Success
?
QDateTime
::
fromMSecsSinceEpoch
((
callLog
->
getStartDate
()
+
callLog
->
getDuration
())
*
1000
)
:
QDateTime
::
fromMSecsSinceEpoch
(
callLog
->
getStartDate
()
*
1000
);
}
...
...
@@ -492,7 +492,7 @@ void SipAddressesModel::initSipAddresses () {
if
(
addressDone
.
contains
(
sipAddress
))
continue
;
// Already used.
if
(
callLog
->
getStatus
()
==
linphone
::
Call
Status
Aborted
)
if
(
callLog
->
getStatus
()
==
linphone
::
Call
::
Status
::
Aborted
)
continue
;
// Ignore aborted calls.
addressDone
<<
sipAddress
;
...
...
@@ -501,7 +501,7 @@ void SipAddressesModel::initSipAddresses () {
map
[
"sipAddress"
]
=
sipAddress
;
// The duration can be wrong if status is not success.
map
[
"timestamp"
]
=
callLog
->
getStatus
()
==
linphone
::
Call
Status
::
CallStatus
Success
map
[
"timestamp"
]
=
callLog
->
getStatus
()
==
linphone
::
Call
::
Status
::
Success
?
QDateTime
::
fromMSecsSinceEpoch
((
callLog
->
getStartDate
()
+
callLog
->
getDuration
())
*
1000
)
:
QDateTime
::
fromMSecsSinceEpoch
(
callLog
->
getStartDate
()
*
1000
);
...
...
src/components/sip-addresses/SipAddressesModel.hpp
View file @
61ce19b9
...
...
@@ -81,7 +81,7 @@ private:
void
handleSipAddressRemoved
(
ContactModel
*
contact
,
const
QString
&
sipAddress
);
void
handleMessageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
handleCallStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
Call
::
State
state
);
void
handlePresenceReceived
(
const
QString
&
sipAddress
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presenceModel
);
void
handleAllEntriesRemoved
(
const
QString
&
sipAddress
);
...
...
src/utils/LinphoneUtils.cpp
View file @
61ce19b9
...
...
@@ -26,11 +26,11 @@
linphone
::
TransportType
LinphoneUtils
::
stringToTransportType
(
const
QString
&
transport
)
{
if
(
transport
==
"TCP"
)
return
linphone
::
TransportType
::
T
ransportTypeT
cp
;
return
linphone
::
TransportType
::
Tcp
;
if
(
transport
==
"UDP"
)
return
linphone
::
TransportType
::
TransportType
Udp
;
return
linphone
::
TransportType
::
Udp
;
if
(
transport
==
"TLS"
)
return
linphone
::
TransportType
::
T
ransportTypeT
ls
;
return
linphone
::
TransportType
::
Tls
;
return
linphone
::
TransportType
::
TransportType
Dtls
;
return
linphone
::
TransportType
::
Dtls
;
}
linphone
@
bff2f9a2
Subproject commit
1ca73da1cf180f39204df9179d44e5a0baf620ec
Subproject commit
bff2f9a26f46607d7c24128ff045817ec1ce3a29
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