summary refs log tree commit diff
path: root/src/voip
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 06:01:38 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 06:01:38 +0100
commit19dc6cadea0168f72daff7c0ed679ccdac71a7d5 (patch)
treeb10a86fcd0ab0f12f5e242996b307bb2cac97940 /src/voip
parentReduce allocations required for the palette (diff)
downloadnheko-19dc6cadea0168f72daff7c0ed679ccdac71a7d5.tar.xz
Reserve size of some containers we are filling
Diffstat (limited to 'src/voip')
-rw-r--r--src/voip/CallManager.cpp14
-rw-r--r--src/voip/WebRTCSession.cpp16
2 files changed, 21 insertions, 9 deletions
diff --git a/src/voip/CallManager.cpp b/src/voip/CallManager.cpp

index 70ea326d..8ea0c638 100644 --- a/src/voip/CallManager.cpp +++ b/src/voip/CallManager.cpp
@@ -70,7 +70,8 @@ CallManager::CallManager(QObject *parent) QTimer::singleShot(timeoutms_, this, [this, callid]() { if (session_.state() == webrtc::State::OFFERSENT && callid == callid_) { hangUp(CallHangUp::Reason::InviteTimeOut); - emit ChatPage::instance()->showNotification(QStringLiteral("The remote side failed to pick up.")); + emit ChatPage::instance()->showNotification( + QStringLiteral("The remote side failed to pick up.")); } }); }); @@ -177,7 +178,8 @@ CallManager::sendInvite(const QString &roomid, CallType callType, unsigned int w auto roomInfo = cache::singleRoomInfo(roomid.toStdString()); if (roomInfo.member_count != 2) { - emit ChatPage::instance()->showNotification(QStringLiteral("Calls are limited to 1:1 rooms.")); + emit ChatPage::instance()->showNotification( + QStringLiteral("Calls are limited to 1:1 rooms.")); return; } @@ -291,8 +293,9 @@ CallManager::handleEvent(const RoomEvent<CallInvite> &callInviteEvent) const QString &ringtone = ChatPage::instance()->userSettings()->ringtone(); if (ringtone != QLatin1String("Mute")) - playRingtone(ringtone == QLatin1String("Default") ? QUrl(QStringLiteral("qrc:/media/media/ring.ogg")) - : QUrl::fromLocalFile(ringtone), + playRingtone(ringtone == QLatin1String("Default") + ? QUrl(QStringLiteral("qrc:/media/media/ring.ogg")) + : QUrl::fromLocalFile(ringtone), true); roomid_ = QString::fromStdString(callInviteEvent.room_id); callid_ = callInviteEvent.content.call_id; @@ -370,7 +373,8 @@ CallManager::handleEvent(const RoomEvent<CallAnswer> &callAnswerEvent) if (callAnswerEvent.sender == utils::localUser().toStdString() && callid_ == callAnswerEvent.content.call_id) { if (!isOnCall()) { - emit ChatPage::instance()->showNotification(QStringLiteral("Call answered on another device.")); + emit ChatPage::instance()->showNotification( + QStringLiteral("Call answered on another device.")); stopRingtone(); haveCallInvite_ = false; emit newInviteState(); diff --git a/src/voip/WebRTCSession.cpp b/src/voip/WebRTCSession.cpp
index 6dc5e9ae..b93bbb5c 100644 --- a/src/voip/WebRTCSession.cpp +++ b/src/voip/WebRTCSession.cpp
@@ -44,12 +44,20 @@ WebRTCSession::WebRTCSession() : devices_(CallDevices::instance()) { qRegisterMetaType<webrtc::CallType>(); - qmlRegisterUncreatableMetaObject( - webrtc::staticMetaObject, "im.nheko", 1, 0, "CallType", QStringLiteral("Can't instantiate enum")); + qmlRegisterUncreatableMetaObject(webrtc::staticMetaObject, + "im.nheko", + 1, + 0, + "CallType", + QStringLiteral("Can't instantiate enum")); qRegisterMetaType<webrtc::State>(); - qmlRegisterUncreatableMetaObject( - webrtc::staticMetaObject, "im.nheko", 1, 0, "WebRTCState", QStringLiteral("Can't instantiate enum")); + qmlRegisterUncreatableMetaObject(webrtc::staticMetaObject, + "im.nheko", + 1, + 0, + "WebRTCState", + QStringLiteral("Can't instantiate enum")); connect(this, &WebRTCSession::stateChanged, this, &WebRTCSession::setState); init();