Remove references to video calls
This commit is contained in:
parent
43ec0c0624
commit
97681ccf64
6 changed files with 21 additions and 30 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include <cctype>
|
||||
#include <chrono>
|
||||
|
||||
#include <QMediaPlaylist>
|
||||
|
|
@ -198,12 +199,24 @@ CallManager::handleEvent_(const mtx::events::collections::TimelineEvents &event)
|
|||
void
|
||||
CallManager::handleEvent(const RoomEvent<CallInvite> &callInviteEvent)
|
||||
{
|
||||
nhlog::ui()->debug("WebRTC: call id: {} - incoming CallInvite from {}",
|
||||
callInviteEvent.content.call_id, callInviteEvent.sender);
|
||||
const char video[] = "m=video";
|
||||
const std::string &sdp = callInviteEvent.content.sdp;
|
||||
bool isVideo = std::search(sdp.cbegin(), sdp.cend(), std::cbegin(video), std::cend(video) - 1,
|
||||
[](unsigned char c1, unsigned char c2) {return std::tolower(c1) == std::tolower(c2);})
|
||||
!= sdp.cend();
|
||||
|
||||
nhlog::ui()->debug(std::string("WebRTC: call id: {} - incoming ") + (isVideo ? "video" : "voice") +
|
||||
" CallInvite from {}", callInviteEvent.content.call_id, callInviteEvent.sender);
|
||||
|
||||
if (callInviteEvent.content.call_id.empty())
|
||||
return;
|
||||
|
||||
if (isVideo) {
|
||||
emit newMessage(QString::fromStdString(callInviteEvent.room_id),
|
||||
CallHangUp{callInviteEvent.content.call_id, 0, CallHangUp::Reason::InviteTimeOut});
|
||||
return;
|
||||
}
|
||||
|
||||
auto roomInfo = cache::singleRoomInfo(callInviteEvent.room_id);
|
||||
if (onActiveCall() || roomInfo.member_count != 2) {
|
||||
emit newMessage(QString::fromStdString(callInviteEvent.room_id),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue