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
GitLab 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
e47fa583
Commit
e47fa583
authored
3 years ago
by
Aline Gondim Santos
Committed by
Sébastien Blin
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
conference: add handsUp feature
GitLab:
jami-project#855
Change-Id: I7b2b2b76310743b7b330bfa4c1f123306288b1fa
parent
dc894daf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/newcallmodel.h
+22
-1
22 additions, 1 deletion
src/api/newcallmodel.h
src/newcallmodel.cpp
+45
-4
45 additions, 4 deletions
src/newcallmodel.cpp
src/qtwrapper/callmanager_wrap.h
+8
-0
8 additions, 0 deletions
src/qtwrapper/callmanager_wrap.h
with
75 additions
and
5 deletions
src/api/newcallmodel.h
+
22
−
1
View file @
e47fa583
...
...
@@ -80,7 +80,9 @@ public:
* @param isAudioOnly, set to false by default
* @return the call uid created. Empty string is returned if call couldn't be created.
*/
QString
createCall
(
const
QString
&
uri
,
bool
isAudioOnly
=
false
,
VectorMapStringString
mediaList
=
{});
QString
createCall
(
const
QString
&
uri
,
bool
isAudioOnly
=
false
,
VectorMapStringString
mediaList
=
{});
/**
* Request a media change in a ongoing call.
...
...
@@ -286,6 +288,25 @@ public:
*/
void
setModerator
(
const
QString
&
confId
,
const
QString
&
peerId
,
const
bool
&
state
);
/**
* Check if a participant has raised hand
* @param confId The conference to check
* @param uri Uri of the participant to check (if empty, check current account)
* @return if hand is raised
*/
bool
isHandRaised
(
const
QString
&
confId
,
const
QString
&
uri
=
""
)
noexcept
;
/**
* Set/unset a moderator
* @param confId The conference to change
* @param peerId Uri of the participant to change
* @param state State of the change (true set hand raised / false unset hand raised)
*/
void
setHandRaised
(
const
QString
&
accountId
,
const
QString
&
confId
,
const
QString
&
peerId
,
bool
state
);
/**
* Mute/unmute participant
* @param confId The conference to change
...
...
This diff is collapsed.
Click to expand it.
src/newcallmodel.cpp
+
45
−
4
View file @
e47fa583
...
...
@@ -358,7 +358,11 @@ NewCallModel::createCall(const QString& uri, bool isAudioOnly, VectorMapStringSt
}
void
NewCallModel
::
requestMediaChange
(
const
QString
&
callId
,
const
QString
&
mediaLabel
,
const
QString
&
uri
,
MediaRequestType
type
,
bool
mute
)
NewCallModel
::
requestMediaChange
(
const
QString
&
callId
,
const
QString
&
mediaLabel
,
const
QString
&
uri
,
MediaRequestType
type
,
bool
mute
)
{
// Main audio: audio_0
// Main video: video_0
...
...
@@ -434,7 +438,8 @@ NewCallModel::requestMediaChange(const QString& callId, const QString& mediaLabe
item
[
MediaAttributeKey
::
ENABLED
]
=
"true"
;
item
[
MediaAttributeKey
::
MUTED
]
=
mute
?
"true"
:
"false"
;
item
[
MediaAttributeKey
::
SOURCE_TYPE
]
=
srctype
;
item
[
MediaAttributeKey
::
SOURCE
]
=
resource
.
isEmpty
()
?
item
[
MediaAttributeKey
::
SOURCE
]
:
resource
;
item
[
MediaAttributeKey
::
SOURCE
]
=
resource
.
isEmpty
()
?
item
[
MediaAttributeKey
::
SOURCE
]
:
resource
;
break
;
}
...
...
@@ -446,8 +451,7 @@ NewCallModel::requestMediaChange(const QString& callId, const QString& mediaLabe
MapStringString
mediaAttribute
=
{{
MediaAttributeKey
::
MEDIA_TYPE
,
MediaAttributeValue
::
VIDEO
},
{
MediaAttributeKey
::
ENABLED
,
"true"
},
{
MediaAttributeKey
::
MUTED
,
mute
?
"true"
:
"false"
},
{
MediaAttributeKey
::
MUTED
,
mute
?
"true"
:
"false"
},
{
MediaAttributeKey
::
SOURCE_TYPE
,
srctype
},
{
MediaAttributeKey
::
SOURCE
,
resource
},
{
MediaAttributeKey
::
LABEL
,
mediaLabel
}};
...
...
@@ -981,6 +985,43 @@ NewCallModel::setModerator(const QString& confId, const QString& peerId, const b
CallManager
::
instance
().
setModerator
(
confId
,
peerId
,
state
);
}
bool
NewCallModel
::
isHandRaised
(
const
QString
&
confId
,
const
QString
&
uri
)
noexcept
{
auto
call
=
pimpl_
->
calls
.
find
(
confId
);
if
(
call
==
pimpl_
->
calls
.
end
()
or
not
call
->
second
)
return
false
;
auto
ownerUri
=
owner
.
profileInfo
.
uri
;
auto
uriToCheck
=
uri
;
if
(
uriToCheck
.
isEmpty
())
{
uriToCheck
=
ownerUri
;
}
auto
handRaised
=
false
;
for
(
const
auto
&
participant
:
call
->
second
->
participantsInfos
)
{
auto
itUri
=
participant
.
find
(
"uri"
);
auto
itHand
=
participant
.
find
(
"handRaised"
);
if
(
itUri
!=
participant
.
end
()
&&
itHand
!=
participant
.
end
()
&&
*
itUri
==
uriToCheck
)
{
handRaised
=
participant
[
"handRaised"
]
==
"true"
;
break
;
}
}
return
handRaised
;
}
void
NewCallModel
::
setHandRaised
(
const
QString
&
accountId
,
const
QString
&
confId
,
const
QString
&
peerId
,
bool
state
)
{
auto
ownerUri
=
owner
.
profileInfo
.
uri
;
auto
uriToCheck
=
peerId
;
if
(
uriToCheck
.
isEmpty
())
{
uriToCheck
=
ownerUri
;
}
CallManager
::
instance
().
raiseParticipantHand
(
accountId
,
confId
,
uriToCheck
,
state
);
}
void
NewCallModel
::
muteParticipant
(
const
QString
&
confId
,
const
QString
&
peerId
,
const
bool
&
state
)
{
...
...
This diff is collapsed.
Click to expand it.
src/qtwrapper/callmanager_wrap.h
+
8
−
0
View file @
e47fa583
...
...
@@ -450,6 +450,14 @@ public Q_SLOTS: // METHODS
DRing
::
setModerator
(
confId
.
toStdString
(),
peerId
.
toStdString
(),
state
);
}
void
raiseParticipantHand
(
const
QString
&
accountId
,
const
QString
&
confId
,
const
QString
&
peerId
,
const
bool
&
state
)
{
DRing
::
raiseParticipantHand
(
accountId
.
toStdString
(),
confId
.
toStdString
(),
peerId
.
toStdString
(),
state
);
}
void
muteParticipant
(
const
QString
&
confId
,
const
QString
&
peerId
,
const
bool
&
state
)
{
DRing
::
muteParticipant
(
confId
.
toStdString
(),
peerId
.
toStdString
(),
state
);
...
...
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