Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
a37827de
Commit
a37827de
authored
4 years ago
by
trilene
Browse files
Options
Downloads
Patches
Plain Diff
Change voip version type to string
parent
16dc1f49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#790
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/mtx/events/voip.hpp
+4
-4
4 additions, 4 deletions
include/mtx/events/voip.hpp
lib/structs/events/voip.cpp
+2
-8
2 additions, 8 deletions
lib/structs/events/voip.cpp
with
6 additions
and
12 deletions
include/mtx/events/voip.hpp
+
4
−
4
View file @
a37827de
...
...
@@ -22,7 +22,7 @@ struct CallInvite
//! The SDP text of the session description.
std
::
string
sdp
;
//! The version of the VoIP specification this message adheres to.
uint16_t
version
;
std
::
string
version
;
//! The time in milliseconds that the invite is valid for.
uint32_t
lifetime
;
};
...
...
@@ -51,7 +51,7 @@ struct CallCandidates
//! Array of objects describing the candidates.
std
::
vector
<
Candidate
>
candidates
;
//! The version of the VoIP specification this message adheres to.
uint16_t
version
;
std
::
string
version
;
};
void
...
...
@@ -68,7 +68,7 @@ struct CallAnswer
//! The SDP text of the session description.
std
::
string
sdp
;
//! The version of the VoIP specification this message adheres to.
uint16_t
version
;
std
::
string
version
;
};
void
...
...
@@ -90,7 +90,7 @@ struct CallHangUp
//! The ID of the call this event relates to.
std
::
string
call_id
;
//! The version of the VoIP specification this message adheres to.
uint16_t
version
;
std
::
string
version
;
//! The reason for the call hang up.
Reason
reason
=
Reason
::
User
;
};
...
...
This diff is collapsed.
Click to expand it.
lib/structs/events/voip.cpp
+
2
−
8
View file @
a37827de
#include
<cstdlib>
#include
<string>
#include
"mtx/events/voip.hpp"
...
...
@@ -8,17 +7,12 @@
using
json
=
nlohmann
::
json
;
namespace
{
uint16_t
std
::
string
version
(
const
json
&
obj
)
{
auto
v
=
obj
.
at
(
"version"
);
try
{
return
v
.
get
<
uint16_t
>
();
}
catch
(
const
json
::
type_error
&
)
{
return
std
::
atoi
(
v
.
get
<
std
::
string
>
().
c_str
());
}
return
v
.
is_number
()
?
"0"
:
v
.
get
<
std
::
string
>
();
}
}
namespace
mtx
::
events
::
msg
{
...
...
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