Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
d83bcfcf
Commit
d83bcfcf
authored
10 years ago
by
Emmanuel Lepage Vallee
Committed by
Guillaume Roguez
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
call: Handle daemon/libringclient IPC race condition
Refs #69138 (cherry picked from commit
19027630
)
parent
a5d526fc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/call.cpp
+14
-0
14 additions, 0 deletions
src/call.cpp
src/callmodel.cpp
+19
-2
19 additions, 2 deletions
src/callmodel.cpp
src/private/accountmodel_p.h
+1
-1
1 addition, 1 deletion
src/private/accountmodel_p.h
with
34 additions
and
3 deletions
src/call.cpp
+
14
−
0
View file @
d83bcfcf
...
...
@@ -369,6 +369,13 @@ Call* CallPrivate::buildIncomingCall(const QString& callId)
const
QString
from
=
details
[
CallPrivate
::
DetailsMapFields
::
PEER_NUMBER
];
const
QString
account
=
details
[
CallPrivate
::
DetailsMapFields
::
ACCOUNT_ID
];
const
QString
peerName
=
details
[
CallPrivate
::
DetailsMapFields
::
PEER_NAME
];
//It may be possible that the call has already been invalidated
if
(
account
.
isEmpty
())
{
qWarning
()
<<
"Building incoming call"
<<
callId
<<
"failed, it may already have been destroyed by the daemon"
;
return
nullptr
;
}
Account
*
acc
=
AccountModel
::
instance
()
->
getById
(
account
.
toLatin1
());
ContactMethod
*
nb
=
PhoneDirectoryModel
::
instance
()
->
getNumber
(
from
,
acc
);
Call
*
call
=
new
Call
(
Call
::
State
::
INCOMING
,
peerName
,
nb
,
acc
);
...
...
@@ -395,6 +402,13 @@ Call* CallPrivate::buildRingingCall(const QString & callId)
const
QString
from
=
details
[
CallPrivate
::
DetailsMapFields
::
PEER_NUMBER
];
const
QString
account
=
details
[
CallPrivate
::
DetailsMapFields
::
ACCOUNT_ID
];
const
QString
peerName
=
details
[
CallPrivate
::
DetailsMapFields
::
PEER_NAME
];
//It may be possible that the call has already been invalidated
if
(
account
.
isEmpty
())
{
qWarning
()
<<
"Building ringing call"
<<
callId
<<
"failed, it may already have been destroyed by the daemon"
;
return
nullptr
;
}
Account
*
acc
=
AccountModel
::
instance
()
->
getById
(
account
.
toLatin1
());
ContactMethod
*
nb
=
PhoneDirectoryModel
::
instance
()
->
getNumber
(
from
,
acc
);
Call
*
call
=
new
Call
(
Call
::
State
::
RINGING
,
peerName
,
nb
,
acc
);
...
...
This diff is collapsed.
Click to expand it.
src/callmodel.cpp
+
19
−
2
View file @
d83bcfcf
...
...
@@ -443,6 +443,11 @@ Call* CallModel::dialingCall(const QString& peerName, Account* account)
Call
*
CallModelPrivate
::
addIncomingCall
(
const
QString
&
callId
)
{
Call
*
call
=
addCall2
(
CallPrivate
::
buildIncomingCall
(
callId
));
//The call can already have been invalidated by the daemon, then do nothing
if
(
!
call
)
return
nullptr
;
//Call without account is not possible
if
(
call
->
account
())
{
if
(
call
->
account
()
->
isAutoAnswer
())
{
...
...
@@ -459,7 +464,12 @@ Call* CallModelPrivate::addIncomingCall(const QString& callId)
///Create a ringing call
Call
*
CallModelPrivate
::
addRingingCall
(
const
QString
&
callId
)
{
return
addCall2
(
CallPrivate
::
buildRingingCall
(
callId
));
Call
*
c
=
CallPrivate
::
buildRingingCall
(
callId
);
if
(
!
c
)
return
nullptr
;
return
addCall2
(
c
);
}
///Properly remove an internal from the Qt model
...
...
@@ -1021,6 +1031,10 @@ void CallModelPrivate::slotCallStateChanged(const QString& callID, const QString
qDebug
()
<<
"Call not found"
<<
callID
<<
"new state"
<<
stateName
;
if
(
stateName
==
CallPrivate
::
StateChange
::
RINGING
)
{
call
=
addRingingCall
(
callID
);
if
(
!
call
)
return
;
}
else
{
qDebug
()
<<
"Call doesn't exist in this client. Might have been initialized by another client instance before this one started."
;
...
...
@@ -1059,7 +1073,10 @@ void CallModelPrivate::slotIncomingCall(const QString& accountID, const QString&
{
Q_UNUSED
(
accountID
)
qDebug
()
<<
"Signal : Incoming Call ! ID = "
<<
callID
;
emit
q_ptr
->
incomingCall
(
addIncomingCall
(
callID
));
Call
*
c
=
addIncomingCall
(
callID
);
if
(
c
)
emit
q_ptr
->
incomingCall
(
c
);
}
///When a new conference is incoming
...
...
This diff is collapsed.
Click to expand it.
src/private/accountmodel_p.h
+
1
−
1
View file @
d83bcfcf
...
...
@@ -44,7 +44,7 @@ public:
//Helpers
static
Account
::
RegistrationState
fromDaemonName
(
const
QString
&
st
);
void
enable
d
Protocol
(
Account
::
Protocol
proto
);
void
enableProtocol
(
Account
::
Protocol
proto
);
//Attributes
AccountModel
*
q_ptr
;
...
...
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