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
716ce26d
Commit
716ce26d
authored
5 years ago
by
Sébastien Blin
Committed by
Kateryna Kostiuk
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
newcallmodel: add method to add a contact to a current call
Change-Id: Id63ddfd6ace0d68e641020d1c90ecd53678428da
parent
8291487d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/newcallmodel.h
+9
-0
9 additions, 0 deletions
src/api/newcallmodel.h
src/newcallmodel.cpp
+27
-1
27 additions, 1 deletion
src/newcallmodel.cpp
with
36 additions
and
1 deletion
src/api/newcallmodel.h
+
9
−
0
View file @
716ce26d
...
...
@@ -186,6 +186,15 @@ public:
*/
void
joinCalls
(
const
std
::
string
&
callIdA
,
const
std
::
string
&
callIdB
)
const
;
/**
* Call a participant and add it to a call
* @param uri URI of the participant
* @param callId Call receiving the participant
* @param audioOnly If the call is audio only
* @return id for a new call
*/
std
::
string
callAndAddParticipant
(
const
std
::
string
uri
,
const
std
::
string
&
callId
,
bool
audioOnly
);
/**
* Not implemented yet
*/
...
...
This diff is collapsed.
Click to expand it.
src/newcallmodel.cpp
+
27
−
1
View file @
716ce26d
...
...
@@ -22,6 +22,7 @@
// std
#include
<chrono>
#include
<random>
#include
<map>
// Lrc
#include
"callbackshandler.h"
...
...
@@ -145,6 +146,7 @@ public:
bool
manageCurrentCall_
{
true
};
bool
dontHoldConferences_
{
false
};
std
::
map
<
std
::
string
,
std
::
string
>
pendingConferences_
;
public
Q_SLOTS
:
/**
* Listen from CallbacksHandler when a call is incoming
...
...
@@ -450,6 +452,14 @@ NewCallModel::joinCalls(const std::string& callIdA, const std::string& callIdB)
}
}
std
::
string
NewCallModel
::
callAndAddParticipant
(
const
std
::
string
uri
,
const
std
::
string
&
callId
,
bool
audioOnly
)
{
auto
newCallId
=
createCall
(
uri
,
audioOnly
);
pimpl_
->
pendingConferences_
.
insert
({
newCallId
,
callId
});
return
newCallId
;
}
void
NewCallModel
::
removeParticipant
(
const
std
::
string
&
callId
,
const
std
::
string
&
participant
)
const
{
...
...
@@ -573,6 +583,10 @@ void
NewCallModelPimpl
::
setCurrentCall
(
const
std
::
string
&
callId
)
{
if
(
!
manageCurrentCall_
)
return
;
auto
it
=
pendingConferences_
.
find
(
callId
);
// Set current call only if not adding this call
// to a current conference
if
(
it
!=
pendingConferences_
.
end
())
return
;
std
::
vector
<
std
::
string
>
filterCalls
;
if
(
dontHoldConferences_
)
{
// Do not hold calls in a conference
...
...
@@ -671,16 +685,28 @@ NewCallModelPimpl::slotCallStateChanged(const std::string& callId, const std::st
// NOTE: signal emission order matters, always emit CallStatusChanged before CallEnded
emit
linked
.
callStatusChanged
(
callId
,
code
);
if
(
call
->
status
==
call
::
Status
::
ENDED
)
{
if
(
call
->
status
==
call
::
Status
::
OUTGOING_RINGING
)
{
setCurrentCall
(
callId
);
}
else
if
(
call
->
status
==
call
::
Status
::
ENDED
)
{
emit
linked
.
callEnded
(
callId
);
}
else
if
(
call
->
status
==
call
::
Status
::
IN_PROGRESS
)
{
if
(
previousStatus
==
call
::
Status
::
INCOMING_RINGING
||
previousStatus
==
call
::
Status
::
OUTGOING_RINGING
)
{
if
(
previousStatus
==
call
::
Status
::
INCOMING_RINGING
)
setCurrentCall
(
callId
);
call
->
startTime
=
std
::
chrono
::
steady_clock
::
now
();
setCurrentCall
(
callId
);
emit
linked
.
callStarted
(
callId
);
sendProfile
(
callId
);
}
// Add to calls if in pendingConferences_
auto
it
=
pendingConferences_
.
find
(
callId
);
if
(
it
!=
pendingConferences_
.
end
())
{
linked
.
joinCalls
(
it
->
second
,
it
->
first
);
pendingConferences_
.
erase
(
it
);
}
}
}
...
...
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